From 2b18d67a1eb64925d94de1734f63ffae471e98ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 8 Jun 2016 00:42:01 +0200 Subject: [PATCH] gallium/radeon: remove dead code creating LLVMTargetMachine MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/gallium/drivers/radeon/radeon_llvm_emit.c | 23 ------------------- src/gallium/drivers/radeon/radeon_llvm_emit.h | 1 - src/gallium/drivers/radeonsi/si_shader.c | 4 +--- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c b/src/gallium/drivers/radeon/radeon_llvm_emit.c index 13633d33b04..9611f15103c 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.c +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c @@ -192,40 +192,20 @@ static void radeonDiagnosticHandler(LLVMDiagnosticInfoRef di, void *context) * @returns 0 for success, 1 for failure */ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binary, - const char *gpu_family, LLVMTargetMachineRef tm, struct pipe_debug_callback *debug) { struct radeon_llvm_diagnostics diag; - char cpu[CPU_STRING_LEN]; - char fs[FS_STRING_LEN]; char *err; - bool dispose_tm = false; LLVMContextRef llvm_ctx; LLVMMemoryBufferRef out_buffer; unsigned buffer_size; const char *buffer_data; - char triple[TRIPLE_STRING_LEN]; LLVMBool mem_err; diag.debug = debug; 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*/ llvm_ctx = LLVMGetModuleContext(M); @@ -255,9 +235,6 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binar LLVMDisposeMemoryBuffer(out_buffer); out: - if (dispose_tm) { - LLVMDisposeTargetMachine(tm); - } if (diag.retval != 0) pipe_debug_message(debug, SHADER_INFO, "LLVM compile failed"); return diag.retval; diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.h b/src/gallium/drivers/radeon/radeon_llvm_emit.h index 84dbd2584a1..677978b4758 100644 --- a/src/gallium/drivers/radeon/radeon_llvm_emit.h +++ b/src/gallium/drivers/radeon/radeon_llvm_emit.h @@ -40,7 +40,6 @@ void radeon_llvm_shader_type(LLVMValueRef F, unsigned type); LLVMTargetRef radeon_llvm_get_r600_target(const char *triple); unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binary, - const char *gpu_family, LLVMTargetMachineRef tm, struct pipe_debug_callback *debug); diff --git a/src/gallium/drivers/radeonsi/si_shader.c b/src/gallium/drivers/radeonsi/si_shader.c index 4eb151f5872..9f8cb549b1b 100644 --- a/src/gallium/drivers/radeonsi/si_shader.c +++ b/src/gallium/drivers/radeonsi/si_shader.c @@ -6178,9 +6178,7 @@ int si_compile_llvm(struct si_screen *sscreen, } if (!si_replace_shader(count, binary)) { - r = radeon_llvm_compile(mod, binary, - r600_get_llvm_processor_name(sscreen->b.family), tm, - debug); + r = radeon_llvm_compile(mod, binary, tm, debug); if (r) return r; } -- 2.30.2