[llvm] [RISCV] Prefer SP over FP for frame index access when offset fits within compressed immediate range. (PR #193962)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Tue May 5 09:20:18 PDT 2026
================
@@ -153,7 +153,7 @@ define void @frame_pointer() "frame-pointer"="all" {
; RV64I-NEXT: addi s0, sp, 2032
; RV64I-NEXT: .cfi_def_cfa s0, 0
; RV64I-NEXT: addi sp, sp, -496
-; RV64I-NEXT: addi a0, s0, -1972
+; RV64I-NEXT: addi a0, sp, 556
----------------
topperc wrote:
I believe this is because we need to teach RISCVRegisterInfo::needsFrameBaseReg about this patch. I think we can do that as a follow up.
https://github.com/llvm/llvm-project/pull/193962
More information about the llvm-commits
mailing list