mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-04 18:06:49 +00:00
When deleting a phi cycle after looking through copies, constrain the register
to match its final use. With this change, all of test-suite compiles for Thumb2 with -verify-coalescing enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142287 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f2ddbcdcb9
commit
419eb3668b
@ -165,7 +165,11 @@ bool OptimizePHIs::OptimizeBB(MachineBasicBlock &MBB) {
|
||||
InstrSet PHIsInCycle;
|
||||
if (IsSingleValuePHICycle(MI, SingleValReg, PHIsInCycle) &&
|
||||
SingleValReg != 0) {
|
||||
MRI->replaceRegWith(MI->getOperand(0).getReg(), SingleValReg);
|
||||
unsigned OldReg = MI->getOperand(0).getReg();
|
||||
if (!MRI->constrainRegClass(SingleValReg, MRI->getRegClass(OldReg)))
|
||||
continue;
|
||||
|
||||
MRI->replaceRegWith(OldReg, SingleValReg);
|
||||
MI->eraseFromParent();
|
||||
++NumPHICycles;
|
||||
Changed = true;
|
||||
|
Loading…
Reference in New Issue
Block a user