mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-01 07:11:45 +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. llvm-svn: 142287
This commit is contained in:
parent
5ef0a146b9
commit
89bd8788a1
@ -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…
x
Reference in New Issue
Block a user