-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[llvm-mca] Add -skip-unsupported-instructions option #89733
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
Merged
peterwaller-arm
merged 1 commit into
llvm:main
from
peterwaller-arm:skip-unsupported-instructions
Apr 29, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
llvm/test/tools/llvm-mca/X86/BtVer2/skip-unsupported-instructions-none-remain.s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -skip-unsupported-instructions %s |& FileCheck --check-prefixes=CHECK-ALL,CHECK-SKIP %s | ||
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 %s |& FileCheck --check-prefixes=CHECK-ALL,CHECK-ERROR %s | ||
|
||
# Test defends that if all instructions are skipped leaving an empty input, an error is printed. | ||
|
||
bzhi %eax, %ebx, %ecx | ||
|
||
# CHECK-ALL-NOT: error | ||
|
||
# CHECK-ERROR: error: found an unsupported instruction in the input assembly sequence, use -skip-unsupported-instructions to ignore. | ||
|
||
# CHECK-SKIP: warning: found an unsupported instruction in the input assembly sequence, skipping with -skip-unsupported-instructions, note accuracy will be impacted: | ||
# CHECK-SKIP: note: instruction: bzhil %eax, %ebx, %ecx | ||
# CHECK-SKIP: error: no assembly instructions found. |
55 changes: 52 additions & 3 deletions
55
llvm/test/tools/llvm-mca/X86/BtVer2/unsupported-instruction.s
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,55 @@ | ||
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 %s 2>&1 | FileCheck %s | ||
# RUN: llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 -skip-unsupported-instructions -timeline %s |& FileCheck --check-prefix=CHECK-SKIP %s | ||
# RUN: not llvm-mca -mtriple=x86_64-unknown-unknown -mcpu=btver2 %s |& FileCheck --check-prefix=CHECK-ERROR %s | ||
|
||
# Test checks that unsupported instructions exit with an error, unless -skip-unsupported-instructions is passed, in which case the remaining instructions should be analysed. | ||
|
||
# CHECK-SKIP: warning: found an unsupported instruction in the input assembly sequence, skipping with -skip-unsupported-instructions, note accuracy will be impacted: | ||
# CHECK-ERROR: error: found an unsupported instruction in the input assembly sequence, use -skip-unsupported-instructions to ignore. | ||
|
||
bzhi %eax, %ebx, %ecx | ||
|
||
# CHECK: error: found an unsupported instruction in the input assembly sequence. | ||
# CHECK-NEXT: note: instruction: bzhil %eax, %ebx, %ecx | ||
# Supported instruction that may be analysed. | ||
add %eax, %eax | ||
|
||
# CHECK-SKIP: Iterations: 100 | ||
# CHECK-SKIP: Instructions: 100 | ||
# CHECK-SKIP: Total Cycles: 103 | ||
# CHECK-SKIP: Total uOps: 100 | ||
|
||
# CHECK-SKIP: Dispatch Width: 2 | ||
# CHECK-SKIP: uOps Per Cycle: 0.97 | ||
# CHECK-SKIP: IPC: 0.97 | ||
# CHECK-SKIP: Block RThroughput: 0.5 | ||
|
||
# CHECK-SKIP: Instruction Info: | ||
# CHECK-SKIP: [1]: #uOps | ||
# CHECK-SKIP: [2]: Latency | ||
# CHECK-SKIP: [3]: RThroughput | ||
# CHECK-SKIP: [4]: MayLoad | ||
# CHECK-SKIP: [5]: MayStore | ||
# CHECK-SKIP: [6]: HasSideEffects (U) | ||
|
||
# CHECK-SKIP: [1] [2] [3] [4] [5] [6] Instructions: | ||
# CHECK-SKIP: 1 1 0.50 addl %eax, %eax | ||
|
||
# CHECK-SKIP: Timeline view: | ||
|
||
# CHECK-SKIP: [0,0] DeER . . . addl %eax, %eax | ||
# CHECK-SKIP: [1,0] D=eER. . . addl %eax, %eax | ||
# CHECK-SKIP: [2,0] .D=eER . . addl %eax, %eax | ||
# CHECK-SKIP: [3,0] .D==eER . . addl %eax, %eax | ||
# CHECK-SKIP: [4,0] . D==eER . . addl %eax, %eax | ||
# CHECK-SKIP: [5,0] . D===eER . . addl %eax, %eax | ||
# CHECK-SKIP: [6,0] . D===eER. . addl %eax, %eax | ||
# CHECK-SKIP: [7,0] . D====eER . addl %eax, %eax | ||
# CHECK-SKIP: [8,0] . D====eER. addl %eax, %eax | ||
# CHECK-SKIP: [9,0] . D=====eER addl %eax, %eax | ||
|
||
# CHECK-SKIP: Average Wait times (based on the timeline view): | ||
# CHECK-SKIP: [0]: Executions | ||
# CHECK-SKIP: [1]: Average time spent waiting in a scheduler's queue | ||
# CHECK-SKIP: [2]: Average time spent waiting in a scheduler's queue while ready | ||
# CHECK-SKIP: [3]: Average time elapsed from WB until retire stage | ||
|
||
# CHECK-SKIP: [0] [1] [2] [3] | ||
# CHECK-SKIP: 0. 10 3.5 0.1 0.0 addl %eax, %eax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.