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

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 12:34:52 PDT 2024


================
@@ -13,36 +14,29 @@ declare dso_local void @f1() local_unnamed_addr
 declare dso_local void @f2() local_unnamed_addr
 define  dso_local void @f0() local_unnamed_addr {
 ; RV32IZCMP-LABEL: f0:
-; RV32IZCMP: 	.cfi_startproc
-; RV32IZCMP-NEXT: # %bb.0:                                # %entry
-; RV32IZCMP-NEXT: 	bnez	zero, .LBB0_2
-; RV32IZCMP-NEXT: # %bb.1:                                # %if.T
-; RV32IZCMP-NEXT: 	cm.push	{ra}, -16
-; RV32IZCMP-NEXT: 	.cfi_def_cfa_offset 16
-; RV32IZCMP-NEXT: 	.cfi_offset ra, -4
-; RV32IZCMP-NEXT: 	call	f1
-; RV32IZCMP-NEXT: 	cm.pop	{ra}, 16
-; RV32IZCMP-NEXT: 	.cfi_def_cfa_offset 0
-; RV32IZCMP-NEXT: 	.cfi_restore ra
-; RV32IZCMP-NEXT: .LBB0_2:                                # %if.F
-; RV32IZCMP-NEXT: 	tail	f2
-; RV32IZCMP-NEXT: .Lfunc_end0:
-
+; RV32IZCMP:       # %bb.0: # %entry
+; RV32IZCMP-NEXT:    bnez zero, .LBB0_2
+; RV32IZCMP-NEXT:  # %bb.1: # %if.T
+; RV32IZCMP-NEXT:    cm.push {ra}, -16
+; RV32IZCMP-NEXT:    .cfi_def_cfa_offset 16
+; RV32IZCMP-NEXT:    .cfi_offset ra, -4
+; RV32IZCMP-NEXT:    call f1
+; RV32IZCMP-NEXT:    cm.pop {ra}, 16
----------------
lenary wrote:

Are you missing `.cfi_restore ra; .cfi_def_cfa_offset 0` after this instruction, and before the `tail`?

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


More information about the llvm-commits mailing list