diff options
author | Marek Olšák <[email protected]> | 2017-07-04 22:38:37 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2017-07-17 10:50:39 -0400 |
commit | 4560f2b90a2a5551166fb21d97c646614c91fb77 (patch) | |
tree | e3fe0c297f74e78344539029ec501779b4b6881e /src/amd | |
parent | c351037d6c097427a7f80da8a86e42c224c2f260 (diff) |
radeonsi: merge si_llvm_get_amdgpu_target into ac_get_llvm_target
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/common/ac_llvm_util.c | 18 | ||||
-rw-r--r-- | src/amd/common/ac_llvm_util.h | 1 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/amd/common/ac_llvm_util.c b/src/amd/common/ac_llvm_util.c index ea752e031ef..675926ea679 100644 --- a/src/amd/common/ac_llvm_util.c +++ b/src/amd/common/ac_llvm_util.c @@ -40,21 +40,23 @@ static void ac_init_llvm_target() LLVMInitializeAMDGPUTargetMC(); LLVMInitializeAMDGPUAsmPrinter(); - /* - * Workaround for bug in llvm 4.0 that causes image intrinsics + /* For inline assembly. */ + LLVMInitializeAMDGPUAsmParser(); + + /* Workaround for bug in llvm 4.0 that causes image intrinsics * to disappear. * https://reviews.llvm.org/D26348 */ -#if HAVE_LLVM >= 0x0400 - const char *argv[2] = {"mesa", "-simplifycfg-sink-common=false"}; - LLVMParseCommandLineOptions(2, argv, NULL); -#endif - + if (HAVE_LLVM >= 0x0400) { + /* "mesa" is the prefix for error messages */ + const char *argv[2] = { "mesa", "-simplifycfg-sink-common=false" }; + LLVMParseCommandLineOptions(2, argv, NULL); + } } static once_flag ac_init_llvm_target_once_flag = ONCE_FLAG_INIT; -static LLVMTargetRef ac_get_llvm_target(const char *triple) +LLVMTargetRef ac_get_llvm_target(const char *triple) { LLVMTargetRef target = NULL; char *err_message = NULL; diff --git a/src/amd/common/ac_llvm_util.h b/src/amd/common/ac_llvm_util.h index 21f3e837747..cc4fe3bd632 100644 --- a/src/amd/common/ac_llvm_util.h +++ b/src/amd/common/ac_llvm_util.h @@ -60,6 +60,7 @@ enum ac_target_machine_options { }; LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options); +LLVMTargetRef ac_get_llvm_target(const char *triple); void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes); bool ac_is_sgpr_param(LLVMValueRef param); void ac_add_function_attr(LLVMContextRef ctx, LLVMValueRef function, |