[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.

llvm-svn: 261347
This commit is contained in:
Sanjoy Das 2016-02-19 18:15:53 +00:00
parent 29c997c1a1
commit e8019df552
1 changed files with 5 additions and 4 deletions

View File

@ -88,11 +88,12 @@ StatepointLoweringState::allocateStackSlot(EVT ValueType,
"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);
}
}
}