[llvm] [llvm-exegesis][AArch64] Check for PAC keys before disabling them (PR #138643)

Anatoly Trosinenko via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 09:48:04 PDT 2025


================
@@ -32,6 +39,53 @@
 namespace llvm {
 namespace exegesis {
 
+static cl::opt<bool> AArch64DisablePacControl(
+    "aarch64-disable-pac-control",
+    cl::desc("Disable PAC key control at runtime for benchmarking. Use this if "
+             "llvm-exegesis crashes or instruction timings are affected."),
+    cl::init(false));
+
+bool isPointerAuth(unsigned Opcode) {
+  switch (Opcode) {
+  default:
+    return false;
+
+  // FIXME: Pointer Authentication instructions.
+  // We would like to measure these instructions, but they can behave
+  // differently on different platforms, and maybe the snippets need to look
+  // different for these instructions,
+  // Platform-specific handling:  On Linux, we disable authentication, may
+  // interfere with measurements. On non-Linux platforms, disable opcodes for
+  // now.
+  case AArch64::AUTDA:
+  case AArch64::AUTDB:
+  case AArch64::AUTDZA:
+  case AArch64::AUTDZB:
+  case AArch64::AUTIA:
+  case AArch64::AUTIA1716:
+  case AArch64::AUTIASP:
+  case AArch64::AUTIAZ:
+  case AArch64::AUTIB:
+  case AArch64::AUTIB1716:
+  case AArch64::AUTIBSP:
+  case AArch64::AUTIBZ:
+  case AArch64::AUTIZA:
+  case AArch64::AUTIZB:
+    return true;
----------------
atrosinenko wrote:

Some other `AUT*` instructions were recently defined. See [this function](https://github.com/llvm/llvm-project/blob/a87c4eef1d8ee69f46986985ec5cf35215992e5a/bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp#L200) in BOLT for example (it was recently added and hopefully contains the up-to-date list). Currently, there is probably nothing to do with this, except for updating such lists when they get out of sync with `*.td` files...

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


More information about the llvm-commits mailing list