}
}
-LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, bool supports_spill)
+LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options)
{
assert(family >= CHIP_TAHITI);
- const char *triple = supports_spill ? "amdgcn-mesa-mesa3d" : "amdgcn--";
+ const char *triple = (tm_options & AC_TM_SUPPORTS_SPILL) ? "amdgcn-mesa-mesa3d" : "amdgcn--";
LLVMTargetRef target = ac_get_llvm_target(triple);
LLVMTargetMachineRef tm = LLVMCreateTargetMachine(
target,
AC_FUNC_ATTR_LEGACY = (1u << 31),
};
-LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, bool supports_spill);
+enum ac_target_machine_options {
+ AC_TM_SUPPORTS_SPILL = (1 << 0),
+};
+LLVMTargetMachineRef ac_create_target_machine(enum radeon_family family, enum ac_target_machine_options tm_options);
void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes);
bool ac_is_sgpr_param(LLVMValueRef param);
options.key = *key;
struct ac_shader_binary binary;
-
+ enum ac_target_machine_options tm_options = 0;
options.unsafe_math = !!(device->debug_flags & RADV_DEBUG_UNSAFE_MATH);
options.family = chip_family;
options.chip_class = device->physical_device->rad_info.chip_class;
options.supports_spill = device->llvm_supports_spill;
- tm = ac_create_target_machine(chip_family, options.supports_spill);
+ if (options.supports_spill)
+ tm_options |= AC_TM_SUPPORTS_SPILL;
+ tm = ac_create_target_machine(chip_family, tm_options);
ac_compile_nir_shader(tm, &binary, &variant->config,
&variant->info, shader, &options, dump);
LLVMDisposeTargetMachine(tm);
struct ac_nir_compiler_options options = {0};
struct ac_shader_binary binary;
+ enum ac_target_machine_options tm_options = 0;
options.family = chip_family;
options.chip_class = pipeline->device->physical_device->rad_info.chip_class;
- options.supports_spill = pipeline->device->llvm_supports_spill;
- tm = ac_create_target_machine(chip_family, options.supports_spill);
+ if (options.supports_spill)
+ tm_options |= AC_TM_SUPPORTS_SPILL;
+ tm = ac_create_target_machine(chip_family, tm_options);
ac_create_gs_copy_shader(tm, nir, &binary, &variant->config, &variant->info, &options, dump_shader);
LLVMDisposeTargetMachine(tm);