summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
diff options
context:
space:
mode:
authorSanjoy Das <sanjoy@playingwithpointers.com>2016-02-19 18:15:56 +0000
committerSanjoy Das <sanjoy@playingwithpointers.com>2016-02-19 18:15:56 +0000
commitf6fee29ceb7477ab42a233480c866dc90d7b12f6 (patch)
tree2908d26214926ddc65050b204d4506ac79517497 /llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
parente8019df552fbb25329ee808b06a697cea171b370 (diff)
downloadbcm5719-llvm-f6fee29ceb7477ab42a233480c866dc90d7b12f6.tar.gz
bcm5719-llvm-f6fee29ceb7477ab42a233480c866dc90d7b12f6.zip
[StatepointLowering] Update StatepointMaxSlotsRequired correctly
Now that we don't always add an element to AllocatedStackSlots if we don't find a pre-existing unallocated stack slot, bumping StatepointMaxSlotsRequired to `NumSlots + 1` is not correct. Instead bump the statistic near the push_back, to Builder.FuncInfo.StatepointStackSlots.size(). llvm-svn: 261348
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index 37f74cb9d70..1e9d0ef794c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -99,14 +99,15 @@ StatepointLoweringState::allocateStackSlot(EVT ValueType,
// Couldn't find a free slot, so create a new one:
- StatepointMaxSlotsRequired =
- std::max<unsigned long>(StatepointMaxSlotsRequired, NumSlots + 1);
-
SDValue SpillSlot = Builder.DAG.CreateStackTemporary(ValueType);
const unsigned FI = cast<FrameIndexSDNode>(SpillSlot)->getIndex();
MFI->markAsStatepointSpillSlotObjectIndex(FI);
Builder.FuncInfo.StatepointStackSlots.push_back(FI);
+
+ StatepointMaxSlotsRequired = std::max<unsigned long>(
+ StatepointMaxSlotsRequired, Builder.FuncInfo.StatepointStackSlots.size());
+
return SpillSlot;
}
OpenPOWER on IntegriCloud