[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 04:49:22 PST 2025


================
@@ -266,6 +266,35 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
            Inst.getOpcode() == AArch64::RETABSPPCr;
   }
 
+  void createMatchingAuth(const MCInst &AuthAndRet, MCInst &Auth) override {
+    assert(isPAuthAndRet(AuthAndRet) &&
+           "Not a fused pauth-and-return instruction");
+
+    Auth.clear();
+    switch (AuthAndRet.getOpcode()) {
+    case AArch64::RETAA:
+      Auth.setOpcode(AArch64::AUTIASP);
+      break;
+    case AArch64::RETAB:
+      Auth.setOpcode(AArch64::AUTIBSP);
+      break;
+    case AArch64::RETAASPPCi:
+      Auth.setOpcode(AArch64::AUTIASPPCi);
+      break;
+    case AArch64::RETABSPPCi:
+      Auth.setOpcode(AArch64::AUTIBSPPCi);
+      break;
+    case AArch64::RETAASPPCr:
+      Auth.setOpcode(AArch64::AUTIASPPCr);
+      break;
+    case AArch64::RETABSPPCr:
+      Auth.setOpcode(AArch64::AUTIBSPPCr);
+      break;
----------------
bgergely0 wrote:

These variants are the Armv9.5-A versions of pointer authentication instructions, and it looks like we cannot emit relocs for them. I got this when trying to add them to unittests:
```
error: relocation of PAC/AUT instructions is not supported
```
As these are not yet deployed in HW, I think they should move to the unsupported category here, and limit the scope to the already deployed Armv8.3-A variants.

WDYT?

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


More information about the llvm-commits mailing list