#ifdef LLVM_AVAILABLE
if (program->gfx_level >= GFX8) {
/* LLVM disassembler only supports GFX8+ */
- return true;
+ const char* name = ac_get_llvm_processor_name(program->family);
+ const char* triple = "amdgcn--";
+ LLVMTargetRef target = ac_get_llvm_target(triple);
+
+ LLVMTargetMachineRef tm = LLVMCreateTargetMachine(
+ target, triple, name, "", LLVMCodeGenLevelDefault, LLVMRelocDefault, LLVMCodeModelDefault);
+
+ bool supported = ac_is_llvm_processor_supported(tm, name);
+ LLVMDisposeTargetMachine(tm);
+
+ if (supported)
+ return true;
}
#endif
#endif
}
-static LLVMTargetRef ac_get_llvm_target(const char *triple)
+LLVMTargetRef ac_get_llvm_target(const char *triple)
{
LLVMTargetRef target = NULL;
char *err_message = NULL;
struct ac_compiler_passes *low_opt_passes;
};
+LLVMTargetRef ac_get_llvm_target(const char *triple);
const char *ac_get_llvm_processor_name(enum radeon_family family);
bool ac_is_llvm_processor_supported(LLVMTargetMachineRef tm, const char *processor);
void ac_add_attr_dereferenceable(LLVMValueRef val, uint64_t bytes);