[llvm-branch-commits] [llvm] [AArch64][PAC] Emit tail calls more efficiently (PR #220193)
Victor Campos via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Sep 3 09:00:33 PDT 2026
================
@@ -3519,6 +3493,21 @@ void AArch64AsmPrinter::emitInstruction(const MachineInstr *MI) {
emitPtrauthBranch(MI);
return;
+ case AArch64::PAUTH_CHECK_LR: {
+ assert(MI->getNumImplicitOperands() == 1 && "Scratch register expected");
+ Register ScratchReg = MI->implicit_operands().begin()->getReg();
+
+ auto LRCheckMethod = STI->getAuthenticatedLRCheckMethod(*MF);
+ if (LRCheckMethod == AArch64PAuth::AuthCheckMethod::None)
+ return;
+
+ AArch64PACKey::ID Key =
+ AArch64FI->shouldSignWithBKey() ? AArch64PACKey::IB : AArch64PACKey::IA;
+ emitPtrauthCheckAuthenticatedValue(AArch64::LR, ScratchReg, Key,
----------------
vhscampos wrote:
Why are the check instructions emitted by the assembly printer rather than as regular MachineInstructions? I don't understand why we do it like this for the checks, but as the latter for everything else in the Pointer Auth feature set.
IIUC this pseudo instruction is never expanded to MachineInstructions?
https://github.com/llvm/llvm-project/pull/220193
More information about the llvm-branch-commits
mailing list