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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 21 00:49:39 PDT 2023


MaskRay 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
----------------
smeenai wrote:
> ikudrin wrote:
> > 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.
> Those bytes do add up ... I measured this change to be a 72 KiB size reduction for the Facebook for Android app, which is quite nice.
I wonder whether we just need a mode to omit most of the registers? Many registers are probably not useful for some use cases, e.g. profiling.


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