aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-06 16:03:21 +0000
committerAlkis Evlogimenos <alkis@evlogimenos.com>2004-07-06 16:03:21 +0000
commit5de868b0b2daf145d7991bc9b3bf25807bcc7ca7 (patch)
tree5ed07e00a7d8010e56056826cd794c64e07785bb
parente9c6551fed0a66f050c3c68a6cc0dbe2b254780f (diff)
Do not crash when joining two intervals of registers of different
classes: just ignore that move. Thanks to Vladimir Prus who found the bug! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14644 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/LiveIntervalAnalysis.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/CodeGen/LiveIntervalAnalysis.cpp b/lib/CodeGen/LiveIntervalAnalysis.cpp
index 9c10805644..2347c6b567 100644
--- a/lib/CodeGen/LiveIntervalAnalysis.cpp
+++ b/lib/CodeGen/LiveIntervalAnalysis.cpp
@@ -502,7 +502,9 @@ void LiveIntervals::joinIntervals()
const TargetRegisterClass *rcA, *rcB;
rcA = mf_->getSSARegMap()->getRegClass(intA->reg);
rcB = mf_->getSSARegMap()->getRegClass(intB->reg);
- assert(rcA == rcB && "registers must be of the same class");
+ // if they are not of the same register class we continue
+ if (rcA != rcB)
+ continue;
// if their intervals do not overlap we join them
if (!intB->overlaps(*intA)) {
@@ -524,6 +526,13 @@ void LiveIntervals::joinIntervals()
MRegisterInfo::isVirtualRegister(intB->reg) &&
"A must be physical and B must be virtual");
+ const TargetRegisterClass *rcA, *rcB;
+ rcA = mri_->getRegClass(intA->reg);
+ rcB = mf_->getSSARegMap()->getRegClass(intB->reg);
+ // if they are not of the same register class we continue
+ if (rcA != rcB)
+ continue;
+
if (!intA->overlaps(*intB) &&
!overlapsAliases(*intA, *intB)) {
intA->join(*intB);