[llvm-branch-commits] [llvm] [AArch64][PAC] Prevent PAUTH_EPILOGUE from overwriting live registers (PR #220191)

Victor Campos via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Sep 3 02:15:00 PDT 2026


================
@@ -11771,23 +11771,75 @@ unsigned llvm::getBLRCallOpcode(const MachineFunction &MF) {
 void AArch64InstrInfo::createPauthEpilogueInstr(MachineBasicBlock &MBB,
                                                 DebugLoc DL) const {
   MachineBasicBlock::iterator InsertPt = MBB.getFirstTerminator();
-  auto Builder = BuildMI(MBB, InsertPt, DL, get(AArch64::PAUTH_EPILOGUE))
-                     .setMIFlag(MachineInstr::FrameDestroy);
-
   MachineFunction &MF = *MBB.getParent();
   const auto *AFI = MF.getInfo<AArch64FunctionInfo>();
   auto &AFL = *static_cast<const AArch64FrameLowering *>(
       MF.getSubtarget().getFrameLowering());
+
+  SmallVector<Register, 3> ImplicitDefs;
----------------
vhscampos wrote:

I now wonder if this code really belongs here or if it should live in the `authenticareLR` function in `AArch64PointerAuth.cpp` instead.

Is it really the job of AArch64InstrInfo to clear up the way for PAUTH_EPILOGUE?

Are there any other examples of pseudo instructions created this late in the pipeline that clobber registers?



https://github.com/llvm/llvm-project/pull/220191


More information about the llvm-branch-commits mailing list