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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@261347
91177308-0d34-0410-b5e6-
96231b3b80d8
"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);
+ }
}
}