[llvm] [RISCV][CFI] add function epilogue cfi information (PR #110810)
Sam Elliott via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 15 07:53:55 PDT 2024
================
@@ -1724,9 +1738,13 @@ define i32 @va_large_stack(ptr %fmt, ...) {
; RV64-WITHFP-NEXT: lui a1, 24414
; RV64-WITHFP-NEXT: addiw a1, a1, -1680
; RV64-WITHFP-NEXT: add sp, sp, a1
+; RV64-WITHFP-NEXT: .cfi_def_cfa_offset 2032
----------------
lenary wrote:
This looks really fishy to me, because it doesn't look like an undo of what was done in the prolog. Why are we doing this at the start of an epilog, shouldn't we be doing something like `.cfi_def_cfa sp, 2032` so the CFA is no longer calculated using `s0`?
Note, the docs for this directive says "this modifies the offset, but not the register", so the register remains `s0`, and doesn't become `sp` with this directive, unless I've misunderstood something.
https://github.com/llvm/llvm-project/pull/110810
More information about the llvm-commits
mailing list