[PATCH] D153098: [AArch64] Emit fewer CFI instructions for synchronous unwind tables

Igor Kudrin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 18:10:18 PDT 2023


ikudrin added inline comments.


================
Comment at: llvm/test/CodeGen/AArch64/addsub-constant-folding.ll:363
 ; CHECK-NEXT:    sub sp, sp, #32
-; CHECK-NEXT:    .cfi_def_cfa_offset 32
 ; CHECK-NEXT:    str x30, [sp, #16] // 8-byte Folded Spill
+; CHECK-NEXT:    .cfi_def_cfa_offset 32
----------------
MaskRay wrote:
> ikudrin wrote:
> > MaskRay wrote:
> > > `.cfi_def_cfa_offset 32` move like this seems unnecessary. It degrades precision without reducing the number of CFI instructions for sync.
> > The goal is to reduce the size of the unwind table, not just the number of CFI instructions. Having only one chunk removes `DWA_CFA_advance_loc` instructions that would otherwise be required.
> Yes, the goal is fine. However, when the number of instructions does not change, it would be better not to degrade the precision by moving `.cfi_def_cfa_offset`...
In this test, there is a `.cfi_offset w30, -16` instruction below. If we kept `.cfi_def_cfa_offset 32` there it was, the size of the unwind table would be bigger. Yes, only by two bytes, but still.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153098



More information about the llvm-commits mailing list