mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-23 20:29:30 +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);
|
MachineInstr *NewMI = tii_->commuteInstruction(DefMI);
|
||||||
if (!NewMI)
|
if (!NewMI)
|
||||||
return false;
|
return false;
|
||||||
|
if (TargetRegisterInfo::isVirtualRegister(IntA.reg) &&
|
||||||
|
TargetRegisterInfo::isVirtualRegister(IntB.reg) &&
|
||||||
|
!mri_->constrainRegClass(IntB.reg, mri_->getRegClass(IntA.reg)))
|
||||||
|
return false;
|
||||||
if (NewMI != DefMI) {
|
if (NewMI != DefMI) {
|
||||||
li_->ReplaceMachineInstrInMaps(DefMI, NewMI);
|
li_->ReplaceMachineInstrInMaps(DefMI, NewMI);
|
||||||
MBB->insert(DefMI, NewMI);
|
MBB->insert(DefMI, NewMI);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user