summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/LiveIntervalAnalysis.cpp')
-rw-r--r--llvm/lib/CodeGen/LiveIntervalAnalysis.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
index e64652dedfd..c2426a69c8c 100644
--- a/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -241,9 +241,13 @@ void LiveIntervals::computeRegMasks() {
}
}
- // Some block ends, such as funclet returns, create masks.
+ // Some block ends, such as funclet returns, create masks. Put the mask on
+ // the last instruction of the block, because MBB slot index intervals are
+ // half-open.
if (const uint32_t *Mask = MBB.getEndClobberMask(TRI)) {
- RegMaskSlots.push_back(Indexes->getMBBEndIdx(&MBB));
+ assert(!MBB.empty() && "empty return block?");
+ RegMaskSlots.push_back(
+ Indexes->getInstructionIndex(&MBB.back()).getRegSlot());
RegMaskBits.push_back(Mask);
}
OpenPOWER on IntegriCloud