mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 05:25:47 +00:00
Start using the iterators in the fixed_ intervals to avoid having to binary
search physreg intervals every time we access it. This takes another half second off of linscan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17937 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -292,6 +292,7 @@ void RA::processActiveIntervals(unsigned CurPoint)
|
|||||||
void RA::processInactiveIntervals(unsigned CurPoint)
|
void RA::processInactiveIntervals(unsigned CurPoint)
|
||||||
{
|
{
|
||||||
DEBUG(std::cerr << "\tprocessing inactive intervals:\n");
|
DEBUG(std::cerr << "\tprocessing inactive intervals:\n");
|
||||||
|
|
||||||
for (unsigned i = 0, e = inactive_.size(); i != e; ++i) {
|
for (unsigned i = 0, e = inactive_.size(); i != e; ++i) {
|
||||||
LiveInterval *Interval = inactive_[i].first;
|
LiveInterval *Interval = inactive_[i].first;
|
||||||
LiveInterval::iterator IntervalPos = inactive_[i].second;
|
LiveInterval::iterator IntervalPos = inactive_[i].second;
|
||||||
@@ -363,6 +364,8 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur)
|
|||||||
|
|
||||||
spillWeights_.assign(mri_->getNumRegs(), 0.0);
|
spillWeights_.assign(mri_->getNumRegs(), 0.0);
|
||||||
|
|
||||||
|
unsigned StartPosition = cur->beginNumber();
|
||||||
|
|
||||||
// for each interval in active update spill weights
|
// for each interval in active update spill weights
|
||||||
for (IntervalPtrs::const_iterator i = active_.begin(), e = active_.end();
|
for (IntervalPtrs::const_iterator i = active_.begin(), e = active_.end();
|
||||||
i != e; ++i) {
|
i != e; ++i) {
|
||||||
@@ -387,13 +390,17 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur)
|
|||||||
|
|
||||||
// For every interval in fixed we overlap with, mark the register as not free
|
// For every interval in fixed we overlap with, mark the register as not free
|
||||||
// and update spill weights.
|
// and update spill weights.
|
||||||
for (IntervalPtrs::const_iterator i = fixed_.begin(),
|
for (unsigned i = 0, e = fixed_.size(); i != e; ++i) {
|
||||||
e = fixed_.end(); i != e; ++i)
|
IntervalPtr &IP = fixed_[i];
|
||||||
if (cur->overlapsFrom(*i->first, i->second)) {
|
LiveInterval *I = IP.first;
|
||||||
unsigned reg = i->first->reg;
|
LiveInterval::iterator II = I->advanceTo(IP.second, StartPosition);
|
||||||
|
IP.second = II;
|
||||||
|
if (cur->overlapsFrom(*I, II)) {
|
||||||
|
unsigned reg = I->reg;
|
||||||
prt_->addRegUse(reg);
|
prt_->addRegUse(reg);
|
||||||
updateSpillWeights(reg, i->first->weight);
|
updateSpillWeights(reg, I->weight);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsigned physReg = getFreePhysReg(cur);
|
unsigned physReg = getFreePhysReg(cur);
|
||||||
// restore the physical register tracker
|
// restore the physical register tracker
|
||||||
|
Reference in New Issue
Block a user