radeonsi/gfx9: compile shaders with +xnack
authorMarek Olšák <marek.olsak@amd.com>
Fri, 7 Apr 2017 16:30:28 +0000 (18:30 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 22 May 2017 17:23:39 +0000 (19:23 +0200)
so that LLVM doesn't allocate SGPRs where XNACK is.

Cc: 17.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_pipe.c

index eaa3348bcb7571030bceb041216a2e12a682f1ef..6f82e294bdec14de2ceb0c6619cac796ae8a2c5c 100644 (file)
@@ -33,9 +33,6 @@
 #include "vl/vl_decoder.h"
 #include "../ddebug/dd_util.h"
 
-#define SI_LLVM_DEFAULT_FEATURES \
-       "+DumpCode,+vgpr-spilling,-fp32-denormals,-xnack"
-
 /*
  * pipe_context
  */
@@ -127,12 +124,16 @@ static LLVMTargetMachineRef
 si_create_llvm_target_machine(struct si_screen *sscreen)
 {
        const char *triple = "amdgcn--";
+       char features[256];
+
+       snprintf(features, sizeof(features),
+                "+DumpCode,+vgpr-spilling,-fp32-denormals,+fp64-denormals%s%s",
+                sscreen->b.chip_class >= GFX9 ? ",+xnack" : ",-xnack",
+                sscreen->b.debug_flags & DBG_SI_SCHED ? ",+si-scheduler" : "");
 
        return LLVMCreateTargetMachine(si_llvm_get_amdgpu_target(triple), triple,
                                       r600_get_llvm_processor_name(sscreen->b.family),
-                                      sscreen->b.debug_flags & DBG_SI_SCHED ?
-                                              SI_LLVM_DEFAULT_FEATURES ",+si-scheduler" :
-                                              SI_LLVM_DEFAULT_FEATURES,
+                                      features,
                                       LLVMCodeGenLevelDefault,
                                       LLVMRelocDefault,
                                       LLVMCodeModelDefault);