nir: Add a stripping pass for improved cacheability
Oftentimes various nir shaders after lowering will be the same, or almost the same. For example, this can happen when the same shader is linked with different shaders to form different pipelines and cross-stage optimizations don't kick in to change it. We want to avoid running the backend twice on these shaders. We were already doing this with radeonsi, but we were storing a few extra pieces of information that made this much less effective compared to TGSI. The worse offender by far was the program name, which caused most of the cache misses. This pass strips out these pieces of information, controlled by the NIR_STRIP debug env variable. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
@@ -3378,6 +3378,8 @@ bool nir_opt_undef(nir_shader *shader);
|
||||
|
||||
bool nir_opt_conditional_discard(nir_shader *shader);
|
||||
|
||||
void nir_strip(nir_shader *shader);
|
||||
|
||||
void nir_sweep(nir_shader *shader);
|
||||
|
||||
void nir_remap_dual_slot_attributes(nir_shader *shader,
|
||||
|
Reference in New Issue
Block a user