[PATCH] D15583: For CI, reserve enough sgprs for flat scratch init if VCC is not used

Tom Stellard via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 16 12:27:27 PST 2015


tstellarAMD added inline comments.

================
Comment at: lib/Target/AMDGPU/AMDGPUAsmPrinter.cpp:417-418
@@ -416,4 +416,4 @@
 
-  if (VCCUsed)
+  if (VCCUsed || FlatUsed)
     MaxSGPR += 2;
 
----------------
Might as well fix this for VI too.

This if above can stay the same but the if below should be incremented by 4 on VI and 2 on CI.

================
Comment at: test/CodeGen/AMDGPU/ci-reserve-sgpr-for-flat-scratch-init.ll:1
@@ +1,2 @@
+; RUN: llc < %s -mtriple=amdgcn--amdhsa -mcpu=kaveri | FileCheck %s
+
----------------
This test will become obsolete once we stop initializing the flat_scratch registers when we have no scratch usage.

Also, I don' t think there is really a good way to test this with normal IR, since the test is dependent on the register allocator always allocating the same number of registers.

I think it may be possible to test this with inline assembly.  For now just drop the test, and I will try to add an inline assembly based test before I commit.


http://reviews.llvm.org/D15583





More information about the llvm-commits mailing list