mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-26 11:10:49 +02:00
gallium/radeon: remove dead code creating LLVMTargetMachine
This was for some old unsupported LLVM version. Only si_create_context creates the target machine now. r600g doesn't use this function. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
a343ab55f7
commit
2b18d67a1e
3 changed files with 1 additions and 27 deletions
|
|
@ -192,40 +192,20 @@ static void radeonDiagnosticHandler(LLVMDiagnosticInfoRef di, void *context)
|
||||||
* @returns 0 for success, 1 for failure
|
* @returns 0 for success, 1 for failure
|
||||||
*/
|
*/
|
||||||
unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binary,
|
unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binary,
|
||||||
const char *gpu_family,
|
|
||||||
LLVMTargetMachineRef tm,
|
LLVMTargetMachineRef tm,
|
||||||
struct pipe_debug_callback *debug)
|
struct pipe_debug_callback *debug)
|
||||||
{
|
{
|
||||||
struct radeon_llvm_diagnostics diag;
|
struct radeon_llvm_diagnostics diag;
|
||||||
char cpu[CPU_STRING_LEN];
|
|
||||||
char fs[FS_STRING_LEN];
|
|
||||||
char *err;
|
char *err;
|
||||||
bool dispose_tm = false;
|
|
||||||
LLVMContextRef llvm_ctx;
|
LLVMContextRef llvm_ctx;
|
||||||
LLVMMemoryBufferRef out_buffer;
|
LLVMMemoryBufferRef out_buffer;
|
||||||
unsigned buffer_size;
|
unsigned buffer_size;
|
||||||
const char *buffer_data;
|
const char *buffer_data;
|
||||||
char triple[TRIPLE_STRING_LEN];
|
|
||||||
LLVMBool mem_err;
|
LLVMBool mem_err;
|
||||||
|
|
||||||
diag.debug = debug;
|
diag.debug = debug;
|
||||||
diag.retval = 0;
|
diag.retval = 0;
|
||||||
|
|
||||||
if (!tm) {
|
|
||||||
strncpy(triple, "r600--", TRIPLE_STRING_LEN);
|
|
||||||
LLVMTargetRef target = radeon_llvm_get_r600_target(triple);
|
|
||||||
if (!target) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
strncpy(cpu, gpu_family, CPU_STRING_LEN);
|
|
||||||
memset(fs, 0, sizeof(fs));
|
|
||||||
strncpy(fs, "+DumpCode", FS_STRING_LEN);
|
|
||||||
tm = LLVMCreateTargetMachine(target, triple, cpu, fs,
|
|
||||||
LLVMCodeGenLevelDefault, LLVMRelocDefault,
|
|
||||||
LLVMCodeModelDefault);
|
|
||||||
dispose_tm = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Setup Diagnostic Handler*/
|
/* Setup Diagnostic Handler*/
|
||||||
llvm_ctx = LLVMGetModuleContext(M);
|
llvm_ctx = LLVMGetModuleContext(M);
|
||||||
|
|
||||||
|
|
@ -255,9 +235,6 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binar
|
||||||
LLVMDisposeMemoryBuffer(out_buffer);
|
LLVMDisposeMemoryBuffer(out_buffer);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (dispose_tm) {
|
|
||||||
LLVMDisposeTargetMachine(tm);
|
|
||||||
}
|
|
||||||
if (diag.retval != 0)
|
if (diag.retval != 0)
|
||||||
pipe_debug_message(debug, SHADER_INFO, "LLVM compile failed");
|
pipe_debug_message(debug, SHADER_INFO, "LLVM compile failed");
|
||||||
return diag.retval;
|
return diag.retval;
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@ void radeon_llvm_shader_type(LLVMValueRef F, unsigned type);
|
||||||
LLVMTargetRef radeon_llvm_get_r600_target(const char *triple);
|
LLVMTargetRef radeon_llvm_get_r600_target(const char *triple);
|
||||||
|
|
||||||
unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binary,
|
unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binary,
|
||||||
const char *gpu_family,
|
|
||||||
LLVMTargetMachineRef tm,
|
LLVMTargetMachineRef tm,
|
||||||
struct pipe_debug_callback *debug);
|
struct pipe_debug_callback *debug);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6178,9 +6178,7 @@ int si_compile_llvm(struct si_screen *sscreen,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!si_replace_shader(count, binary)) {
|
if (!si_replace_shader(count, binary)) {
|
||||||
r = radeon_llvm_compile(mod, binary,
|
r = radeon_llvm_compile(mod, binary, tm, debug);
|
||||||
r600_get_llvm_processor_name(sscreen->b.family), tm,
|
|
||||||
debug);
|
|
||||||
if (r)
|
if (r)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue