[llvm] r261347 - [StatepointLowering] Fix a mistake in rL261336

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 19 10:15:53 PST 2016


Author: sanjoy
Date: Fri Feb 19 12:15:53 2016
New Revision: 261347

URL: http://llvm.org/viewvc/llvm-project?rev=261347&view=rev
Log:
[StatepointLowering] Fix a mistake in rL261336

The check on MFI->getObjectSize() has to be on the FrameIndex, not on
the index of the FrameIndex in AllocatedStackSlots.  Weirdly, the tests
I added in rL261336 didn't catch this.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp?rev=261347&r1=261346&r2=261347&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/StatepointLowering.cpp Fri Feb 19 12:15:53 2016
@@ -88,11 +88,12 @@ StatepointLoweringState::allocateStackSl
          "Broken invariant");
 
   for (; NextSlotToAllocate < NumSlots; NextSlotToAllocate++) {
-    if (!AllocatedStackSlots.test(NextSlotToAllocate) &&
-        MFI->getObjectSize(NextSlotToAllocate) == SpillSize) {
+    if (!AllocatedStackSlots.test(NextSlotToAllocate)) {
       const int FI = Builder.FuncInfo.StatepointStackSlots[NextSlotToAllocate];
-      AllocatedStackSlots.set(NextSlotToAllocate);
-      return Builder.DAG.getFrameIndex(FI, ValueType);
+      if (MFI->getObjectSize(FI) == SpillSize) {
+        AllocatedStackSlots.set(NextSlotToAllocate);
+        return Builder.DAG.getFrameIndex(FI, ValueType);
+      }
     }
   }
 




More information about the llvm-commits mailing list