[llvm] [llvm][RISCV] Use zilsd for callee-saved register spill/restore on RV32 (PR #184794)

Kito Cheng via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 5 07:47:28 PST 2026


================
@@ -1255,6 +1259,237 @@ define void @callee() {
 ; RV64IZCMP-WITH-FP-NEXT:    addi sp, sp, 160
 ; RV64IZCMP-WITH-FP-NEXT:    .cfi_def_cfa_offset 0
 ; RV64IZCMP-WITH-FP-NEXT:    ret
+;
+; RV32I-ZILSD-LABEL: callee:
+; RV32I-ZILSD:       # %bb.0:
+; RV32I-ZILSD-NEXT:    addi sp, sp, -80
+; RV32I-ZILSD-NEXT:    .cfi_def_cfa_offset 80
+; RV32I-ZILSD-NEXT:    sw ra, 76(sp) # 4-byte Folded Spill
+; RV32I-ZILSD-NEXT:    sd s0, 64(sp) # 8-byte Folded Spill
----------------
kito-cheng wrote:

oh wait, I should not reply before sleep, yeah fp should take more carefully, so we might need two different logic here: s0 is frame pointer and s0 is not frame pointer 

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


More information about the llvm-commits mailing list