}
}
-LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options)
+LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family,
+ enum ac_target_machine_options tm_options,
+ const char **out_triple)
{
assert(family >= CHIP_TAHITI);
char features[256];
LLVMRelocDefault,
LLVMCodeModelDefault);
+ if (out_triple)
+ *out_triple = triple;
return tm;
}
};
const char *ac_get_llvm_processor_name(enum radeon_family family);
-LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options);
+LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family,
+ enum ac_target_machine_options tm_options,
+ const char **out_triple);
LLVMTargetRef ac_get_llvm_target(const char *triple);
void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes);
tm_options |= AC_TM_SUPPORTS_SPILL;
if (device->instance->perftest_flags & RADV_PERFTEST_SISCHED)
tm_options |= AC_TM_SISCHED;
- tm = ac_create_target_machine(chip_family, tm_options);
+ tm = ac_create_target_machine(chip_family, tm_options, NULL);
if (gs_copy_shader) {
assert(shader_count == 1);
(sscreen->info.chip_class < GFX9 ? AC_TM_FORCE_DISABLE_XNACK : 0) |
(!sscreen->llvm_has_working_vgpr_indexing ? AC_TM_PROMOTE_ALLOCA_TO_SCRATCH : 0);
- compiler->tm = ac_create_target_machine(sscreen->info.family, tm_options);
+ compiler->tm = ac_create_target_machine(sscreen->info.family,
+ tm_options, &compiler->triple);
}
static void si_destroy_compiler(struct si_compiler *compiler)
/* Per-thread persistent LLVM objects. */
struct si_compiler {
LLVMTargetMachineRef tm;
+ const char *triple;
};
/* State of the context creating the shader object. */
ctx->gallivm.context = LLVMContextCreate();
ctx->gallivm.module = LLVMModuleCreateWithNameInContext("tgsi",
ctx->gallivm.context);
- LLVMSetTarget(ctx->gallivm.module, "amdgcn--");
+ LLVMSetTarget(ctx->gallivm.module, compiler->triple);
LLVMTargetDataRef data_layout = LLVMCreateTargetDataLayout(compiler->tm);
char *data_layout_str = LLVMCopyStringRepOfTargetData(data_layout);