-
Notifications
You must be signed in to change notification settings - Fork 15.4k
[llvm-exegesis][AArch64] Disable pauth and ldgm as unsupported instructions #132346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
f1e1d7a
5039c2b
6b81e65
bef8e21
dade502
b6ce448
783f86d
70eb3bf
a1fedb4
06fbe30
3af87a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| # REQUIRES: aarch64-registered-target | ||
|
|
||
| # Check for skipping of illegal instruction errors (AUT and LDGM) | ||
| # RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency --opcode-name=AUTIA --benchmark-phase=assemble-measured-code 2>&1 | ||
| # CHECK: AUTIA: Unsupported opcode: isPointerAuth/isUncheckedAccess | ||
|
|
||
| # RUN: llvm-exegesis -mcpu=neoverse-v2 -mode=latency --opcode-name=LDGM --benchmark-phase=assemble-measured-code 2>&1 | ||
| # CHECK: LDGM: Unsupported opcode: isPointerAuth/isUncheckedAccess | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,6 +15,8 @@ | |
| #include "llvm/ADT/Twine.h" | ||
| #include "llvm/Support/Error.h" | ||
| #include "llvm/TargetParser/SubtargetFeature.h" | ||
| #include "AArch64.h" | ||
| #include "AArch64RegisterInfo.h" | ||
|
|
||
| namespace llvm { | ||
| namespace exegesis { | ||
|
|
@@ -35,6 +37,37 @@ const ExegesisTarget *ExegesisTarget::lookup(Triple TT) { | |
| return nullptr; | ||
| } | ||
|
|
||
| static bool isPointerAuthOpcode(unsigned Opcode) { | ||
|
||
| switch (Opcode) { | ||
| case AArch64::AUTDA: | ||
| case AArch64::AUTDB: | ||
| case AArch64::AUTDZA: | ||
| case AArch64::AUTDZB: | ||
| case AArch64::AUTIA: | ||
| case AArch64::AUTIA1716: | ||
| case AArch64::AUTIASP: | ||
| case AArch64::AUTIAZ: | ||
| case AArch64::AUTIB: | ||
| case AArch64::AUTIB1716: | ||
| case AArch64::AUTIBSP: | ||
| case AArch64::AUTIBZ: | ||
| case AArch64::AUTIZA: | ||
| case AArch64::AUTIZB: | ||
| return true; | ||
| default: | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| static bool isUncheckedAccessOpcode(unsigned Opcode) { | ||
| switch (Opcode) { | ||
| case AArch64::LDGM: | ||
| return true; | ||
| default: | ||
| return false; | ||
| } | ||
| } | ||
|
|
||
| const char * | ||
| ExegesisTarget::getIgnoredOpcodeReasonOrNull(const LLVMState &State, | ||
| unsigned Opcode) const { | ||
|
|
@@ -45,6 +78,8 @@ ExegesisTarget::getIgnoredOpcodeReasonOrNull(const LLVMState &State, | |
| return "Unsupported opcode: isBranch/isIndirectBranch"; | ||
| if (InstrDesc.isCall() || InstrDesc.isReturn()) | ||
| return "Unsupported opcode: isCall/isReturn"; | ||
| if (isPointerAuthOpcode(Opcode) || isUncheckedAccessOpcode(Opcode)) | ||
| return "Unsupported opcode: isPointerAuth/isUncheckedAccess"; | ||
| return nullptr; | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick about the filename
err_skip_illegal_Instruction.s: they are not illegal instructions per se, it's more that they are unsupported (at the moment), and also one word is capitalised and the other aren't so is a bit inconsistent. My suggestion would beskip_unsupported_instructions.sor something like that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I originally named it
err_skip_illegal_Instruction.sto indicate it's a test case for error skipping behavior, but you're right thatskip_unsupported_instructions.swould be more accurate since these instructions are unsupported rather than illegal. I will push required changes.Btw, Can you weigh in for checking other skipped errors (
isPseudo,isReturnetc.).Does it make sense to check them also in this testfile, (just for completeness) ?