[PATCH] D79978: Call Frame Information (CFI) Handling for Basic Block Sections

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 9 07:58:10 PDT 2020


wmi added a comment.

In D79978#2140849 <https://reviews.llvm.org/D79978#2140849>, @MaskRay wrote:

> I haven't looked into the details, but the test suggests that the patch is wrong:
>
>   # basic-block-sections-cfi-1.ll
>           .section        .text,"ax", at progbits,unique,2
>   _Z2f3b.2:                               # %if.end
>           .cfi_startproc
>           .cfi_def_cfa %rbp, 16    # this should be inserted after addq $16, %rsp
>           .cfi_offset %rbp, -16    # this should be after .cfi_def_cfa %rbp, 16
>           addq    $16, %rsp
>           popq    %rbp
>           .cfi_def_cfa %rsp, 8
>           retq
>


I think the position where the cfi directives are currently inserted is correct. Those directives at the beginning of BB are not to maintain call frame information for instructions inside of BB like "addq    $16, %rsp" and "popq %rbp", but to setup the call frame information correctly at the beginning of BB because the BB could be moved around.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79978/new/

https://reviews.llvm.org/D79978





More information about the llvm-commits mailing list