[Mesa-dev] [PATCH] amd/common: run the EarlyCSEMemSSA LLVM pass

Samuel Pitoiset samuel.pitoiset at gmail.com
Thu Oct 12 14:39:43 UTC 2017

It's recommended by the instruction combining pass, and
RadeonSI also runs it. The code size should decrease but
the number of register might increase a little bit.

Though, after comparing the shader stats with DOW3, it
appears that the number of registers has been decreased and
it gives a very minor boost (~+1%).

It also improves the raytracing Vulkan demo, 233->245 FPS
and doesn't seem to affect any other demos.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
 src/amd/common/ac_nir_to_llvm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/common/ac_nir_to_llvm.c b/src/amd/common/ac_nir_to_llvm.c
index 11ba487f37..a700c0c875 100644
--- a/src/amd/common/ac_nir_to_llvm.c
+++ b/src/amd/common/ac_nir_to_llvm.c
@@ -6168,6 +6168,10 @@ static void ac_llvm_finalize_module(struct nir_to_llvm_context * ctx)
+#if HAVE_LLVM >= 0x0400
+	/* This is recommended by the instruction combining pass. */
+	LLVMAddEarlyCSEMemSSAPass(passmgr);
 	/* Run the pass */

More information about the mesa-dev mailing list