File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -973,10 +973,11 @@ void MachineCopyPropagation::ForwardCopyPropagateBlock(MachineBasicBlock &MBB) {
973973
974974 // It's possible that the previous transformation has resulted in a no-op
975975 // register move (i.e. one where source and destination registers are the
976- // same). If so, delete it.
976+ // same and are not referring to a reserved register ). If so, delete it.
977977 CopyOperands = isCopyInstr (MI, *TII, UseCopyInstr);
978978 if (CopyOperands &&
979- CopyOperands->Source ->getReg () == CopyOperands->Destination ->getReg ()) {
979+ CopyOperands->Source ->getReg () == CopyOperands->Destination ->getReg () &&
980+ !MRI->isReserved (CopyOperands->Source ->getReg ())) {
980981 MI.eraseFromParent ();
981982 NumDeletes++;
982983 Changed = true ;
You can’t perform that action at this time.
0 commit comments