gallivm: fix build on LLVM 12 due to LLVMAddConstantPropagationPass removal

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>
(cherry picked from commit 52cac06862)
This commit is contained in:
Marek Olšák 2020-08-31 21:59:39 -04:00 committed by Dylan Baker
parent 7a63155052
commit 1629fe89a6
2 changed files with 3 additions and 1 deletions

View file

@ -490,7 +490,7 @@
"description": "gallivm: fix build on LLVM 12 due to LLVMAddConstantPropagationPass removal",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": null
},

View file

@ -169,7 +169,9 @@ create_pass_manager(struct gallivm_state *gallivm)
*/
LLVMAddReassociatePass(gallivm->passmgr);
LLVMAddPromoteMemoryToRegisterPass(gallivm->passmgr);
#if LLVM_VERSION_MAJOR <= 11
LLVMAddConstantPropagationPass(gallivm->passmgr);
#endif
LLVMAddInstructionCombiningPass(gallivm->passmgr);
LLVMAddGVNPass(gallivm->passmgr);
}