From 1bbe58c214b4ff7f614bfadb5c8691a2fe47ab51 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 4 Mar 2019 18:00:30 +0100 Subject: [PATCH] radeonsi/nir: Use nir stripping pass This reduces compilation time for my shader-db collection from around 40 seconds to 30, vs. 19 seconds for TGSI. There are still some shaders that TGSI caches but NIR doesn't, partly because of more aggressive cross-stage optimizations with NIR. Reviewed-by: Timothy Arceri --- src/gallium/drivers/radeonsi/si_shader_nir.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 5fc1df250aa..25429fdeab7 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -892,6 +892,11 @@ si_lower_nir(struct si_shader_selector* sel) } while (progress); NIR_PASS_V(sel->nir, nir_lower_bool_to_int32); + + /* Strip the resulting shader so that the shader cache is more likely + * to hit from other similar shaders. + */ + nir_strip(sel->nir); } static void declare_nir_input_vs(struct si_shader_context *ctx, -- 2.30.2