From 1629fe89a659a5af95cdc5e473e1eceb6413d1e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 31 Aug 2020 21:59:39 -0400 Subject: [PATCH] gallivm: fix build on LLVM 12 due to LLVMAddConstantPropagationPass removal Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3465 Cc: 20.1 20.2 Reviewed-by: Dave Airlie Part-of: (cherry picked from commit 52cac068621a5998f486f8e44f9c2d9d045d1c31) --- .pick_status.json | 2 +- src/gallium/auxiliary/gallivm/lp_bld_init.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 92da6a19b61..b45eb139cdf 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 }, diff --git a/src/gallium/auxiliary/gallivm/lp_bld_init.c b/src/gallium/auxiliary/gallivm/lp_bld_init.c index 6ebc9ebf25a..1eb4892a4a6 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_init.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_init.c @@ -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); }