gallivm: add InstSimplify pass
authorRoland Scheidegger <sroland@vmware.com>
Wed, 2 Sep 2020 02:04:50 +0000 (04:04 +0200)
committerRoland Scheidegger <rscheidegger_lists@hispeed.ch>
Fri, 4 Sep 2020 18:19:07 +0000 (18:19 +0000)
This is the recommended replacement for the removed ConstantPropagation
pass, and llvm now added c binding for it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6585>

src/gallium/auxiliary/gallivm/lp_bld_init.c

index 1eb4892a4a6cf3c6d9465b1d9b1e7d878e5f6c76..fe3ef4a48df50a1e44be8f9a1409387ae7b44929 100644 (file)
@@ -171,6 +171,8 @@ create_pass_manager(struct gallivm_state *gallivm)
       LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
 #if LLVM_VERSION_MAJOR <= 11
       LLVMAddConstantPropagationPass(gallivm->passmgr);
+#else
+      LLVMAddInstructionSimplifyPass(gallivm->passmgr);
 #endif
       LLVMAddInstructionCombiningPass(gallivm->passmgr);
       LLVMAddGVNPass(gallivm->passmgr);