Skip to content

Commit 018a9db

Browse files
committed
[llvm-exegesis] [AArch64] Resolve Merge Conflict coming from reverted llvm#136868
1 parent b32026b commit 018a9db

File tree

1 file changed

+0
-77
lines changed

1 file changed

+0
-77
lines changed

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

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@
2828
#endif // HAVE_LIBPFM
2929
#include <linux/prctl.h> // For PR_PAC_* constants
3030
#include <sys/prctl.h>
31-
#ifndef PR_PAC_SET_ENABLED_KEYS
32-
#define PR_PAC_SET_ENABLED_KEYS 60
33-
#endif
34-
#ifndef PR_PAC_GET_ENABLED_KEYS
35-
#define PR_PAC_GET_ENABLED_KEYS 61
36-
#endif
3731
#ifndef PR_PAC_APIAKEY
3832
#define PR_PAC_APIAKEY (1UL << 0)
3933
#endif
@@ -54,47 +48,6 @@
5448
namespace llvm {
5549
namespace exegesis {
5650

57-
bool isPointerAuth(unsigned Opcode) {
58-
switch (Opcode) {
59-
default:
60-
return false;
61-
62-
// FIXME: Pointer Authentication instructions.
63-
// We would like to measure these instructions, but they can behave
64-
// differently on different platforms, and maybe the snippets need to look
65-
// different for these instructions,
66-
// Platform-specific handling: On Linux, we disable authentication, may
67-
// interfere with measurements. On non-Linux platforms, disable opcodes for
68-
// now.
69-
case AArch64::AUTDA:
70-
case AArch64::AUTDB:
71-
case AArch64::AUTDZA:
72-
case AArch64::AUTDZB:
73-
case AArch64::AUTIA:
74-
case AArch64::AUTIA1716:
75-
case AArch64::AUTIASP:
76-
case AArch64::AUTIAZ:
77-
case AArch64::AUTIB:
78-
case AArch64::AUTIB1716:
79-
case AArch64::AUTIBSP:
80-
case AArch64::AUTIBZ:
81-
case AArch64::AUTIZA:
82-
case AArch64::AUTIZB:
83-
return true;
84-
}
85-
}
86-
87-
bool isLoadTagMultiple(unsigned Opcode) {
88-
switch (Opcode) {
89-
default:
90-
return false;
91-
92-
// Load tag multiple instruction
93-
case AArch64::LDGM:
94-
return true;
95-
}
96-
}
97-
9851
static unsigned getLoadImmediateOpcode(unsigned RegBitWidth) {
9952
switch (RegBitWidth) {
10053
case 32:
@@ -330,36 +283,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
330283
PM.add(createAArch64ExpandPseudoPass());
331284
}
332285

333-
const char *getIgnoredOpcodeReasonOrNull(const LLVMState &State,
334-
unsigned Opcode) const override {
335-
if (const char *Reason =
336-
ExegesisTarget::getIgnoredOpcodeReasonOrNull(State, Opcode))
337-
return Reason;
338-
339-
if (isPointerAuth(Opcode)) {
340-
#if defined(__aarch64__) && defined(__linux__)
341-
// Disable all PAC keys. Note that while we expect the measurements to
342-
// be the same with PAC keys disabled, they could potentially be lower
343-
// since authentication checks are bypassed.
344-
if (prctl(PR_PAC_SET_ENABLED_KEYS,
345-
PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY |
346-
PR_PAC_APDBKEY, // all keys
347-
0, // disable all
348-
0, 0) < 0) {
349-
return "Failed to disable PAC keys";
350-
}
351-
#else
352-
return "Unsupported opcode: isPointerAuth";
353-
#endif
354-
}
355-
356-
if (isLoadTagMultiple(Opcode))
357-
return "Unsupported opcode: load tag multiple";
358-
359-
return nullptr;
360-
}
361-
};
362-
363286
} // namespace
364287

365288
#ifdef __linux__

0 commit comments

Comments
 (0)