X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fdrivers%2Fradeonsi%2Fsi_shader_tgsi_setup.c;h=7965b461dce7943546cfd0c80f1135727fbc195c;hb=5f4659260ec4bc49d951aa93da2945c1fbde9e2e;hp=f5c672eee8cfbfba9e6b357d5652771a82aeb208;hpb=dc4c551a345dc399e589382cd859812ea0d5bbae;p=mesa.git diff --git a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c index f5c672eee8c..7965b461dce 100644 --- a/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c +++ b/src/gallium/drivers/radeonsi/si_shader_tgsi_setup.c @@ -23,7 +23,6 @@ #include "si_shader_internal.h" #include "si_pipe.h" -#include "radeon/radeon_elf_util.h" #include "gallivm/lp_bld_const.h" #include "gallivm/lp_bld_gather.h" @@ -41,6 +40,7 @@ #include #include #include +#include /* Data for if/else/endif and bgnloop/endloop control flow structures. */ @@ -121,18 +121,20 @@ void si_llvm_shader_type(LLVMValueRef F, unsigned type) static void init_amdgpu_target() { gallivm_init_llvm_targets(); -#if HAVE_LLVM < 0x0307 - LLVMInitializeR600TargetInfo(); - LLVMInitializeR600Target(); - LLVMInitializeR600TargetMC(); - LLVMInitializeR600AsmPrinter(); -#else LLVMInitializeAMDGPUTargetInfo(); LLVMInitializeAMDGPUTarget(); LLVMInitializeAMDGPUTargetMC(); LLVMInitializeAMDGPUAsmPrinter(); -#endif + 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; @@ -988,7 +990,7 @@ void si_llvm_emit_store(struct lp_build_tgsi_context *bld_base, if (tgsi_type_is_64bit(dtype) && (chan_index == 1 || chan_index == 3)) continue; if (inst->Instruction.Saturate) - value = ac_emit_clamp(&ctx->ac, value); + value = ac_build_clamp(&ctx->ac, value); if (reg->Register.File == TGSI_FILE_ADDRESS) { temp_ptr = ctx->addrs[reg->Register.Index][chan_index];