Mesa (master): gallium/radeon: always add +DumpCode to the LLVM target machine for LLVM <= 3.5

Marek Olšák mareko at kemper.freedesktop.org
Sun Jan 3 22:02:45 UTC 2016


Module: Mesa
Branch: master
Commit: fb98acb5a156ce7b50938cc50fc61f8560c8f7f2
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fb98acb5a156ce7b50938cc50fc61f8560c8f7f2

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sun Dec 27 21:57:40 2015 +0100

gallium/radeon: always add +DumpCode to the LLVM target machine for LLVM <= 3.5

It's the same behavior that we use for later LLVM.

Reviewed-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/gallium/drivers/r600/r600_llvm.c          |    2 +-
 src/gallium/drivers/radeon/radeon_llvm_emit.c |    5 ++---
 src/gallium/drivers/radeon/radeon_llvm_emit.h |    2 +-
 src/gallium/drivers/radeonsi/si_shader.c      |    2 +-
 4 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/gallium/drivers/r600/r600_llvm.c b/src/gallium/drivers/r600/r600_llvm.c
index ef2e2a2..b8a20b3 100644
--- a/src/gallium/drivers/r600/r600_llvm.c
+++ b/src/gallium/drivers/r600/r600_llvm.c
@@ -923,7 +923,7 @@ unsigned r600_llvm_compile(
 	const char * gpu_family = r600_get_llvm_processor_name(family);
 
 	memset(&binary, 0, sizeof(struct radeon_shader_binary));
-	r = radeon_llvm_compile(mod, &binary, gpu_family, dump, dump, NULL, debug);
+	r = radeon_llvm_compile(mod, &binary, gpu_family, dump, NULL, debug);
 
 	r = r600_create_shader(bc, &binary, use_kill);
 
diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.c b/src/gallium/drivers/radeon/radeon_llvm_emit.c
index b765d36..408e815 100644
--- a/src/gallium/drivers/radeon/radeon_llvm_emit.c
+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.c
@@ -172,7 +172,7 @@ 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, bool dump_ir, bool dump_asm,
+			     const char *gpu_family, bool dump_ir,
 			     LLVMTargetMachineRef tm,
 			     struct pipe_debug_callback *debug)
 {
@@ -199,8 +199,7 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binar
 		}
 		strncpy(cpu, gpu_family, CPU_STRING_LEN);
 		memset(fs, 0, sizeof(fs));
-		if (dump_asm)
-			strncpy(fs, "+DumpCode", FS_STRING_LEN);
+		strncpy(fs, "+DumpCode", FS_STRING_LEN);
 		tm = LLVMCreateTargetMachine(target, triple, cpu, fs,
 				  LLVMCodeGenLevelDefault, LLVMRelocDefault,
 						  LLVMCodeModelDefault);
diff --git a/src/gallium/drivers/radeon/radeon_llvm_emit.h b/src/gallium/drivers/radeon/radeon_llvm_emit.h
index 29e4dc0..4084740 100644
--- a/src/gallium/drivers/radeon/radeon_llvm_emit.h
+++ b/src/gallium/drivers/radeon/radeon_llvm_emit.h
@@ -39,7 +39,7 @@ 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, bool dump_ir, bool dump_asm,
+			     const char *gpu_family, bool dump_ir,
 			     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 37a753c..4fdcd0d 100644
--- a/src/gallium/drivers/radeonsi/si_shader.c
+++ b/src/gallium/drivers/radeonsi/si_shader.c
@@ -3931,7 +3931,7 @@ int si_compile_llvm(struct si_screen *sscreen, struct si_shader *shader,
 
 	if (!si_replace_shader(count, &shader->binary)) {
 		r = radeon_llvm_compile(mod, &shader->binary,
-			r600_get_llvm_processor_name(sscreen->b.family), dump_ir, dump_asm, tm,
+			r600_get_llvm_processor_name(sscreen->b.family), dump_ir, tm,
 			debug);
 		if (r)
 			return r;




More information about the mesa-commit mailing list