aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2009-06-04 20:53:36 +0000
committerEvan Cheng <evan.cheng@apple.com>2009-06-04 20:53:36 +0000
commit073e7e5807991a9f614569426fdd6536728c01ca (patch)
tree2b5cae4a8598788ed567177289029a4316ec67d7 /lib
parent550aacb978a8391f605c6ec1feca7d797415d38b (diff)
downloadexternal_llvm-073e7e5807991a9f614569426fdd6536728c01ca.zip
external_llvm-073e7e5807991a9f614569426fdd6536728c01ca.tar.gz
external_llvm-073e7e5807991a9f614569426fdd6536728c01ca.tar.bz2
RALinScan::attemptTrivialCoalescing() was returning a virtual register instead of the physical register it is allocated to. This resulted in virtual register(s) being added the live-in sets.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72890 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp
index ab4068e..804fae5 100644
--- a/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/lib/CodeGen/RegAllocLinearScan.cpp
@@ -398,7 +398,7 @@ unsigned RALinScan::attemptTrivialCoalescing(LiveInterval &cur, unsigned Reg) {
}
++NumCoalesce;
- return SrcReg;
+ return PhysReg;
}
return Reg;
@@ -555,8 +555,11 @@ void RALinScan::linearScan()
re = mri_->reg_end(); ri != re; ++ri) {
MachineInstr *UseMI = &*ri;
MachineBasicBlock *UseMBB = UseMI->getParent();
- if (Seen.insert(UseMBB))
+ if (Seen.insert(UseMBB)) {
+ assert(TargetRegisterInfo::isPhysicalRegister(Reg) &&
+ "Adding a virtual register to livein set?");
UseMBB->addLiveIn(Reg);
+ }
}
}
}
@@ -565,8 +568,11 @@ void RALinScan::linearScan()
const LiveRange &LR = *I;
if (li_->findLiveInMBBs(LR.start, LR.end, LiveInMBBs)) {
for (unsigned i = 0, e = LiveInMBBs.size(); i != e; ++i)
- if (LiveInMBBs[i] != EntryMBB)
+ if (LiveInMBBs[i] != EntryMBB) {
+ assert(TargetRegisterInfo::isPhysicalRegister(Reg) &&
+ "Adding a virtual register to livein set?");
LiveInMBBs[i]->addLiveIn(Reg);
+ }
LiveInMBBs.clear();
}
}