gallivm: fix build on LLVM 12 due to LLVMAddConstantPropagationPass removal
authorMarek Olšák <marek.olsak@amd.com>
Tue, 1 Sep 2020 01:59:39 +0000 (21:59 -0400)
committerMarge Bot <eric+marge@anholt.net>
Tue, 1 Sep 2020 06:59:33 +0000 (06:59 +0000)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3465
Cc: 20.1 20.2 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6531>

src/gallium/auxiliary/gallivm/lp_bld_init.c

index 6ebc9ebf25a358c71228593a9c6427c77a6f2273..1eb4892a4a6cf3c6d9465b1d9b1e7d878e5f6c76 100644 (file)
@@ -169,7 +169,9 @@ create_pass_manager(struct gallivm_state *gallivm)
        */
       LLVMAddReassociatePass(gallivm->passmgr);
       LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
        */
       LLVMAddReassociatePass(gallivm->passmgr);
       LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
+#if LLVM_VERSION_MAJOR <= 11
       LLVMAddConstantPropagationPass(gallivm->passmgr);
       LLVMAddConstantPropagationPass(gallivm->passmgr);
+#endif
       LLVMAddInstructionCombiningPass(gallivm->passmgr);
       LLVMAddGVNPass(gallivm->passmgr);
    }
       LLVMAddInstructionCombiningPass(gallivm->passmgr);
       LLVMAddGVNPass(gallivm->passmgr);
    }