-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[llvm-mca][RISCV] vsetivli and vsetvli act as instruments
Since the LMUL data that is needed to create an instrument is avaliable statically from vsetivli and vsetvli instructions, LMUL instruments can be automatically generated so that clients of the tool do no need to manually insert instrument comments. Instrument comments may be placed after a vset{i}vli instruction, which will override instrument that was automatically inserted. As a result, clients of llvm-mca instruments do not need to update their existing instrument comments. However, if the instrument has the same LMUL as the vset{i}vli, then it is reccomended to remove the instrument comment as it becomes redundant. Differential Revision: https://reviews.llvm.org/D154526
- Loading branch information
1 parent
aef6d46
commit ecf372f
Showing
10 changed files
with
364 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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,69 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py | ||
# RUN: llvm-mca -mtriple=riscv64 -mcpu=sifive-x280 -timeline -iterations=1 < %s | FileCheck %s | ||
|
||
vadd.vv v12, v12, v12 | ||
vsetvli zero, a0, e8, m1, tu, mu | ||
vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Iterations: 1 | ||
# CHECK-NEXT: Instructions: 3 | ||
# CHECK-NEXT: Total Cycles: 21 | ||
# CHECK-NEXT: Total uOps: 3 | ||
|
||
# CHECK: Dispatch Width: 2 | ||
# CHECK-NEXT: uOps Per Cycle: 0.14 | ||
# CHECK-NEXT: IPC: 0.14 | ||
# CHECK-NEXT: Block RThroughput: 18.0 | ||
|
||
# CHECK: Instruction Info: | ||
# CHECK-NEXT: [1]: #uOps | ||
# CHECK-NEXT: [2]: Latency | ||
# CHECK-NEXT: [3]: RThroughput | ||
# CHECK-NEXT: [4]: MayLoad | ||
# CHECK-NEXT: [5]: MayStore | ||
# CHECK-NEXT: [6]: HasSideEffects (U) | ||
|
||
# CHECK: [1] [2] [3] [4] [5] [6] Instructions: | ||
# CHECK-NEXT: 1 4 16.00 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 1 3 1.00 U vsetvli zero, a0, e8, m1, tu, mu | ||
# CHECK-NEXT: 1 4 2.00 vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Resources: | ||
# CHECK-NEXT: [0] - SiFive7FDiv | ||
# CHECK-NEXT: [1] - SiFive7IDiv | ||
# CHECK-NEXT: [2] - SiFive7PipeA | ||
# CHECK-NEXT: [3] - SiFive7PipeB | ||
# CHECK-NEXT: [4] - SiFive7PipeV | ||
# CHECK-NEXT: [5] - SiFive7VA | ||
# CHECK-NEXT: [6] - SiFive7VL | ||
# CHECK-NEXT: [7] - SiFive7VS | ||
|
||
# CHECK: Resource pressure per iteration: | ||
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] | ||
# CHECK-NEXT: - - 1.00 - 18.00 18.00 - - | ||
|
||
# CHECK: Resource pressure by instruction: | ||
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] Instructions: | ||
# CHECK-NEXT: - - - - 16.00 16.00 - - vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: - - 1.00 - - - - - vsetvli zero, a0, e8, m1, tu, mu | ||
# CHECK-NEXT: - - - - 2.00 2.00 - - vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Timeline view: | ||
# CHECK-NEXT: 0123456789 | ||
# CHECK-NEXT: Index 0123456789 0 | ||
|
||
# CHECK: [0,0] DeeeE. . . . vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: [0,1] .DeeE. . . . vsetvli zero, a0, e8, m1, tu, mu | ||
# CHECK-NEXT: [0,2] . . . .DeeeE vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Average Wait times (based on the timeline view): | ||
# CHECK-NEXT: [0]: Executions | ||
# CHECK-NEXT: [1]: Average time spent waiting in a scheduler's queue | ||
# CHECK-NEXT: [2]: Average time spent waiting in a scheduler's queue while ready | ||
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage | ||
|
||
# CHECK: [0] [1] [2] [3] | ||
# CHECK-NEXT: 0. 1 0.0 0.0 0.0 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 1. 1 0.0 0.0 0.0 vsetvli zero, a0, e8, m1, tu, mu | ||
# CHECK-NEXT: 2. 1 0.0 0.0 0.0 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 1 0.0 0.0 0.0 <total> |
This file contains 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,74 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py | ||
# RUN: llvm-mca -mtriple=riscv64 -mcpu=sifive-x280 -timeline -iterations=1 < %s | FileCheck %s | ||
|
||
vsetivli zero, 8, e8, m1, tu, mu | ||
vadd.vv v12, v12, v12 | ||
vsetivli zero, 8, e8, m8, tu, mu | ||
vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Iterations: 1 | ||
# CHECK-NEXT: Instructions: 4 | ||
# CHECK-NEXT: Total Cycles: 12 | ||
# CHECK-NEXT: Total uOps: 4 | ||
|
||
# CHECK: Dispatch Width: 2 | ||
# CHECK-NEXT: uOps Per Cycle: 0.33 | ||
# CHECK-NEXT: IPC: 0.33 | ||
# CHECK-NEXT: Block RThroughput: 18.0 | ||
|
||
# CHECK: Instruction Info: | ||
# CHECK-NEXT: [1]: #uOps | ||
# CHECK-NEXT: [2]: Latency | ||
# CHECK-NEXT: [3]: RThroughput | ||
# CHECK-NEXT: [4]: MayLoad | ||
# CHECK-NEXT: [5]: MayStore | ||
# CHECK-NEXT: [6]: HasSideEffects (U) | ||
|
||
# CHECK: [1] [2] [3] [4] [5] [6] Instructions: | ||
# CHECK-NEXT: 1 3 1.00 U vsetivli zero, 8, e8, m1, tu, mu | ||
# CHECK-NEXT: 1 4 2.00 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 1 3 1.00 U vsetivli zero, 8, e8, m8, tu, mu | ||
# CHECK-NEXT: 1 4 16.00 vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Resources: | ||
# CHECK-NEXT: [0] - SiFive7FDiv | ||
# CHECK-NEXT: [1] - SiFive7IDiv | ||
# CHECK-NEXT: [2] - SiFive7PipeA | ||
# CHECK-NEXT: [3] - SiFive7PipeB | ||
# CHECK-NEXT: [4] - SiFive7PipeV | ||
# CHECK-NEXT: [5] - SiFive7VA | ||
# CHECK-NEXT: [6] - SiFive7VL | ||
# CHECK-NEXT: [7] - SiFive7VS | ||
|
||
# CHECK: Resource pressure per iteration: | ||
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] | ||
# CHECK-NEXT: - - 2.00 - 18.00 18.00 - - | ||
|
||
# CHECK: Resource pressure by instruction: | ||
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] Instructions: | ||
# CHECK-NEXT: - - 1.00 - - - - - vsetivli zero, 8, e8, m1, tu, mu | ||
# CHECK-NEXT: - - - - 2.00 2.00 - - vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: - - 1.00 - - - - - vsetivli zero, 8, e8, m8, tu, mu | ||
# CHECK-NEXT: - - - - 16.00 16.00 - - vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Timeline view: | ||
# CHECK-NEXT: 01 | ||
# CHECK-NEXT: Index 0123456789 | ||
|
||
# CHECK: [0,0] DeeE . .. vsetivli zero, 8, e8, m1, tu, mu | ||
# CHECK-NEXT: [0,1] . DeeeE .. vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: [0,2] . DeeE .. vsetivli zero, 8, e8, m8, tu, mu | ||
# CHECK-NEXT: [0,3] . . DeeeE vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Average Wait times (based on the timeline view): | ||
# CHECK-NEXT: [0]: Executions | ||
# CHECK-NEXT: [1]: Average time spent waiting in a scheduler's queue | ||
# CHECK-NEXT: [2]: Average time spent waiting in a scheduler's queue while ready | ||
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage | ||
|
||
# CHECK: [0] [1] [2] [3] | ||
# CHECK-NEXT: 0. 1 0.0 0.0 0.0 vsetivli zero, 8, e8, m1, tu, mu | ||
# CHECK-NEXT: 1. 1 0.0 0.0 0.0 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 2. 1 0.0 0.0 0.0 vsetivli zero, 8, e8, m8, tu, mu | ||
# CHECK-NEXT: 3. 1 0.0 0.0 0.0 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 1 0.0 0.0 0.0 <total> |
This file contains 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,74 @@ | ||
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py | ||
# RUN: llvm-mca -mtriple=riscv64 -mcpu=sifive-x280 -timeline -iterations=1 < %s | FileCheck %s | ||
|
||
vsetvli zero, a0, e8, m1, tu, mu | ||
vadd.vv v12, v12, v12 | ||
vsetvli zero, a0, e8, m8, tu, mu | ||
vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Iterations: 1 | ||
# CHECK-NEXT: Instructions: 4 | ||
# CHECK-NEXT: Total Cycles: 12 | ||
# CHECK-NEXT: Total uOps: 4 | ||
|
||
# CHECK: Dispatch Width: 2 | ||
# CHECK-NEXT: uOps Per Cycle: 0.33 | ||
# CHECK-NEXT: IPC: 0.33 | ||
# CHECK-NEXT: Block RThroughput: 18.0 | ||
|
||
# CHECK: Instruction Info: | ||
# CHECK-NEXT: [1]: #uOps | ||
# CHECK-NEXT: [2]: Latency | ||
# CHECK-NEXT: [3]: RThroughput | ||
# CHECK-NEXT: [4]: MayLoad | ||
# CHECK-NEXT: [5]: MayStore | ||
# CHECK-NEXT: [6]: HasSideEffects (U) | ||
|
||
# CHECK: [1] [2] [3] [4] [5] [6] Instructions: | ||
# CHECK-NEXT: 1 3 1.00 U vsetvli zero, a0, e8, m1, tu, mu | ||
# CHECK-NEXT: 1 4 2.00 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 1 3 1.00 U vsetvli zero, a0, e8, m8, tu, mu | ||
# CHECK-NEXT: 1 4 16.00 vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Resources: | ||
# CHECK-NEXT: [0] - SiFive7FDiv | ||
# CHECK-NEXT: [1] - SiFive7IDiv | ||
# CHECK-NEXT: [2] - SiFive7PipeA | ||
# CHECK-NEXT: [3] - SiFive7PipeB | ||
# CHECK-NEXT: [4] - SiFive7PipeV | ||
# CHECK-NEXT: [5] - SiFive7VA | ||
# CHECK-NEXT: [6] - SiFive7VL | ||
# CHECK-NEXT: [7] - SiFive7VS | ||
|
||
# CHECK: Resource pressure per iteration: | ||
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] | ||
# CHECK-NEXT: - - 2.00 - 18.00 18.00 - - | ||
|
||
# CHECK: Resource pressure by instruction: | ||
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] Instructions: | ||
# CHECK-NEXT: - - 1.00 - - - - - vsetvli zero, a0, e8, m1, tu, mu | ||
# CHECK-NEXT: - - - - 2.00 2.00 - - vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: - - 1.00 - - - - - vsetvli zero, a0, e8, m8, tu, mu | ||
# CHECK-NEXT: - - - - 16.00 16.00 - - vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Timeline view: | ||
# CHECK-NEXT: 01 | ||
# CHECK-NEXT: Index 0123456789 | ||
|
||
# CHECK: [0,0] DeeE . .. vsetvli zero, a0, e8, m1, tu, mu | ||
# CHECK-NEXT: [0,1] . DeeeE .. vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: [0,2] . DeeE .. vsetvli zero, a0, e8, m8, tu, mu | ||
# CHECK-NEXT: [0,3] . . DeeeE vadd.vv v12, v12, v12 | ||
|
||
# CHECK: Average Wait times (based on the timeline view): | ||
# CHECK-NEXT: [0]: Executions | ||
# CHECK-NEXT: [1]: Average time spent waiting in a scheduler's queue | ||
# CHECK-NEXT: [2]: Average time spent waiting in a scheduler's queue while ready | ||
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage | ||
|
||
# CHECK: [0] [1] [2] [3] | ||
# CHECK-NEXT: 0. 1 0.0 0.0 0.0 vsetvli zero, a0, e8, m1, tu, mu | ||
# CHECK-NEXT: 1. 1 0.0 0.0 0.0 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 2. 1 0.0 0.0 0.0 vsetvli zero, a0, e8, m8, tu, mu | ||
# CHECK-NEXT: 3. 1 0.0 0.0 0.0 vadd.vv v12, v12, v12 | ||
# CHECK-NEXT: 1 0.0 0.0 0.0 <total> |
This file contains 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
Oops, something went wrong.