[PATCH] D114548: [AArch64] Async unwind - Fix MTE codegen emitting frame adjustments in a loop

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 24 10:39:42 PST 2021


chill created this revision.
chill added reviewers: t.p.northover, efriedma, MaskRay, eugenis.
Herald added subscribers: hiraditya, kristof.beyls.
chill requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

When untagging the stack, the compiler may emit a sequence like:

  .LBB0_1:
    st2g sp, [sp], #32
    sub x8, x8, #32
    cbnz x8, .LBB0_1
    stg sp, [sp], #16

These stack adjustments cannot be described by CFI instructions.

This patch disables merging of SP update with untagging, i.e. makes the
compiler use an additional scratch register (there should be plenty
available at this point as we are in the epilogue) and generate:

          mov     x9, sp
          mov     x8, #256
          stg     x9, [x9], #16
  .LBB0_1:
          sub     x8, x8, #32
          st2g    x9, [x9], #32
          cbnz    x8, .LBB0_1
          add     sp, sp, #272

Merging is disabled only when we need to generate asynchronous unwind
tables.


https://reviews.llvm.org/D114548

Files:
  llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
  llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
  llvm/test/CodeGen/AArch64/settag.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D114548.389548.patch
Type: text/x-patch
Size: 6759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211124/2df85ee5/attachment.bin>


More information about the llvm-commits mailing list