diff options
| author | Chris Lattner <sabre@nondot.org> | 2005-08-30 21:03:36 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2005-08-30 21:03:36 +0000 |
| commit | e836ad6736492c239be8f1d125369ae8ef0d9401 (patch) | |
| tree | 9952c6911fa0a494417364037e58665f5d8142c0 /lib/CodeGen/RegAllocLinearScan.cpp | |
| parent | 353f1dea504193cf7a6d4afbe2f316434c6731e0 (diff) | |
When checking the fixed intervals, don't forget to check for register aliases.
This fixes PR621 and Regression/CodeGen/X86/2005-08-30-RegAllocAliasProblem.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23158 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
| -rw-r--r-- | lib/CodeGen/RegAllocLinearScan.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp index 06682dd11e..584316ecd7 100644 --- a/lib/CodeGen/RegAllocLinearScan.cpp +++ b/lib/CodeGen/RegAllocLinearScan.cpp @@ -444,10 +444,16 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur) unsigned physReg = getFreePhysReg(cur); if (physReg) { // We got a register. However, if it's in the fixed_ list, we might - // conflict with it. Check to see if we conflict with it. + // conflict with it. Check to see if we conflict with it or any of its + // aliases. + std::set<unsigned> RegAliases; + for (const unsigned *AS = mri_->getAliasSet(physReg); *AS; ++AS) + RegAliases.insert(*AS); + bool ConflictsWithFixed = false; for (unsigned i = 0, e = fixed_.size(); i != e; ++i) { - if (physReg == fixed_[i].first->reg) { + if (physReg == fixed_[i].first->reg || + RegAliases.count(fixed_[i].first->reg)) { // Okay, this reg is on the fixed list. Check to see if we actually // conflict. IntervalPtr &IP = fixed_[i]; @@ -457,11 +463,11 @@ void RA::assignRegOrStackSlotAtInterval(LiveInterval* cur) IP.second = II; if (II != I->begin() && II->start > StartPosition) --II; - if (cur->overlapsFrom(*I, II)) + if (cur->overlapsFrom(*I, II)) { ConflictsWithFixed = true; + break; + } } - - break; } } |
