[PATCH] D88701: [AArch64] Prefer prologues with sp adjustments merged into stp/ldp for WinCFI

Martin Storsjö via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 1 23:32:06 PDT 2020


mstorsjo added a comment.

In D88701#2307353 <https://reviews.llvm.org/D88701#2307353>, @efriedma wrote:

> How badly do we really want to match the canonical packed prologue?

Well, the space savings are quite notable, and without this in place, we seldom end up matching the canonical forms allowing use of packed, so I'd hold off pushing D88677 <https://reviews.llvm.org/D88677> until this one is settled (because there's little point in bending over backwards with the register order if we don't hit the packed forms regularly).

> Is it really worth generating less efficient instructions to reduce the size of the unwind data?  (I guess it's not a lot less efficient, but still.)

I guess it's marginally less efficient, but in most cases, the produced number of instructions should at least be the same. (In some of the testcase updates, it may look like we're getting more instructions, but that's in cases with sparse CHECK lines without thoroughly checking all with CHECK-NEXT.)

AFAIK in most cases, this patch should amount to changing this:

  sub sp, sp, #48
  stp x19, x20, [sp, #16]
  stp x21, x30, [sp, #32]

Into this:

  stp x19, x20, [sp, #-32]!
  stp x21, x30, [sp, #16]
  sub sp, sp, #16

So the same number of instructions, but sp is updated twice instead of once - that's the only inefficiency I can think of.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88701



More information about the llvm-commits mailing list