Skip to content

Commit 692628a

Browse files
committed
Remove copyPhysReg change and remove IsRenamable checking
1 parent b8838e5 commit 692628a

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

llvm/lib/CodeGen/MachineCopyPropagation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ static bool isBackwardPropagatableCopy(const DestSourcePair &CopyOperands,
983983
if (MRI.isReserved(Def) || MRI.isReserved(Src))
984984
return false;
985985

986-
return CopyOperands.Source->isRenamable() && CopyOperands.Source->isKill();
986+
return CopyOperands.Source->isKill();
987987
}
988988

989989
void MachineCopyPropagation::propagateDefs(MachineInstr &MI) {

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,9 @@ void RISCVInstrInfo::copyPhysReg(MachineBasicBlock &MBB,
424424
const TargetRegisterInfo *TRI = STI.getRegisterInfo();
425425

426426
if (RISCV::GPRRegClass.contains(DstReg, SrcReg)) {
427-
auto MI = BuildMI(MBB, MBBI, DL, get(RISCV::ADDI), DstReg)
428-
.addReg(SrcReg, getKillRegState(KillSrc))
429-
.addImm(0);
430-
MI->getOperand(0).setIsRenamable(MBBI->getOperand(0).isRenamable());
431-
MI->getOperand(1).setIsRenamable(MBBI->getOperand(1).isRenamable());
427+
BuildMI(MBB, MBBI, DL, get(RISCV::ADDI), DstReg)
428+
.addReg(SrcReg, getKillRegState(KillSrc))
429+
.addImm(0);
432430
return;
433431
}
434432

0 commit comments

Comments
 (0)