Skip to content

Commit 7eadc19

Browse files
authored
[RISCV] Add a generic OOO CPU (#120712)
We add a generic out-of-order CPU model here just like what GCC has done. People may use this model to evaluate some optimizations, and more importantly, people can use this model as a template to customize their own CPU models. The design (units, cycles, ...) of this model is random so don't take it seriously.
1 parent 606ff7e commit 7eadc19

File tree

8 files changed

+1971
-1
lines changed

8 files changed

+1971
-1
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ LoongArch Support
217217
RISC-V Support
218218
^^^^^^^^^^^^^^
219219

220+
- Add support for `-mtune=generic-ooo` (a generic out-of-order model).
221+
220222
CUDA/HIP Language Changes
221223
^^^^^^^^^^^^^^^^^^^^^^^^^
222224

clang/test/Misc/target-invalid-cpu-note/riscv.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
// TUNE-RISCV32-SAME: {{^}}, syntacore-scr4-rv32
6767
// TUNE-RISCV32-SAME: {{^}}, syntacore-scr5-rv32
6868
// TUNE-RISCV32-SAME: {{^}}, generic
69+
// TUNE-RISCV32-SAME: {{^}}, generic-ooo
6970
// TUNE-RISCV32-SAME: {{^}}, rocket
7071
// TUNE-RISCV32-SAME: {{^}}, sifive-7-series
7172
// TUNE-RISCV32-SAME: {{$}}
@@ -96,6 +97,7 @@
9697
// TUNE-RISCV64-SAME: {{^}}, veyron-v1
9798
// TUNE-RISCV64-SAME: {{^}}, xiangshan-nanhu
9899
// TUNE-RISCV64-SAME: {{^}}, generic
100+
// TUNE-RISCV64-SAME: {{^}}, generic-ooo
99101
// TUNE-RISCV64-SAME: {{^}}, rocket
100102
// TUNE-RISCV64-SAME: {{^}}, sifive-7-series
101103
// TUNE-RISCV64-SAME: {{$}}

llvm/lib/Target/RISCV/RISCV.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ include "RISCVMacroFusion.td"
4545
//===----------------------------------------------------------------------===//
4646
// RISC-V Scheduling Models
4747
//===----------------------------------------------------------------------===//
48-
48+
include "RISCVSchedGenericOOO.td"
4949
include "RISCVSchedMIPSP8700.td"
5050
include "RISCVSchedRocket.td"
5151
include "RISCVSchedSiFive7.td"

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ def GENERIC_RV64 : RISCVProcessorModel<"generic-rv64",
103103
// Support generic for compatibility with other targets. The triple will be used
104104
// to change to the appropriate rv32/rv64 version.
105105
def GENERIC : RISCVTuneProcessorModel<"generic", NoSchedModel>, GenericTuneInfo;
106+
def GENERIC_OOO : RISCVTuneProcessorModel<"generic-ooo", GenericOOOModel>,
107+
GenericTuneInfo;
106108

107109
def MIPS_P8700 : RISCVProcessorModel<"mips-p8700",
108110
MIPSP8700Model,

0 commit comments

Comments
 (0)