Skip to content

Commit 2159828

Browse files
committed
fixup! Use addReg(RISCV::X0)
1 parent 503bdf2 commit 2159828

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
@@ -1464,11 +1464,10 @@ bool RISCVInstrInfo::optimizeCondBranch(MachineInstr &MI) const {
14641464
int64_t C0, C1;
14651465
if (isFromLoadImm(MRI, LHS, C0) && isFromLoadImm(MRI, RHS, C1)) {
14661466
unsigned NewOpc = evaluateCondBranch(CC, C0, C1) ? RISCV::BEQ : RISCV::BNE;
1467-
MachineOperand Zero = MachineOperand::CreateReg(RISCV::X0, /*isDef=*/false);
14681467
// Build the new branch and remove the old one.
14691468
BuildMI(*MBB, MI, MI.getDebugLoc(), get(NewOpc))
1470-
.add(Zero)
1471-
.add(Zero)
1469+
.addReg(RISCV::X0)
1470+
.addReg(RISCV::X0)
14721471
.addMBB(TBB);
14731472
MI.eraseFromParent();
14741473
return true;

0 commit comments

Comments
 (0)