================
@@ -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
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to