Restrict machine cse to really trivial coalescing. Leave the heavy lifting to a real...
authorEvan Cheng <evan.cheng@apple.com>
Mon, 8 Mar 2010 23:28:08 +0000 (23:28 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 8 Mar 2010 23:28:08 +0000 (23:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98007 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineCSE.cpp

index b376e3d05fee9257a96b1eee9c4638f85ff1e393..ce8ebbc601092404d4d5a245927fcabccadfc9db 100644 (file)
@@ -91,7 +91,10 @@ bool MachineCSE::PerformTrivialCoalescing(MachineInstr *MI,
     unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx;
     if (TII->isMoveInstr(*DefMI, SrcReg, DstReg, SrcSubIdx, DstSubIdx) &&
         TargetRegisterInfo::isVirtualRegister(SrcReg) &&
+        MRI->getRegClass(SrcReg) == MRI->getRegClass(Reg) &&
         !SrcSubIdx && !DstSubIdx) {
+      DEBUG(dbgs() << "Coalescing: " << *DefMI);
+      DEBUG(dbgs() << "*** to: " << *MI);
       MO.setReg(SrcReg);
       DefMI->eraseFromParent();
       ++NumCoalesces;