gallium/radeon: always add +DumpCode to the LLVM target machine for LLVM <= 3.5
authorMarek Olšák <marek.olsak@amd.com>
Sun, 27 Dec 2015 20:57:40 +0000 (21:57 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sun, 3 Jan 2016 21:41:16 +0000 (22:41 +0100)
It's the same behavior that we use for later LLVM.

Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/r600/r600_llvm.c
src/gallium/drivers/radeon/radeon_llvm_emit.c
src/gallium/drivers/radeon/radeon_llvm_emit.h
src/gallium/drivers/radeonsi/si_shader.c

index ef2e2a2a117cbff1277f23f0e34628d46aa31fd0..b8a20b36af2bcc45c9cfdbaf1cbb8f902be858a1 100644 (file)
@@ -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);
 
index b765d367dabdd74b2d21538fddbebd50eb85f51e..408e81561062fa6cefb41277a680a6aa31f3e8dc 100644 (file)
@@ -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);
index 29e4dc05a3d7ec2d0743260f5891880ee1d661e1..4084740f457eb74d5debec981a582f997ef9d15d 100644 (file)
@@ -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);
 
index 37a753c18f10ddd86467edb883a7dfee324ddb36..4fdcd0dcabaeca84b6575ac7f7484f60feab6b6d 100644 (file)
@@ -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;