[all-commits] [llvm/llvm-project] 3780a4: [AArch64] Match the windows canonical callee saved...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Sat Oct 3 11:38:17 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3780a4e568ac763567cc6987372e04f9e3c68ff9
      https://github.com/llvm/llvm-project/commit/3780a4e568ac763567cc6987372e04f9e3c68ff9
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-10-03 (Sat, 03 Oct 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
    M llvm/lib/Target/AArch64/AArch64FrameLowering.h
    M llvm/test/CodeGen/AArch64/seh-finally.ll
    M llvm/test/CodeGen/AArch64/sponentry.ll
    M llvm/test/CodeGen/AArch64/win64_vararg.ll
    A llvm/test/CodeGen/AArch64/wineh-frame-scavenge.mir
    M llvm/test/CodeGen/AArch64/wineh-frame0.mir
    M llvm/test/CodeGen/AArch64/wineh-frame1.mir
    M llvm/test/CodeGen/AArch64/wineh-frame2.mir
    M llvm/test/CodeGen/AArch64/wineh-frame3.mir
    M llvm/test/CodeGen/AArch64/wineh-frame4.mir
    M llvm/test/CodeGen/AArch64/wineh-frame5.mir
    M llvm/test/CodeGen/AArch64/wineh-try-catch-realign.ll
    M llvm/test/CodeGen/AArch64/wineh-try-catch.ll
    M llvm/test/CodeGen/AArch64/wineh_shrinkwrap.mir

  Log Message:
  -----------
  [AArch64] Match the windows canonical callee saved register order

On windows, the callee saved registers in a canonical prologue are
ordered starting from a lower register number at a lower stack
address (with the possible gap for aligning the stack at the top);
this is the opposite order that llvm normally produces.

To achieve this, reverse the order of the registers in the
assignCalleeSavedSpillSlots callback, to get the stack objects
laid out by PrologEpilogInserter in the right order, and adjust
computeCalleeSaveRegisterPairs to lay them out from the bottom up.

This allows generated prologs more often to match the format that
allows the unwind info to be written as packed info.

Differential Revision: https://reviews.llvm.org/D88677


  Commit: 890af2f003c83349ff5917d80023b8b796f76489
      https://github.com/llvm/llvm-project/commit/890af2f003c83349ff5917d80023b8b796f76489
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-10-03 (Sat, 03 Oct 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64AsmPrinter.cpp
    M llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
    M llvm/test/CodeGen/AArch64/win64_vararg.ll
    A llvm/test/CodeGen/AArch64/wineh-save-lrpair1.mir
    A llvm/test/CodeGen/AArch64/wineh-save-lrpair2.mir
    A llvm/test/CodeGen/AArch64/wineh-save-lrpair3.mir

  Log Message:
  -----------
  [AArch64] Allow pairing lr with other GPRs for WinCFI

This saves one instruction per prologue/epilogue for any function with
an odd number of callee-saved GPRs, but more importantly, allows such
functions to match the packed unwind format.

Differential Revision: https://reviews.llvm.org/D88699


  Commit: 7d07405761aec8434a0cdb1c5644823a394f7def
      https://github.com/llvm/llvm-project/commit/7d07405761aec8434a0cdb1c5644823a394f7def
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-10-03 (Sat, 03 Oct 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
    A llvm/test/CodeGen/AArch64/wineh-frame-predecrement.mir

  Log Message:
  -----------
  [AArch64] Prefer prologues with sp adjustments merged into stp/ldp for WinCFI, if optimizing for size

This makes the prologue match the windows canonical layout, for
cases without a frame pointer.

This can potentially be a slower (a longer dependency chain of the
sp register, and potentially one arithmetic operation more on some
cores), but gives notable size improvements.

The previous two commits shrinks a 166 KB xdata section by 49 KB,
and if the change from this commit is enabled, it shrinks the xdata
section by another 25 KB.

In total, since the start of the recent arm64 unwind info cleanups
and optimizations (since before commit 37ef743cbf3), the xdata+pdata
sections of the same test DLL has shrunk from 407 KB in total
originally, to 163 KB now.

Differential Revision: https://reviews.llvm.org/D88701


Compare: https://github.com/llvm/llvm-project/compare/ba60dc0aa75e...7d07405761ae


More information about the All-commits mailing list