mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Update live intervals more accurately for PHI elim. This slightly reduces
the live intervals for some registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15125 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -131,18 +131,9 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
|
|||||||
std::pair<LiveVariables::killed_iterator, LiveVariables::killed_iterator>
|
std::pair<LiveVariables::killed_iterator, LiveVariables::killed_iterator>
|
||||||
RKs = LV->killed_range(MPhi);
|
RKs = LV->killed_range(MPhi);
|
||||||
std::vector<std::pair<MachineInstr*, unsigned> > Range;
|
std::vector<std::pair<MachineInstr*, unsigned> > Range;
|
||||||
if (RKs.first != RKs.second) {
|
if (RKs.first != RKs.second) // Delete the range.
|
||||||
// Copy the range into a vector...
|
|
||||||
Range.assign(RKs.first, RKs.second);
|
|
||||||
|
|
||||||
// Delete the range...
|
|
||||||
LV->removeVirtualRegistersKilled(RKs.first, RKs.second);
|
LV->removeVirtualRegistersKilled(RKs.first, RKs.second);
|
||||||
|
|
||||||
// Add all of the kills back, which will update the appropriate info...
|
|
||||||
for (unsigned i = 0, e = Range.size(); i != e; ++i)
|
|
||||||
LV->addVirtualRegisterKilled(Range[i].second, PHICopy);
|
|
||||||
}
|
|
||||||
|
|
||||||
RKs = LV->dead_range(MPhi);
|
RKs = LV->dead_range(MPhi);
|
||||||
if (RKs.first != RKs.second) {
|
if (RKs.first != RKs.second) {
|
||||||
// Works as above...
|
// Works as above...
|
||||||
@@ -252,6 +243,11 @@ bool PNE::EliminatePHINodes(MachineFunction &MF, MachineBasicBlock &MBB) {
|
|||||||
if (!ValueIsLive) {
|
if (!ValueIsLive) {
|
||||||
MachineBasicBlock::iterator Prev = prior(I);
|
MachineBasicBlock::iterator Prev = prior(I);
|
||||||
LV->addVirtualRegisterKilled(SrcReg, Prev);
|
LV->addVirtualRegisterKilled(SrcReg, Prev);
|
||||||
|
|
||||||
|
// This vreg no longer lives all of the way through opBlock.
|
||||||
|
unsigned opBlockNum = opBlock.getNumber();
|
||||||
|
if (opBlockNum < InRegVI.AliveBlocks.size())
|
||||||
|
InRegVI.AliveBlocks[opBlockNum] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user