radeonsi: call LLVMAddEarlyCSEMemSSAPass only for LLVM >= 4.0
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 8 Jun 2017 19:22:08 +0000 (21:22 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 8 Jun 2017 21:32:32 +0000 (23:32 +0200)
LLVMAddEarlyCSEMemSSAPass() is defined in LLVM 4.0.

Fixes: 257b538 ("radeonsi: do EarlyCSEMemSSA LLVM pass)
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c

index 802e2b94e9ea92642b4d76f4a6d939a081ca3335..d5e988edebf26480dd636e2ee4a77f2513830f25 100644 (file)
@@ -1451,8 +1451,10 @@ void si_llvm_optimize_module(struct si_shader_context *ctx)
        LLVMAddLICMPass(gallivm->passmgr);
        LLVMAddAggressiveDCEPass(gallivm->passmgr);
        LLVMAddCFGSimplificationPass(gallivm->passmgr);
+#if HAVE_LLVM >= 0x0400
        /* This is recommended by the instruction combining pass. */
        LLVMAddEarlyCSEMemSSAPass(gallivm->passmgr);
+#endif
        LLVMAddInstructionCombiningPass(gallivm->passmgr);
 
        /* Run the pass */