mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-27 16:38:30 +00:00
Also handle the situation where an indirect branch is the first (and last)
instruction in a basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8a61da8a68
commit
d08d77318a
@ -808,16 +808,18 @@ void RAGreedy::splitAroundRegion(LiveInterval &VirtReg, unsigned PhysReg,
|
|||||||
DEBUG(dbgs() << ", uses at " << BI.LastUse << " after split point "
|
DEBUG(dbgs() << ", uses at " << BI.LastUse << " after split point "
|
||||||
<< BI.LastSplitPoint << ", stack-out.\n");
|
<< BI.LastSplitPoint << ", stack-out.\n");
|
||||||
SlotIndex SegEnd;
|
SlotIndex SegEnd;
|
||||||
if (BI.LastSplitPoint == Start)
|
// Find the last real instruction before the split point.
|
||||||
|
MachineBasicBlock::iterator SplitI =
|
||||||
|
LIS->getInstructionFromIndex(BI.LastSplitPoint);
|
||||||
|
MachineBasicBlock::iterator I = SplitI, B = BI.MBB->begin();
|
||||||
|
while (I != B && (--I)->isDebugValue())
|
||||||
|
;
|
||||||
|
if (I == SplitI)
|
||||||
SegEnd = SE.leaveIntvAtTop(*BI.MBB);
|
SegEnd = SE.leaveIntvAtTop(*BI.MBB);
|
||||||
else {
|
else {
|
||||||
MachineBasicBlock::iterator I =
|
|
||||||
LIS->getInstructionFromIndex(BI.LastSplitPoint);
|
|
||||||
do assert(I != BI.MBB->begin() && "Expected instruction");
|
|
||||||
while ((--I)->isDebugValue());
|
|
||||||
SegEnd = SE.leaveIntvAfter(LIS->getInstructionIndex(I));
|
SegEnd = SE.leaveIntvAfter(LIS->getInstructionIndex(I));
|
||||||
|
SE.useIntv(Start, SegEnd);
|
||||||
}
|
}
|
||||||
SE.useIntv(Start, SegEnd);
|
|
||||||
// Run a double interval from the split to the last use.
|
// Run a double interval from the split to the last use.
|
||||||
// This makes it possible to spill the complement without affecting the
|
// This makes it possible to spill the complement without affecting the
|
||||||
// indirect branch.
|
// indirect branch.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user