mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-09 16:45:03 +00:00
Fix a couple of bugs where we considered physregs past their range as possibly
intersecting an interval. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17939 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1a3a487763
commit
f348e3abfc
@ -145,6 +145,7 @@ bool RA::runOnMachineFunction(MachineFunction &fn) {
|
||||
tm_ = &fn.getTarget();
|
||||
mri_ = tm_->getRegisterInfo();
|
||||
li_ = &getAnalysis<LiveIntervals>();
|
||||
|
||||
if (!prt_.get()) prt_.reset(new PhysRegTracker(*mri_));
|
||||
vrm_.reset(new VirtRegMap(*mf_));
|
||||
if (!spiller_.get()) spiller_.reset(createSpiller());
|
||||
@ -393,12 +394,16 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur)
|
||||
for (unsigned i = 0, e = fixed_.size(); i != e; ++i) {
|
||||
IntervalPtr &IP = fixed_[i];
|
||||
LiveInterval *I = IP.first;
|
||||
LiveInterval::iterator II = I->advanceTo(IP.second, StartPosition);
|
||||
IP.second = II;
|
||||
if (cur->overlapsFrom(*I, II)) {
|
||||
unsigned reg = I->reg;
|
||||
prt_->addRegUse(reg);
|
||||
updateSpillWeights(reg, I->weight);
|
||||
if (I->endNumber() > StartPosition) {
|
||||
LiveInterval::iterator II = I->advanceTo(IP.second, StartPosition);
|
||||
IP.second = II;
|
||||
if (II != I->begin() && II->start > StartPosition)
|
||||
--II;
|
||||
if (cur->overlapsFrom(*I, II)) {
|
||||
unsigned reg = I->reg;
|
||||
prt_->addRegUse(reg);
|
||||
updateSpillWeights(reg, I->weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user