Skip to content

Commit a54ad59

Browse files
authored
Revert "[llvm-exegesis][AArch64] Disable pauth and ldgm as unsupporte… (#134971)
…d instructions (#132346)" This reverts commit 559540d as it has cause build failures in llvm-clang-x86_64-gcc-ubuntu
1 parent 523e249 commit a54ad59

File tree

2 files changed

+0
-83
lines changed

2 files changed

+0
-83
lines changed

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

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

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

Lines changed: 0 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -9,58 +9,12 @@
99
#include "AArch64.h"
1010
#include "AArch64RegisterInfo.h"
1111

12-
#ifdef __linux__
13-
#include <linux/prctl.h> // For PR_PAC_* constants
14-
#include <sys/prctl.h>
15-
#endif
16-
1712
#define GET_AVAILABLE_OPCODE_CHECKER
1813
#include "AArch64GenInstrInfo.inc"
1914

2015
namespace llvm {
2116
namespace exegesis {
2217

23-
bool isPointerAuth(unsigned Opcode) {
24-
switch (Opcode) {
25-
default:
26-
return false;
27-
28-
// FIXME: Pointer Authentication instructions.
29-
// We would like to measure these instructions, but they can behave
30-
// differently on different platforms, and maybe the snippets need to look
31-
// different for these instructions,
32-
// Platform-specific handling: On Linux, we disable authentication, may
33-
// interfere with measurements. On non-Linux platforms, disable opcodes for
34-
// now.
35-
case AArch64::AUTDA:
36-
case AArch64::AUTDB:
37-
case AArch64::AUTDZA:
38-
case AArch64::AUTDZB:
39-
case AArch64::AUTIA:
40-
case AArch64::AUTIA1716:
41-
case AArch64::AUTIASP:
42-
case AArch64::AUTIAZ:
43-
case AArch64::AUTIB:
44-
case AArch64::AUTIB1716:
45-
case AArch64::AUTIBSP:
46-
case AArch64::AUTIBZ:
47-
case AArch64::AUTIZA:
48-
case AArch64::AUTIZB:
49-
return true;
50-
}
51-
}
52-
53-
bool isLoadTagMultiple(unsigned Opcode) {
54-
switch (Opcode) {
55-
default:
56-
return false;
57-
58-
// Load tag multiple instruction
59-
case AArch64::LDGM:
60-
return true;
61-
}
62-
}
63-
6418
static unsigned getLoadImmediateOpcode(unsigned RegBitWidth) {
6519
switch (RegBitWidth) {
6620
case 32:
@@ -180,35 +134,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
180134
// Function return is a pseudo-instruction that needs to be expanded
181135
PM.add(createAArch64ExpandPseudoPass());
182136
}
183-
184-
const char *getIgnoredOpcodeReasonOrNull(const LLVMState &State,
185-
unsigned Opcode) const override {
186-
if (const char *Reason =
187-
ExegesisTarget::getIgnoredOpcodeReasonOrNull(State, Opcode))
188-
return Reason;
189-
190-
if (isPointerAuth(Opcode)) {
191-
#ifdef __linux__
192-
// Disable all PAC keys. Note that while we expect the measurements to
193-
// be the same with PAC keys disabled, they could potentially be lower
194-
// since authentication checks are bypassed.
195-
if (prctl(PR_PAC_SET_ENABLED_KEYS,
196-
PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY |
197-
PR_PAC_APDBKEY, // all keys
198-
0, // disable all
199-
0, 0) < 0) {
200-
return "Failed to disable PAC keys";
201-
}
202-
#else
203-
return "Unsupported opcode: isPointerAuth";
204-
#endif
205-
}
206-
207-
if (isLoadTagMultiple(Opcode))
208-
return "Unsupported opcode: load tag multiple";
209-
210-
return nullptr;
211-
}
212137
};
213138

214139
} // namespace

0 commit comments

Comments
 (0)