[Mesa-dev] [PATCH v3 3/3] i965/anv: use nir_opt_vectorize_io()
Timothy Arceri
tarceri at itsqueeze.com
Tue Nov 6 02:58:38 UTC 2018
Commit 8d8222461f9d7f49 caused substantially more URB messages in
geometry and tessellation shaders (due to enabling
nir_lower_io_to_scalar_early). This combines io again to avoid
this regression while still allowing link time optimisation of
components.
Shader-db results (SKL):
total instructions in shared programs: 13109035 -> 13107191 (-0.01%)
instructions in affected programs: 66278 -> 64434 (-2.78%)
helped: 242
HURT: 13
total cycles in shared programs: 332090418 -> 332094364 (<.01%)
cycles in affected programs: 285477 -> 289423 (1.38%)
helped: 39
HURT: 215
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107510
---
src/intel/vulkan/anv_pipeline.c | 6 ++++++
src/mesa/drivers/dri/i965/brw_link.cpp | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/src/intel/vulkan/anv_pipeline.c b/src/intel/vulkan/anv_pipeline.c
index ad0f08253e7..6c6b51679ce 100644
--- a/src/intel/vulkan/anv_pipeline.c
+++ b/src/intel/vulkan/anv_pipeline.c
@@ -1015,6 +1015,12 @@ anv_pipeline_compile_graphics(struct anv_pipeline *pipeline,
void *stage_ctx = ralloc_context(NULL);
+ if (nir_opt_vectorize_io(stages[s].nir, true)) {
+ brw_nir_optimize(stages[s].nir, compiler,
+ compiler->scalar_stage[stages[s].nir->info.stage],
+ false);
+ }
+
anv_pipeline_lower_nir(pipeline, stage_ctx, &stages[s], layout);
const unsigned *code;
diff --git a/src/mesa/drivers/dri/i965/brw_link.cpp b/src/mesa/drivers/dri/i965/brw_link.cpp
index 2cbb1e0b879..06454b79ec4 100644
--- a/src/mesa/drivers/dri/i965/brw_link.cpp
+++ b/src/mesa/drivers/dri/i965/brw_link.cpp
@@ -319,6 +319,12 @@ brw_link_shader(struct gl_context *ctx, struct gl_shader_program *shProg)
struct gl_program *prog = shader->Program;
+ if (nir_opt_vectorize_io(prog->nir, true)) {
+ brw_nir_optimize(prog->nir, compiler,
+ compiler->scalar_stage[prog->info.stage],
+ false);
+ }
+
_mesa_update_shader_textures_used(shProg, prog);
brw_shader_gather_info(prog->nir, prog);
--
2.19.1
More information about the mesa-dev
mailing list