[llvm-commits] [llvm] r131768 - /llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
Cameron Zwarich
zwarich at apple.com
Fri May 20 16:25:36 PDT 2011
Author: zwarich
Date: Fri May 20 18:25:36 2011
New Revision: 131768
URL: http://llvm.org/viewvc/llvm-project?rev=131768&view=rev
Log:
Fix PR9962 by properly constraining register classes in RemoveCopyByCommutingDef(). This
actually fixes most of the VerifyCoalescing failures in test-suite.
Modified:
llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
Modified: llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp?rev=131768&r1=131767&r2=131768&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp (original)
+++ llvm/trunk/lib/CodeGen/SimpleRegisterCoalescing.cpp Fri May 20 18:25:36 2011
@@ -430,6 +430,10 @@
MachineInstr *NewMI = tii_->commuteInstruction(DefMI);
if (!NewMI)
return false;
+ if (TargetRegisterInfo::isVirtualRegister(IntA.reg) &&
+ TargetRegisterInfo::isVirtualRegister(IntB.reg) &&
+ !mri_->constrainRegClass(IntB.reg, mri_->getRegClass(IntA.reg)))
+ return false;
if (NewMI != DefMI) {
li_->ReplaceMachineInstrInMaps(DefMI, NewMI);
MBB->insert(DefMI, NewMI);
More information about the llvm-commits
mailing list