Skip to content

Commit 817d497

Browse files
committed
fixup! Use addReg(RISCV::X0)
1 parent cfb5abc commit 817d497

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Target/RISCV/RISCVInstrInfo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,11 +1412,10 @@ bool RISCVInstrInfo::optimizeCondBranch(MachineInstr &MI) const {
14121412
int64_t C0, C1;
14131413
if (isFromLoadImm(MRI, LHS, C0) && isFromLoadImm(MRI, RHS, C1)) {
14141414
unsigned NewOpc = evaluateCondBranch(CC, C0, C1) ? RISCV::BEQ : RISCV::BNE;
1415-
MachineOperand Zero = MachineOperand::CreateReg(RISCV::X0, /*isDef=*/false);
14161415
// Build the new branch and remove the old one.
14171416
BuildMI(*MBB, MI, MI.getDebugLoc(), get(NewOpc))
1418-
.add(Zero)
1419-
.add(Zero)
1417+
.addReg(RISCV::X0)
1418+
.addReg(RISCV::X0)
14201419
.addMBB(TBB);
14211420
MI.eraseFromParent();
14221421
return true;

0 commit comments

Comments
 (0)