mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
InlineSpiller: Remove quadratic behavior.
No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181149 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
46abfcf418
commit
e210df20d3
@ -955,18 +955,21 @@ void InlineSpiller::reMaterializeAll() {
|
||||
Edit->eliminateDeadDefs(DeadDefs, RegsToSpill);
|
||||
|
||||
// Get rid of deleted and empty intervals.
|
||||
for (unsigned i = RegsToSpill.size(); i != 0; --i) {
|
||||
unsigned Reg = RegsToSpill[i-1];
|
||||
if (!LIS.hasInterval(Reg)) {
|
||||
RegsToSpill.erase(RegsToSpill.begin() + (i - 1));
|
||||
unsigned ResultPos = 0;
|
||||
for (unsigned i = 0, e = RegsToSpill.size(); i != e; ++i) {
|
||||
unsigned Reg = RegsToSpill[i];
|
||||
if (!LIS.hasInterval(Reg))
|
||||
continue;
|
||||
|
||||
LiveInterval &LI = LIS.getInterval(Reg);
|
||||
if (LI.empty()) {
|
||||
Edit->eraseVirtReg(Reg);
|
||||
continue;
|
||||
}
|
||||
LiveInterval &LI = LIS.getInterval(Reg);
|
||||
if (!LI.empty())
|
||||
continue;
|
||||
Edit->eraseVirtReg(Reg);
|
||||
RegsToSpill.erase(RegsToSpill.begin() + (i - 1));
|
||||
|
||||
RegsToSpill[ResultPos++] = Reg;
|
||||
}
|
||||
RegsToSpill.erase(RegsToSpill.begin() + ResultPos, RegsToSpill.end());
|
||||
DEBUG(dbgs() << RegsToSpill.size() << " registers to spill after remat.\n");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user