aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/RegAllocLinearScan.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2008-09-09 20:22:01 +0000
committerEvan Cheng <evan.cheng@apple.com>2008-09-09 20:22:01 +0000
commit55302169891f136b72706aee31eebeb308398ad2 (patch)
tree5e3f13b4f741293601013dbfbe695c56fb1b53ac /lib/CodeGen/RegAllocLinearScan.cpp
parent19e861a4ffb896f16a691d5ac869e894df3cd464 (diff)
Fix PR2757. Ignore liveinterval register allocation preference if the preference register is not in the right register class. This can happen due to sub-register coalescing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56006 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/RegAllocLinearScan.cpp')
-rw-r--r--lib/CodeGen/RegAllocLinearScan.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/RegAllocLinearScan.cpp b/lib/CodeGen/RegAllocLinearScan.cpp
index 91dda77147..2cfa755d16 100644
--- a/lib/CodeGen/RegAllocLinearScan.cpp
+++ b/lib/CodeGen/RegAllocLinearScan.cpp
@@ -1036,7 +1036,7 @@ unsigned RALinScan::getFreePhysReg(LiveInterval *cur) {
// If copy coalescer has assigned a "preferred" register, check if it's
// available first.
if (cur->preference) {
- if (prt_->isRegAvail(cur->preference)) {
+ if (prt_->isRegAvail(cur->preference) && RC->contains(cur->preference)) {
DOUT << "\t\tassigned the preferred register: "
<< tri_->getName(cur->preference) << "\n";
return cur->preference;