[llvm] [BOLT] Extend Inliner to work on functions with Pointer Autentication (PR #162458)

Gergely Bálint via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 18 02:09:26 PST 2025


================
@@ -338,6 +345,17 @@ Inliner::inlineCall(BinaryBasicBlock &CallerBB,
                                 BC.Ctx.get());
       }
 
+      // Handling fused authentication and return instructions (Armv8.3-A):
+      // if the Return here is RETA(A|B), we have to keep the authentication
+      // part.
+      // RETAA -> AUTIASP + RET
+      // RETAB -> AUTIBSP + RET
+      if (BC.isAArch64() && BC.MIB->isPAuthAndRet(Inst)) {
+        MCInst Auth;
+        BC.MIB->createMatchingAuth(Inst, Auth);
+        InsertII =
+            std::next(InlinedBB->insertInstruction(InsertII, std::move(Auth)));
+      }
----------------
bgergely0 wrote:

Thanks for the catch btw, it does cause problems.

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


More information about the llvm-commits mailing list