[PATCH] D15583: Reserve appropriate number of sgprs for flat scratch init.
    Changpeng Fang via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Dec 16 13:17:54 PST 2015
    
    
  
cfang retitled this revision from "For CI, reserve enough sgprs for flat scratch init if VCC is not used" to "Reserve appropriate number of  sgprs for flat scratch init.".
cfang updated the summary for this revision.
cfang updated this revision to Diff 43055.
cfang added a comment.
update based on Tom's comments:
1. also fix the sgpr reservation for VI+;
2. drop the LIT test for now.
http://reviews.llvm.org/D15583
Files:
  lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
Index: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
===================================================================
--- lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
+++ lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp
@@ -414,11 +414,15 @@
     }
   }
 
-  if (VCCUsed)
+  if (VCCUsed || FlatUsed)
     MaxSGPR += 2;
 
-  if (FlatUsed)
+  if (FlatUsed) {
     MaxSGPR += 2;
+    // 2 additional for VI+.
+    if (STM.getGeneration() >= AMDGPUSubtarget::VOLCANIC_ISLANDS)
+      MaxSGPR += 2;
+  }
 
   // We found the maximum register index. They start at 0, so add one to get the
   // number of registers.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15583.43055.patch
Type: text/x-patch
Size: 590 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20151216/0929bb46/attachment-0001.bin>
    
    
More information about the llvm-commits
mailing list