mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 09:48:07 +02:00
aco: use ac_is_llvm_processor_supported() for checking LLVM asm support
It seems more universal but it's needed to create a temporary TM. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Rhys Perry <pendingchaos02@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16494>
This commit is contained in:
parent
07eba9a15a
commit
8510d5daa3
3 changed files with 14 additions and 2 deletions
|
|
@ -407,7 +407,18 @@ check_print_asm_support(Program* program)
|
|||
#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
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ void ac_init_llvm_once(void)
|
|||
#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;
|
||||
|
|
|
|||
|
|
@ -89,6 +89,7 @@ struct ac_llvm_compiler {
|
|||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue