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

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 15:25:41 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:2447
+    SavedRegs.set(AArch64::X18);
+  }
+
----------------
This change shouldn't be necessary. If some code in the function modifies x18, or calls some non-Win64 function, x18 will be clobbered.  Frame lowering should see that, and figure out it needs to save x18 without any extra help.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:3947
+  // from those functions.
+  if (CallerCC == CallingConv::Win64 && !Subtarget->isTargetWindows())
+    return false;
----------------
Do we want to also check that the callee CC isn't Win64?


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

https://reviews.llvm.org/D61892





More information about the llvm-commits mailing list