-
Notifications
You must be signed in to change notification settings - Fork 12.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Exegesis][RISCV] Add RISCV support for llvm-exegesis
Llvm-exegesis RISCV port is a result of team effort. Below everyone involved listed. Co-authored-by: Konstantin Vladimirov <[email protected]> Co-authored-by: Dmitrii Petrov <[email protected]> Co-authored-by: Dmitry Bushev <[email protected]> Co-authored-by: Mark Goncharov <[email protected]> Co-authored-by: Anastasiya Chernikova <[email protected]>
- Loading branch information
1 parent
971237d
commit e058716
Showing
31 changed files
with
983 additions
and
48 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
59 changes: 59 additions & 0 deletions
59
llvm/test/tools/llvm-exegesis/RISCV/latency-by-extension-A.s
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,59 @@ | ||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=AMOAND_D -mattr="+a" |& FileCheck --check-prefix=TEST1 %s | ||
|
||
TEST1: --- | ||
TEST1-NEXT: mode: latency | ||
TEST1-NEXT: key: | ||
TEST1-NEXT: instructions: | ||
TEST1-NEXT: - 'AMOAND_D [[RE01:X[0-9]+]] X10 [[RE01:X[0-9]+]]' | ||
TEST1-NEXT: config: '' | ||
TEST1-NEXT: register_initial_values: | ||
TEST1-NEXT: - '[[RE01:X[0-9]+]]=0x0' | ||
TEST1-LAST: ... | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=AMOADD_W -mattr="+a" |& FileCheck --check-prefix=TEST2 %s | ||
|
||
TEST2: --- | ||
TEST2-NEXT: mode: latency | ||
TEST2-NEXT: key: | ||
TEST2-NEXT: instructions: | ||
TEST2-NEXT: - 'AMOADD_W [[RE02:X[0-9]+]] X10 [[RE02:X[0-9]+]]' | ||
TEST2-NEXT: config: '' | ||
TEST2-NEXT: register_initial_values: | ||
TEST2-NEXT: - '[[RE02:X[0-9]+]]=0x0' | ||
TEST2-LAST: ... | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=AMOMAXU_D -mattr="+a" |& FileCheck --check-prefix=TEST3 %s | ||
|
||
TEST3: --- | ||
TEST3-NEXT: mode: latency | ||
TEST3-NEXT: key: | ||
TEST3-NEXT: instructions: | ||
TEST3-NEXT: - 'AMOMAXU_D [[RE03:X[0-9]+]] X10 [[RE03:X[0-9]+]]' | ||
TEST3-NEXT: config: '' | ||
TEST3-NEXT: register_initial_values: | ||
TEST3-NEXT: - '[[RE03:X[0-9]+]]=0x0' | ||
TEST3-LAST: ... | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=AMOMIN_W -mattr="+a" |& FileCheck --check-prefix=TEST4 %s | ||
|
||
TEST4: --- | ||
TEST4-NEXT: mode: latency | ||
TEST4-NEXT: key: | ||
TEST4-NEXT: instructions: | ||
TEST4-NEXT: - 'AMOMIN_W [[RE04:X[0-9]+]] X10 [[RE04:X[0-9]+]]' | ||
TEST4-NEXT: config: '' | ||
TEST4-NEXT: register_initial_values: | ||
TEST4-NEXT: - '[[RE04:X[0-9]+]]=0x0' | ||
TEST4-LAST: ... | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=AMOXOR_D -mattr="+a" |& FileCheck --check-prefix=TEST5 %s | ||
|
||
TEST5: --- | ||
TEST5-NEXT: mode: latency | ||
TEST5-NEXT: key: | ||
TEST5-NEXT: instructions: | ||
TEST5-NEXT: - 'AMOXOR_D [[RE05:X[0-9]+]] X10 [[RE05:X[0-9]+]]' | ||
TEST5-NEXT: config: '' | ||
TEST5-NEXT: register_initial_values: | ||
TEST5-NEXT: - '[[RE05:X[0-9]+]]=0x0' | ||
TEST5-LAST: ... |
65 changes: 65 additions & 0 deletions
65
llvm/test/tools/llvm-exegesis/RISCV/latency-by-extension-C.s
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,65 @@ | ||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=C_ADDI -mattr=+c |& FileCheck --check-prefix=TEST1 %s | ||
|
||
TEST1: --- | ||
TEST1-NEXT: mode: latency | ||
TEST1-NEXT: key: | ||
TEST1-NEXT: instructions: | ||
TEST1-NEXT: - 'C_ADDI [[REG01:X[0-9]+]] [[RE02:X[0-9]+]] [[IMM0:i_0x[0-9]+]]' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=C_ADDIW -mattr=+c |& FileCheck --check-prefix=TEST2 %s | ||
|
||
TEST2: --- | ||
TEST2-NEXT: mode: latency | ||
TEST2-NEXT: key: | ||
TEST2-NEXT: instructions: | ||
TEST2-NEXT: - 'C_ADDIW [[REG11:X[0-9]+]] [[RE12:X[0-9]+]] [[IMM1:i_0x[0-9]+]]' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=C_ANDI -mattr=+c |& FileCheck --check-prefix=TEST3 %s | ||
|
||
TEST3: --- | ||
TEST3-NEXT: mode: latency | ||
TEST3-NEXT: key: | ||
TEST3-NEXT: instructions: | ||
TEST3-NEXT: - 'C_ANDI [[REG31:X[0-9]+]] [[REG32:X[0-9]+]] [[IMM3:i_0x[0-9]+]]' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=C_SLLI -mattr=+c |& FileCheck --check-prefix=TEST4 %s | ||
|
||
TEST4: --- | ||
TEST4-NEXT: mode: latency | ||
TEST4-NEXT: key: | ||
TEST4-NEXT: instructions: | ||
TEST4-NEXT: - 'C_SLLI [[REG81:X[0-9]+]] [[REG82:X[0-9]+]] [[IMM8:i_0x[0-9]+]]' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=C_SRAI -mattr=+c |& FileCheck --check-prefix=TEST5 %s | ||
|
||
TEST5: --- | ||
TEST5-NEXT: mode: latency | ||
TEST5-NEXT: key: | ||
TEST5-NEXT: instructions: | ||
TEST5-NEXT: - 'C_SRAI [[REG91:X[0-9]+]] [[REG92:X[0-9]+]] [[IMM9:i_0x[0-9]+]]' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=C_SRLI -mattr=+c |& FileCheck --check-prefix=TEST6 %s | ||
|
||
TEST6: --- | ||
TEST6-NEXT: mode: latency | ||
TEST6-NEXT: key: | ||
TEST6-NEXT: instructions: | ||
TEST6-NEXT: - 'C_SRLI [[REG101:X[0-9]+]] [[REG102:X[0-9]+]] [[IMM10:i_0x[0-9]+]]' | ||
TEST6-LAST: ... | ||
|
||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=C_LD -mattr=+c |& FileCheck --check-prefix=TEST7 %s | ||
|
||
TEST7: --- | ||
TEST7-NEXT: mode: latency | ||
TEST7-NEXT: key: | ||
TEST7-NEXT: instructions: | ||
TEST7-NEXT: - 'C_LD [[REG61:X[0-9]+]] [[REG62:X[0-9]+]] [[IMM6:i_0x[0-9]+]]' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=C_LW -mattr=+c |& FileCheck --check-prefix=TEST8 %s | ||
|
||
TEST8: --- | ||
TEST8-NEXT: mode: latency | ||
TEST8-NEXT: key: | ||
TEST8-NEXT: instructions: | ||
TEST8-NEXT: - 'C_LW [[REG71:X[0-9]+]] [[REG72:X[0-9]+]] [[IMM7:i_0x[0-9]+]]' |
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,60 @@ | ||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=LD |& FileCheck --check-prefix=TEST1 %s | ||
|
||
TEST1: --- | ||
TEST1-NEXT: mode: latency | ||
TEST1-NEXT: key: | ||
TEST1-NEXT: instructions: | ||
TEST1-NEXT: - 'LD X10 X10 i_0x0' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=LW |& FileCheck --check-prefix=TEST2 %s | ||
|
||
TEST2: --- | ||
TEST2-NEXT: mode: latency | ||
TEST2-NEXT: key: | ||
TEST2-NEXT: instructions: | ||
TEST2-NEXT: - 'LW X10 X10 i_0x0' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=LH |& FileCheck --check-prefix=TEST3 %s | ||
|
||
TEST3: --- | ||
TEST3-NEXT: mode: latency | ||
TEST3-NEXT: key: | ||
TEST3-NEXT: instructions: | ||
TEST3-NEXT: - 'LH X10 X10 i_0x0' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=LWU |& FileCheck --check-prefix=TEST4 %s | ||
|
||
TEST4: --- | ||
TEST4-NEXT: mode: latency | ||
TEST4-NEXT: key: | ||
TEST4-NEXT: instructions: | ||
TEST4-NEXT: - 'LWU X10 X10 i_0x0' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=LBU |& FileCheck --check-prefix=TEST5 %s | ||
|
||
TEST5: --- | ||
TEST5-NEXT: mode: latency | ||
TEST5-NEXT: key: | ||
TEST5-NEXT: instructions: | ||
TEST5-NEXT: - 'LBU X10 X10 i_0x0' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=LUI |& FileCheck --check-prefix=TEST6 %s | ||
|
||
TEST6: LUI: No strategy found to make the execution serial | ||
|
||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=LB |& FileCheck --check-prefix=TEST7 %s | ||
|
||
TEST7: --- | ||
TEST7-NEXT: mode: latency | ||
TEST7-NEXT: key: | ||
TEST7-NEXT: instructions: | ||
TEST7-NEXT: - 'LB X10 X10 i_0x0' | ||
|
||
# RUN: llvm-exegesis -mode=latency -mtriple=riscv64-unknown-linux-gnu --benchmark-phase=assemble-measured-code -opcode-name=LR_W_RL -mattr="+a" |& FileCheck --check-prefix=TEST8 %s | ||
|
||
TEST8: --- | ||
TEST8-NEXT: mode: latency | ||
TEST8-NEXT: key: | ||
TEST8-NEXT: instructions: | ||
TEST8-NEXT: - 'LR_W_RL X10 X10' |
11 changes: 11 additions & 0 deletions
11
llvm/test/tools/llvm-exegesis/RISCV/latency-by-opcode-name-FADD_D.s
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,11 @@ | ||
# RUN: llvm-exegesis -mtriple=riscv64-unknown-linux-gnu -mode=latency --benchmark-phase=assemble-measured-code -mattr=+d -opcode-name=FADD_D |& FileCheck %s | ||
|
||
CHECK: --- | ||
CHECK-NEXT: mode: latency | ||
CHECK-NEXT: key: | ||
CHECK-NEXT: instructions: | ||
CHECK-NEXT: - 'FADD_D [[REG1:F[0-9]+_D]] [[REG2:F[0-9]+_D]] [[REG3:F[0-9]+_D]] i_0x7' | ||
CHECK-NEXT: config: '' | ||
CHECK-NEXT: register_initial_values: | ||
CHECK-DAG: - '[[REG1]]=0x0' | ||
CHECK-LAST: ... |
3 changes: 3 additions & 0 deletions
3
llvm/test/tools/llvm-exegesis/RISCV/latency-pre-assigned-register.s
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,3 @@ | ||
RUN: llvm-exegesis -mode=latency --benchmark-phase=assemble-measured-code -opcode-name=LB -mtriple=riscv64-unknown-linux-gnu | ||
|
||
CHECK: Warning: Pre-assigned register prevented usage of self-aliasing strategy. |
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
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
Oops, something went wrong.