Do not crash when joining two intervals of registers of different
classes: just ignore that move. Thanks to Vladimir Prus who found the
bug!

llvm-svn: 14644
diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp
index 9c10805..2347c6b 100644
--- a/llvm/lib/CodeGen/LiveIntervals.cpp
+++ b/llvm/lib/CodeGen/LiveIntervals.cpp
@@ -502,7 +502,9 @@
                     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 @@
                            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);