Mesa (master): radeonsi/nir: Use nir stripping pass

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Mar 12 09:54:50 UTC 2019


Module: Mesa
Branch: master
Commit: 1bbe58c214b4ff7f614bfadb5c8691a2fe47ab51
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1bbe58c214b4ff7f614bfadb5c8691a2fe47ab51

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Mon Mar  4 18:00:30 2019 +0100

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 <tarceri at itsqueeze.com>

---

 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,




More information about the mesa-commit mailing list