[all-commits] [llvm/llvm-project] cf97e0: [AArch64] Treat x18 as callee-saved in functions w...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Fri May 29 23:23:08 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: cf97e0ec42b800ade5a18401a35ada96f355693f
      https://github.com/llvm/llvm-project/commit/cf97e0ec42b800ade5a18401a35ada96f355693f
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-05-30 (Sat, 30 May 2020)

  Changed paths:
    M llvm/lib/Target/AArch64/AArch64CallingConvention.td
    M llvm/lib/Target/AArch64/AArch64FrameLowering.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp
    M llvm/test/CodeGen/AArch64/aarch64_win64cc_vararg.ll
    A llvm/test/CodeGen/AArch64/win64cc-backup-x18.ll

  Log Message:
  -----------
  [AArch64] Treat x18 as callee-saved in functions with windows calling convention on non-windows OSes

Treat it as callee-saved, and always back it up. When windows code calls
entry points in unix code, marked with the windows calling convention,
that unix code can call other functions that isn't compiled with
-ffixed-x18 which may clobber x18 freely. By backing it up and restoring
it on return, we preserve the register across the function call,
fulfilling this part of the windows calling convention on another OS.

This isn't enough for making sure that x18 is preseved when non-windows
code does a callback to windows code, but is a clear improvement over
the current status quo. Additionally, wine is nowadays building many
modules as PE DLLs, which avoids the callback issue altogether for those
DLLs.

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


  Commit: 51089db6d7554cefc6c57e6f10a7f876e2dd629e
      https://github.com/llvm/llvm-project/commit/51089db6d7554cefc6c57e6f10a7f876e2dd629e
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-05-30 (Sat, 30 May 2020)

  Changed paths:
    M llvm/test/CodeGen/AArch64/aarch64_win64cc_vararg.ll

  Log Message:
  -----------
  [test] Regenerate checks in aarch64_win64cc_vararg.ll with update_llc_test_checks.py. NFC.


Compare: https://github.com/llvm/llvm-project/compare/2388a096e786...51089db6d755


More information about the All-commits mailing list