[llvm] r301961 - PEI: Skip dead objects when looking at CSRs

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 11:56:28 PDT 2017


Author: arsenm
Date: Tue May  2 13:56:28 2017
New Revision: 301961

URL: http://llvm.org/viewvc/llvm-project?rev=301961&view=rev
Log:
PEI: Skip dead objects when looking at CSRs

On AMDGPU if an SGPR is spilled to a VGPR, the frame index
is deleted. If there were any CSR SGPRs, this woudl
assert when setting the offset.

Modified:
    llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp

Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=301961&r1=301960&r2=301961&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Tue May  2 13:56:28 2017
@@ -761,6 +761,9 @@ void PEI::calculateFrameObjectOffsets(Ma
   } else if (MaxCSFrameIndex >= MinCSFrameIndex) {
     // Be careful about underflow in comparisons agains MinCSFrameIndex.
     for (unsigned i = MaxCSFrameIndex; i != MinCSFrameIndex - 1; --i) {
+      if (MFI.isDeadObjectIndex(i))
+        continue;
+
       unsigned Align = MFI.getObjectAlignment(i);
       // Adjust to alignment boundary
       Offset = alignTo(Offset, Align, Skew);




More information about the llvm-commits mailing list