Skip to content

Commit 95a9b1d

Browse files
committed
[llvm-exegesis] [AArch64] Resolve Merge Conflict coming from llvm#142382
1 parent c3c61ea commit 95a9b1d

File tree

3 files changed

+5
-81
lines changed

3 files changed

+5
-81
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;

llvm/tools/llvm-exegesis/lib/SerialSnippetGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ static void appendCodeTemplates(const LLVMState &State,
136136
// TODO: Get a valid scratch memory register,
137137

138138
// Do we need to set scratch memory register based on reg class ?
139-
// Or is this code flow even required i.e. would setting register requiring
140-
// memory address from stack correct approach ?
139+
// Or is this code flow even required i.e. would setting register
140+
// requiring memory address from stack correct approach ?
141141
if (!RegClass.contains(ScratchMemoryRegister))
142142
return;
143143

llvm/tools/llvm-exegesis/lib/Target.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ class ExegesisTarget {
268268

269269
// Creates a snippet generator for the given mode.
270270
std::unique_ptr<SnippetGenerator>
271-
createSnippetGenerator(Benchmark::ModeE Mode,
272-
const LLVMState &State,
271+
createSnippetGenerator(Benchmark::ModeE Mode, const LLVMState &State,
273272
const SnippetGenerator::Options &Opts) const;
274273
// Creates a benchmark runner for the given mode.
275274
Expected<std::unique_ptr<BenchmarkRunner>> createBenchmarkRunner(
@@ -308,7 +307,8 @@ class ExegesisTarget {
308307
return std::make_unique<SavedState>();
309308
}
310309

311-
virtual std::vector<MCInst> _generateRegisterStackPop(MCRegister Reg, int imm = 0) const {
310+
virtual std::vector<MCInst> _generateRegisterStackPop(MCRegister Reg,
311+
int imm = 0) const {
312312
return {};
313313
}
314314

0 commit comments

Comments
 (0)