mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-26 21:32:10 +00:00
Only update LiveVariables if it is available. addIntervalsForSpills
runs after the initial run of the live interval analysis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16075 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ccdf21af1f
commit
d8d26b3268
@ -186,6 +186,10 @@ std::vector<LiveInterval*> LiveIntervals::addIntervalsForSpills(
|
||||
VirtRegMap& vrm,
|
||||
int slot)
|
||||
{
|
||||
// since this is called after the analysis is done we don't know if
|
||||
// LiveVariables is available
|
||||
lv_ = getAnalysisToUpdate<LiveVariables>();
|
||||
|
||||
std::vector<LiveInterval*> added;
|
||||
|
||||
assert(li.weight != HUGE_VAL &&
|
||||
@ -212,8 +216,8 @@ std::vector<LiveInterval*> LiveIntervals::addIntervalsForSpills(
|
||||
for (unsigned i = 0; i != mi->getNumOperands(); ++i) {
|
||||
MachineOperand& mop = mi->getOperand(i);
|
||||
if (mop.isRegister() && mop.getReg() == li.reg) {
|
||||
if (MachineInstr* fmi =
|
||||
mri_->foldMemoryOperand(mi, i, slot)) {
|
||||
if (MachineInstr* fmi = mri_->foldMemoryOperand(mi, i, slot)) {
|
||||
if (lv_)
|
||||
lv_->instructionChanged(mi, fmi);
|
||||
vrm.virtFolded(li.reg, mi, fmi);
|
||||
mi2iMap_.erase(mi);
|
||||
@ -244,8 +248,7 @@ std::vector<LiveInterval*> LiveIntervals::addIntervalsForSpills(
|
||||
getUseIndex(index));
|
||||
|
||||
// create a new register for this spill
|
||||
unsigned nReg =
|
||||
mf_->getSSARegMap()->createVirtualRegister(rc);
|
||||
unsigned nReg = mf_->getSSARegMap()->createVirtualRegister(rc);
|
||||
mi->SetMachineOperandReg(i, nReg);
|
||||
vrm.grow();
|
||||
vrm.assignVirt2StackSlot(nReg, slot);
|
||||
@ -258,10 +261,10 @@ std::vector<LiveInterval*> LiveIntervals::addIntervalsForSpills(
|
||||
DEBUG(std::cerr << " +" << LR);
|
||||
nI.addRange(LR);
|
||||
added.push_back(&nI);
|
||||
// update live variables
|
||||
// update live variables if it is available
|
||||
if (lv_)
|
||||
lv_->addVirtualRegisterKilled(nReg, mi);
|
||||
DEBUG(std::cerr << "\t\t\t\tadded new interval: "
|
||||
<< nI << '\n');
|
||||
DEBUG(std::cerr << "\t\t\t\tadded new interval: " << nI << '\n');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user