[PATCH] D159357: [AArch64] Move PAuth codegen down the machine pipeline

Lucas Prates via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 5 01:56:18 PDT 2023


pratlucas added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64FrameLowering.cpp:1421-1426
+  if (MFnI.shouldSignReturnAddress(MF)) {
+    BuildMI(MBB, MBBI, DL, TII->get(AArch64::PAUTH_PROLOGUE))
+        .setMIFlag(MachineInstr::FrameSetup);
+    if (NeedsWinCFI)
+      HasWinCFI = true; // AArch64PointerAuth pass will insert SEH_PACSignLR
+  }
----------------
Why do we need these to be added as pseudo-instructions during frame lowering? Is there any chance the criteria for making the decision is lost before the new pass is executed?


================
Comment at: llvm/lib/Target/AArch64/AArch64PointerAuth.cpp:33-42
+  MachineFunction *MF;
+
+  const AArch64Subtarget *Subtarget;
+  const AArch64FunctionInfo *MFnI;
+  const AArch64InstrInfo *TII;
+
+  bool UseBKey;
----------------
I feel those member variables could be removed to make the class less stateful.
A single instantiation of this pass will be used over multiple machine functions and most of those members are specific to each of the functions. Removing them would also allow the private methods below to be made freestanding static functions instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159357



More information about the llvm-commits mailing list