[PATCH] D26005: AMDGPU: Don't use stack space for SGPR->VGPR spills

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 7 11:30:26 PST 2016


arsenm added inline comments.


================
Comment at: lib/Target/AMDGPU/SIRegisterInfo.cpp:979-988
+    // If more SGPRs are required to support the input user/system SGPRs,
+    // increase to accomodate them.
+    //
+    // FIXME: This really ends up using the requested number of SGPRs + number
+    // of reserved special registers in total. Theoretically you could re-use
+    // the last input registers for these special registers, but this would
+    // require a lot of complexity to deal with the weird aliasing.
----------------
arsenm wrote:
> nhaehnle wrote:
> > I wonder if this shouldn't be an error condition. After all, the frontend explicitly requested some maximum number of SGPRs, and now we break that request. It depends a bit on the use case for amdgpu-num-sgpr of course.
> I'm not really sure about this. I think we agreed that the other higher level attributes are what people should be using instead of directly specifying the number of registers. These I think were left for compiler stressing, so it probably doesn't really matter
Actually the code size point is only fixed by fitting all of the spills into the 64 element wide slot. The way it works in this patch is to leave the other 63-elements wasted, so the minimum offset is 64.


https://reviews.llvm.org/D26005





More information about the llvm-commits mailing list