[llvm] [RISCV] Handled the uimm9 offset while FrameIndex folding. (PR #149303)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 21 22:52:20 PDT 2025


================
@@ -585,6 +587,10 @@ bool RISCVRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
                (Lo12 & 0b11111) != 0) {
       // Prefetch instructions require the offset to be 32 byte aligned.
       MI.getOperand(FIOperandNum + 1).ChangeToImmediate(0);
+    } else if (Opc == RISCV::MIPS_PREFETCH && Subtarget.hasVendorXMIPSCBOP() &&
----------------
topperc wrote:

You don't need to check `Subtarget.hasVendorXMIPSCBOP()`. If you see the opcode you can assume it must be enabled.

https://github.com/llvm/llvm-project/pull/149303


More information about the llvm-commits mailing list