[llvm] [AArch64][PAC] Don't skip global legalization for AUTH_TCRETURN (PR #182513)

Anatoly Trosinenko via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 3 04:46:37 PST 2026


================
@@ -0,0 +1,16 @@
+; RUN: llc --mattr=+pauth -filetype=asm < %s | FileCheck %s
+
+; CHECK:         adrp    x0, global
+; CHECK-NEXT:    add x0, x0, :lo12:global
+; CHECK-NEXT:    braaz   x0
+
+target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
+target triple = "aarch64-unknown-linux-pauthtest"
+
+ at global = dso_local local_unnamed_addr global ptr null
+
+define dso_local void @foo() local_unnamed_addr {
+entry:
+  tail call void @global() [ "ptrauth"(i32 0, i64 0) ]
+  ret void
+}
----------------
atrosinenko wrote:

I confirm such LLVM IR can be directly produced by the frontend (which looks surprising to me). Could you mention this in the file to make it explicit that this IR is not a result of some (mis-)optimization? (this way, it may be worth restoring the original `[256 x i8]` type which is more natural than executing the value stored in `ptr` as 8 bytes of instructions)

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


More information about the llvm-commits mailing list