Skip to content

Commit dd5204d

Browse files
authored
Revert "[llvm-exegesis][AArch64] Disable pauth and ldgm as unsupported instructions fixed (#136868)" (#142382)
This reverts commit 475531b. But it does not revert the changes from commits 36850a0 and 5dc3cd0.
1 parent 3d2650b commit dd5204d

File tree

2 files changed

+0
-90
lines changed

2 files changed

+0
-90
lines changed

llvm/test/tools/llvm-exegesis/AArch64/skip_unsupported_instructions.s

Lines changed: 0 additions & 14 deletions
This file was deleted.

llvm/tools/llvm-exegesis/lib/AArch64/Target.cpp

Lines changed: 0 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
#if defined(__aarch64__) && defined(__linux__)
1313
#include <linux/prctl.h> // For PR_PAC_* constants
1414
#include <sys/prctl.h>
15-
#ifndef PR_PAC_SET_ENABLED_KEYS
16-
#define PR_PAC_SET_ENABLED_KEYS 60
17-
#endif
18-
#ifndef PR_PAC_GET_ENABLED_KEYS
19-
#define PR_PAC_GET_ENABLED_KEYS 61
20-
#endif
2115
#ifndef PR_PAC_APIAKEY
2216
#define PR_PAC_APIAKEY (1UL << 0)
2317
#endif
@@ -38,47 +32,6 @@
3832
namespace llvm {
3933
namespace exegesis {
4034

41-
bool isPointerAuth(unsigned Opcode) {
42-
switch (Opcode) {
43-
default:
44-
return false;
45-
46-
// FIXME: Pointer Authentication instructions.
47-
// We would like to measure these instructions, but they can behave
48-
// differently on different platforms, and maybe the snippets need to look
49-
// different for these instructions,
50-
// Platform-specific handling: On Linux, we disable authentication, may
51-
// interfere with measurements. On non-Linux platforms, disable opcodes for
52-
// now.
53-
case AArch64::AUTDA:
54-
case AArch64::AUTDB:
55-
case AArch64::AUTDZA:
56-
case AArch64::AUTDZB:
57-
case AArch64::AUTIA:
58-
case AArch64::AUTIA1716:
59-
case AArch64::AUTIASP:
60-
case AArch64::AUTIAZ:
61-
case AArch64::AUTIB:
62-
case AArch64::AUTIB1716:
63-
case AArch64::AUTIBSP:
64-
case AArch64::AUTIBZ:
65-
case AArch64::AUTIZA:
66-
case AArch64::AUTIZB:
67-
return true;
68-
}
69-
}
70-
71-
bool isLoadTagMultiple(unsigned Opcode) {
72-
switch (Opcode) {
73-
default:
74-
return false;
75-
76-
// Load tag multiple instruction
77-
case AArch64::LDGM:
78-
return true;
79-
}
80-
}
81-
8235
static unsigned getLoadImmediateOpcode(unsigned RegBitWidth) {
8336
switch (RegBitWidth) {
8437
case 32:
@@ -198,35 +151,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
198151
// Function return is a pseudo-instruction that needs to be expanded
199152
PM.add(createAArch64ExpandPseudoPass());
200153
}
201-
202-
const char *getIgnoredOpcodeReasonOrNull(const LLVMState &State,
203-
unsigned Opcode) const override {
204-
if (const char *Reason =
205-
ExegesisTarget::getIgnoredOpcodeReasonOrNull(State, Opcode))
206-
return Reason;
207-
208-
if (isPointerAuth(Opcode)) {
209-
#if defined(__aarch64__) && defined(__linux__)
210-
// Disable all PAC keys. Note that while we expect the measurements to
211-
// be the same with PAC keys disabled, they could potentially be lower
212-
// since authentication checks are bypassed.
213-
if (prctl(PR_PAC_SET_ENABLED_KEYS,
214-
PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY |
215-
PR_PAC_APDBKEY, // all keys
216-
0, // disable all
217-
0, 0) < 0) {
218-
return "Failed to disable PAC keys";
219-
}
220-
#else
221-
return "Unsupported opcode: isPointerAuth";
222-
#endif
223-
}
224-
225-
if (isLoadTagMultiple(Opcode))
226-
return "Unsupported opcode: load tag multiple";
227-
228-
return nullptr;
229-
}
230154
};
231155

232156
} // namespace

0 commit comments

Comments
 (0)