Skip to content

Commit f40909f

Browse files
[RISCV] Add SiFive X390 scheduling model (llvm#143938)
This patch adds the scheduling model for sifive-x390. X390 is a dual issue in-order CPU. It has two scalar and two vector pipes, with VLEN=1024 and DLEN=512. Co-authored-by: Michael Maitland <[email protected]>
1 parent 8d83d04 commit f40909f

File tree

11 files changed

+10225
-163
lines changed

11 files changed

+10225
-163
lines changed

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,8 @@ def SIFIVE_X280 : RISCVProcessorModel<"sifive-x280", SiFive7Model,
292292
FeatureStdExtZbb],
293293
SiFiveIntelligenceTuneFeatures>;
294294

295-
def SIFIVE_X390 : RISCVProcessorModel<"sifive-x390", NoSchedModel,
295+
def SIFIVE_X390 : RISCVProcessorModel<"sifive-x390",
296+
SiFiveX390Model,
296297
[Feature64Bit,
297298
FeatureStdExtI,
298299
FeatureStdExtM,

llvm/lib/Target/RISCV/RISCVSchedSiFive7.td

Lines changed: 233 additions & 162 deletions
Large diffs are not rendered by default.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
2+
# RUN: llvm-mca -mtriple=riscv64 -mcpu=sifive-x390 -instruction-tables=full -iterations=1 < %s \
3+
# RUN: | FileCheck %s
4+
5+
div a0, a1, a2
6+
fdiv.s f1, f2, f3
7+
8+
# CHECK: Resources:
9+
# CHECK-NEXT: [0] - VLEN1024X300SiFive7FDiv:1
10+
# CHECK-NEXT: [1] - VLEN1024X300SiFive7IDiv:1
11+
# CHECK-NEXT: [2] - VLEN1024X300SiFive7PipeA:1
12+
# CHECK-NEXT: [3] - VLEN1024X300SiFive7PipeAB:2 VLEN1024X300SiFive7PipeA, VLEN1024X300SiFive7PipeB
13+
# CHECK-NEXT: [4] - VLEN1024X300SiFive7PipeB:1
14+
# CHECK-NEXT: [5] - VLEN1024X300SiFive7VA1:1
15+
# CHECK-NEXT: [6] - VLEN1024X300SiFive7VA1OrVA2:2 VLEN1024X300SiFive7VA1, VLEN1024X300SiFive7VA2
16+
# CHECK-NEXT: [7] - VLEN1024X300SiFive7VA2:1
17+
# CHECK-NEXT: [8] - VLEN1024X300SiFive7VCQ:1
18+
# CHECK-NEXT: [9] - VLEN1024X300SiFive7VL:1
19+
# CHECK-NEXT: [10] - VLEN1024X300SiFive7VS:1
20+
21+
# CHECK: Instruction Info:
22+
# CHECK-NEXT: [1]: #uOps
23+
# CHECK-NEXT: [2]: Latency
24+
# CHECK-NEXT: [3]: RThroughput
25+
# CHECK-NEXT: [4]: MayLoad
26+
# CHECK-NEXT: [5]: MayStore
27+
# CHECK-NEXT: [6]: HasSideEffects (U)
28+
# CHECK-NEXT: [7]: Bypass Latency
29+
# CHECK-NEXT: [8]: Resources (<Name> | <Name>[<ReleaseAtCycle>] | <Name>[<AcquireAtCycle>,<ReleaseAtCycle])
30+
# CHECK-NEXT: [9]: LLVM Opcode Name
31+
32+
# CHECK: [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions:
33+
# CHECK-NEXT: 1 66 65.00 66 VLEN1024X300SiFive7IDiv[65],VLEN1024X300SiFive7PipeAB,VLEN1024X300SiFive7PipeB DIV div a0, a1, a2
34+
# CHECK-NEXT: 1 27 26.00 27 VLEN1024X300SiFive7FDiv[26],VLEN1024X300SiFive7PipeAB,VLEN1024X300SiFive7PipeB FDIV_S fdiv.s ft1, ft2, ft3
35+
36+
# CHECK: Resources:
37+
# CHECK-NEXT: [0] - VLEN1024X300SiFive7FDiv
38+
# CHECK-NEXT: [1] - VLEN1024X300SiFive7IDiv
39+
# CHECK-NEXT: [2] - VLEN1024X300SiFive7PipeA
40+
# CHECK-NEXT: [3] - VLEN1024X300SiFive7PipeB
41+
# CHECK-NEXT: [4] - VLEN1024X300SiFive7VA1
42+
# CHECK-NEXT: [5] - VLEN1024X300SiFive7VA2
43+
# CHECK-NEXT: [6] - VLEN1024X300SiFive7VCQ
44+
# CHECK-NEXT: [7] - VLEN1024X300SiFive7VL
45+
# CHECK-NEXT: [8] - VLEN1024X300SiFive7VS
46+
47+
# CHECK: Resource pressure per iteration:
48+
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8]
49+
# CHECK-NEXT: 26.00 65.00 - 2.00 - - - - -
50+
51+
# CHECK: Resource pressure by instruction:
52+
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] Instructions:
53+
# CHECK-NEXT: - 65.00 - 1.00 - - - - - div a0, a1, a2
54+
# CHECK-NEXT: 26.00 - - 1.00 - - - - - fdiv.s ft1, ft2, ft3
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
2+
# RUN: llvm-mca -mtriple=riscv64 -mcpu=sifive-x390 -instruction-tables=full -iterations=1 < %s | FileCheck %s
3+
4+
# TODO: This test should be replaced by an exhaustive test of legal (LMUL, SEW)
5+
# pairs for all instructions in the Vector Integer Arithmetic chapter of the RVV
6+
# SPEC.
7+
vsetvli zero, zero, e32, mf2, tu, mu
8+
vdiv.vv v12, v12, v12
9+
vsetvli zero, zero, e8, mf8, tu, mu
10+
vdiv.vv v12, v12, v12
11+
12+
# CHECK: Resources:
13+
# CHECK-NEXT: [0] - VLEN1024X300SiFive7FDiv:1
14+
# CHECK-NEXT: [1] - VLEN1024X300SiFive7IDiv:1
15+
# CHECK-NEXT: [2] - VLEN1024X300SiFive7PipeA:1
16+
# CHECK-NEXT: [3] - VLEN1024X300SiFive7PipeAB:2 VLEN1024X300SiFive7PipeA, VLEN1024X300SiFive7PipeB
17+
# CHECK-NEXT: [4] - VLEN1024X300SiFive7PipeB:1
18+
# CHECK-NEXT: [5] - VLEN1024X300SiFive7VA1:1
19+
# CHECK-NEXT: [6] - VLEN1024X300SiFive7VA1OrVA2:2 VLEN1024X300SiFive7VA1, VLEN1024X300SiFive7VA2
20+
# CHECK-NEXT: [7] - VLEN1024X300SiFive7VA2:1
21+
# CHECK-NEXT: [8] - VLEN1024X300SiFive7VCQ:1
22+
# CHECK-NEXT: [9] - VLEN1024X300SiFive7VL:1
23+
# CHECK-NEXT: [10] - VLEN1024X300SiFive7VS:1
24+
25+
# CHECK: Instruction Info:
26+
# CHECK-NEXT: [1]: #uOps
27+
# CHECK-NEXT: [2]: Latency
28+
# CHECK-NEXT: [3]: RThroughput
29+
# CHECK-NEXT: [4]: MayLoad
30+
# CHECK-NEXT: [5]: MayStore
31+
# CHECK-NEXT: [6]: HasSideEffects (U)
32+
# CHECK-NEXT: [7]: Bypass Latency
33+
# CHECK-NEXT: [8]: Resources (<Name> | <Name>[<ReleaseAtCycle>] | <Name>[<AcquireAtCycle>,<ReleaseAtCycle])
34+
# CHECK-NEXT: [9]: LLVM Opcode Name
35+
36+
# CHECK: [1] [2] [3] [4] [5] [6] [7] [8] [9] Instructions:
37+
# CHECK-NEXT: 1 3 1.00 U 1 VLEN1024X300SiFive7PipeA,VLEN1024X300SiFive7PipeAB VSETVLI vsetvli zero, zero, e32, mf2, tu, mu
38+
# CHECK-NEXT: 1 112 112.00 112 VLEN1024X300SiFive7VA1[1,113],VLEN1024X300SiFive7VA1OrVA2[1,113],VLEN1024X300SiFive7VCQ VDIV_VV vdiv.vv v12, v12, v12
39+
# CHECK-NEXT: 1 3 1.00 U 1 VLEN1024X300SiFive7PipeA,VLEN1024X300SiFive7PipeAB VSETVLI vsetvli zero, zero, e8, mf8, tu, mu
40+
# CHECK-NEXT: 1 60 60.00 60 VLEN1024X300SiFive7VA1[1,61],VLEN1024X300SiFive7VA1OrVA2[1,61],VLEN1024X300SiFive7VCQ VDIV_VV vdiv.vv v12, v12, v12
41+
42+
# CHECK: Resources:
43+
# CHECK-NEXT: [0] - VLEN1024X300SiFive7FDiv
44+
# CHECK-NEXT: [1] - VLEN1024X300SiFive7IDiv
45+
# CHECK-NEXT: [2] - VLEN1024X300SiFive7PipeA
46+
# CHECK-NEXT: [3] - VLEN1024X300SiFive7PipeB
47+
# CHECK-NEXT: [4] - VLEN1024X300SiFive7VA1
48+
# CHECK-NEXT: [5] - VLEN1024X300SiFive7VA2
49+
# CHECK-NEXT: [6] - VLEN1024X300SiFive7VCQ
50+
# CHECK-NEXT: [7] - VLEN1024X300SiFive7VL
51+
# CHECK-NEXT: [8] - VLEN1024X300SiFive7VS
52+
53+
# CHECK: Resource pressure per iteration:
54+
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8]
55+
# CHECK-NEXT: - - 2.00 - 174.00 - 2.00 - -
56+
57+
# CHECK: Resource pressure by instruction:
58+
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] Instructions:
59+
# CHECK-NEXT: - - 1.00 - - - - - - vsetvli zero, zero, e32, mf2, tu, mu
60+
# CHECK-NEXT: - - - - 113.00 - 1.00 - - vdiv.vv v12, v12, v12
61+
# CHECK-NEXT: - - 1.00 - - - - - - vsetvli zero, zero, e8, mf8, tu, mu
62+
# CHECK-NEXT: - - - - 61.00 - 1.00 - - vdiv.vv v12, v12, v12

0 commit comments

Comments
 (0)