Skip to content

Commit d928755

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

File tree

1 file changed

+0
-76
lines changed

1 file changed

+0
-76
lines changed

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

Lines changed: 0 additions & 76 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:
@@ -334,35 +287,6 @@ class ExegesisAArch64Target : public ExegesisTarget {
334287
// Function return is a pseudo-instruction that needs to be expanded
335288
PM.add(createAArch64ExpandPseudoPass());
336289
}
337-
338-
const char *getIgnoredOpcodeReasonOrNull(const LLVMState &State,
339-
unsigned Opcode) const override {
340-
if (const char *Reason =
341-
ExegesisTarget::getIgnoredOpcodeReasonOrNull(State, Opcode))
342-
return Reason;
343-
344-
if (isPointerAuth(Opcode)) {
345-
#if defined(__aarch64__) && defined(__linux__)
346-
// Disable all PAC keys. Note that while we expect the measurements to
347-
// be the same with PAC keys disabled, they could potentially be lower
348-
// since authentication checks are bypassed.
349-
if (prctl(PR_PAC_SET_ENABLED_KEYS,
350-
PR_PAC_APIAKEY | PR_PAC_APIBKEY | PR_PAC_APDAKEY |
351-
PR_PAC_APDBKEY, // all keys
352-
0, // disable all
353-
0, 0) < 0) {
354-
return "Failed to disable PAC keys";
355-
}
356-
#else
357-
return "Unsupported opcode: isPointerAuth";
358-
#endif
359-
}
360-
361-
if (isLoadTagMultiple(Opcode))
362-
return "Unsupported opcode: load tag multiple";
363-
364-
return nullptr;
365-
}
366290
MCRegister getScratchMemoryRegister(const Triple &) const override;
367291
void fillMemoryOperands(InstructionTemplate &IT, MCRegister Reg,
368292
unsigned Offset) const override;

0 commit comments

Comments
 (0)