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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 10 13:08:27 PDT 2020


MaskRay added a comment.

In D79978#2141992 <https://reviews.llvm.org/D79978#2141992>, @wmi wrote:

> In D79978#2141959 <https://reviews.llvm.org/D79978#2141959>, @MaskRay wrote:
>
> > Ack. Then what instructions should be placed at the top of these basic blocks? Should `.cfi_def_cfa_register %rbp` be placed as well? If you move these basic blocks around, `.cfi_def_cfa_register %rbp` is currently not tracked.
>
>
> That is because .cfi_def_cfa %rbp, 16 is identical to the following:
>  .cfi_def_cfa_register %rbp
>  .cfi_def_cfa_offset 16


Honestly I am not a CFI expert but I have read enough bits of LLVM libunwind and am not completely CFI illiterate (I have fixed a very subtle negative cfiDefCfa bug). The description of the patch is still puzzling me.
I think it lacks a summary about what the patch intends to do.

Is the intention: if the entry block stays in the front of the function, while other basic blocks can be randomly shuffled => the CFI states of all basic blocks are the same no matter how non-entry basic blocks are shuffled?

Or

The entry basic block can be shuffled as well?

For either behavior, I am not sure the test covers the situations: I can only find `.cfi_def_cfa_register` in the entry block, not in others - so I am not confident that `.cfi_def_cfa_register` information is correctly retained. We need a stronger test.


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

https://reviews.llvm.org/D79978





More information about the llvm-commits mailing list