diff options
-rw-r--r-- | src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c index 5c63b732b38..7965b461dce 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c @@ -40,6 +40,7 @@ #include <stdio.h> #include <llvm-c/Transforms/IPO.h> #include <llvm-c/Transforms/Scalar.h> +#include <llvm-c/Support.h> /* Data for if/else/endif and bgnloop/endloop control flow structures. */ @@ -124,6 +125,16 @@ static void init_amdgpu_target() LLVMInitializeAMDGPUTarget(); LLVMInitializeAMDGPUTargetMC(); LLVMInitializeAMDGPUAsmPrinter(); + + if (HAVE_LLVM >= 0x0400) { + /* + * Workaround for bug in llvm 4.0 that causes image intrinsics + * to disappear. + * https://reviews.llvm.org/D26348 + */ + const char *argv[2] = {"mesa", "-simplifycfg-sink-common=false"}; + LLVMParseCommandLineOptions(2, argv, NULL); + } } static once_flag init_amdgpu_target_once_flag = ONCE_FLAG_INIT; |