[RISCV] Fix operand number in debug message in RISCVMergeBaseOffset.

This used to print from the ADDI where the operand number was
correct. It recently changed to print from the LUI or AUIPC which
needs to use operand 1 instead of 2.

This shows up as a crash with -debug.
This commit is contained in:
Craig Topper 2022-08-02 15:26:25 -07:00
parent 2b7203a359
commit a5605f1f68
1 changed files with 1 additions and 1 deletions

View File

@ -426,7 +426,7 @@ bool RISCVMergeBaseOffsetOpt::runOnMachineFunction(MachineFunction &Fn) {
if (!detectFoldable(Hi, Lo))
continue;
LLVM_DEBUG(dbgs() << " Found lowered global address: "
<< *Hi.getOperand(2).getGlobal() << "\n");
<< *Hi.getOperand(1).getGlobal() << "\n");
MadeChange |= detectAndFoldOffset(Hi, *Lo);
MadeChange |= foldIntoMemoryOps(Hi, *Lo);
}