[llvm] [RISCV][CFI] add function epilogue cfi information (PR #110810)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 11:33:21 PDT 2024


================
@@ -111,10 +119,20 @@ define riscv_vector_cc <vscale x 1 x i32> @test_vector_callee_cfi(<vscale x 1 x
 ; NO-OMIT-FP-NEXT:    sub a0, s0, a0
 ; NO-OMIT-FP-NEXT:    addi a0, a0, -32
 ; NO-OMIT-FP-NEXT:    vl4r.v v4, (a0) # Unknown-size Folded Reload
+; NO-OMIT-FP-NEXT:    .cfi_restore v1
+; NO-OMIT-FP-NEXT:    .cfi_restore v2
+; NO-OMIT-FP-NEXT:    .cfi_restore v4
 ; NO-OMIT-FP-NEXT:    addi sp, s0, -32
+; NO-OMIT-FP-NEXT:    .cfi_def_cfa sp, 32
 ; NO-OMIT-FP-NEXT:    ld ra, 24(sp) # 8-byte Folded Reload
 ; NO-OMIT-FP-NEXT:    ld s0, 16(sp) # 8-byte Folded Reload
+; NO-OMIT-FP-NEXT:    .cfi_restore ra
+; NO-OMIT-FP-NEXT:    .cfi_restore s0
+; NO-OMIT-FP-NEXT:    .cfi_restore v1
+; NO-OMIT-FP-NEXT:    .cfi_restore v2
+; NO-OMIT-FP-NEXT:    .cfi_restore v4
----------------
lenary wrote:

What's going on here? It looks like `v1, v2, v4` have already been restored when you emit the `.cfi_restore`s here.

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


More information about the llvm-commits mailing list