mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-17 07:22:54 +00:00
Fix PR9962 by properly constraining register classes in RemoveCopyByCommutingDef(). This
actually fixes most of the VerifyCoalescing failures in test-suite. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131768 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
43299776d7
commit
345968c82d
@ -430,6 +430,10 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP,
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user