Skip to content

Revert "[llvm-exegesis][AArch64] Disable pauth and ldgm as unsupporte… #134971

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2025

Conversation

madhur13490
Copy link
Contributor

…d instructions (#132346)"

This reverts commit 559540d as it has cause build failures in llvm-clang-x86_64-gcc-ubuntu

…d instructions (llvm#132346)"

This reverts commit 559540d as it
has cause build failures in llvm-clang-x86_64-gcc-ubuntu
@llvmbot
Copy link
Member

llvmbot commented Apr 9, 2025

@llvm/pr-subscribers-tools-llvm-exegesis

Author: Madhur Amilkanthwar (madhur13490)

Changes

…d instructions (#132346)"

This reverts commit 559540d as it has cause build failures in llvm-clang-x86_64-gcc-ubuntu


Full diff: https://github.com/llvm/llvm-project/pull/134971.diff

2 Files Affected:

  • (removed) llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s (-8)
  • (modified) llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp (-75)
diff --git a/llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s b/llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s
deleted file mode 100644
index acefbce2e94c5..0000000000000
--- a/llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s
+++ /dev/null
@@ -1,8 +0,0 @@
-# REQUIRES: aarch64-registered-target
-
-# Check for skipping of illegal instruction errors (AUT and LDGM)
-# RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency --opcode-name=AUTIA --benchmark-phase=assemble-measured-code 2>&1 | FileCheck %s --check-prefix=CHECK-AUTIA
-# CHECK-AUTIA-NOT: snippet crashed while running: Illegal instruction
-
-# RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency --opcode-name=LDGM --benchmark-phase=assemble-measured-code 2>&1 | FileCheck %s --check-prefix=CHECK-LDGM
-# CHECK-LDGM: LDGM: Unsupported opcode: load tag multiple 
diff --git a/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp b/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
index 1aca258603590..bf2b053003ce3 100644
--- a/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
+++ b/llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp
@@ -9,58 +9,12 @@
 #include "AArch64.h"
 #include "AArch64RegisterInfo.h"
 
-#ifdef __linux__
-#include <linux/prctl.h> // For PR_PAC_* constants
-#include <sys/prctl.h>
-#endif
-
 #define GET_AVAILABLE_OPCODE_CHECKER
 #include "AArch64GenInstrInfo.inc"
 
 namespace llvm {
 namespace exegesis {
 
-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;
-  }
-}
-
-bool isLoadTagMultiple(unsigned Opcode) {
-  switch (Opcode) {
-  default:
-    return false;
-
-  // Load tag multiple instruction
-  case AArch64::LDGM:
-    return true;
-  }
-}
-
 static unsigned getLoadImmediateOpcode(unsigned RegBitWidth) {
   switch (RegBitWidth) {
   case 32:
@@ -180,35 +134,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
     // Function return is a pseudo-instruction that needs to be expanded
     PM.add(createAArch64ExpandPseudoPass());
   }
-
-  const char *getIgnoredOpcodeReasonOrNull(const LLVMState &State,
-                                           unsigned Opcode) const override {
-    if (const char *Reason =
-            ExegesisTarget::getIgnoredOpcodeReasonOrNull(State, Opcode))
-      return Reason;
-
-    if (isPointerAuth(Opcode)) {
-#ifdef __linux__
-      // Disable all PAC keys. Note that while we expect the measurements to
-      // be the same with PAC keys disabled, they could potentially be lower
-      // since authentication checks are bypassed.
-      if (prctl(PR_PAC_SET_ENABLED_KEYS,
-                PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY |
-                    PR_PAC_APDBKEY, // all keys
-                0,                  // disable all
-                0, 0) < 0) {
-        return "Failed to disable PAC keys";
-      }
-#else
-      return "Unsupported opcode: isPointerAuth";
-#endif
-    }
-
-    if (isLoadTagMultiple(Opcode))
-      return "Unsupported opcode: load tag multiple";
-
-    return nullptr;
-  }
 };
 
 } // namespace

@madhur13490 madhur13490 merged commit a54ad59 into llvm:main Apr 9, 2025
8 of 13 checks passed
var-const pushed a commit to ldionne/llvm-project that referenced this pull request Apr 17, 2025
llvm#134971)

…d instructions (llvm#132346)"

This reverts commit 559540d as it has
cause build failures in llvm-clang-x86_64-gcc-ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants