Skip to content

Commit 90d79ca

Browse files
authored
[RISCV] Update the latencies of MUL and CPOP in SiFive P400 scheduling model (llvm#122007)
According to llvm-exegesis, they should have around 2 cycles of latency on P400 cores.
1 parent 142787d commit 90d79ca

File tree

2 files changed

+61
-1
lines changed

2 files changed

+61
-1
lines changed

llvm/lib/Target/RISCV/RISCVSchedSiFiveP400.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def P400WriteCMOV : SchedWriteRes<[SiFiveP400Branch, SiFiveP400IEXQ1]> {
182182
}
183183
def : InstRW<[P400WriteCMOV], (instrs PseudoCCMOVGPRNoX0)>;
184184

185-
let Latency = 3 in {
185+
let Latency = 2 in {
186186
// Integer multiplication
187187
def : WriteRes<WriteIMul, [SiFiveP400MulDiv]>;
188188
def : WriteRes<WriteIMul32, [SiFiveP400MulDiv]>;
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
2+
# RUN: llvm-mca -mtriple=riscv64 -mcpu=sifive-p470 -iterations=1 < %s | FileCheck %s
3+
4+
mul s6, s6, s7
5+
6+
mulw s4, s4, a2
7+
8+
cpop t1, t1
9+
10+
cpopw t2, t2
11+
12+
# CHECK: Iterations: 1
13+
# CHECK-NEXT: Instructions: 4
14+
# CHECK-NEXT: Total Cycles: 8
15+
# CHECK-NEXT: Total uOps: 4
16+
17+
# CHECK: Dispatch Width: 3
18+
# CHECK-NEXT: uOps Per Cycle: 0.50
19+
# CHECK-NEXT: IPC: 0.50
20+
# CHECK-NEXT: Block RThroughput: 4.0
21+
22+
# CHECK: Instruction Info:
23+
# CHECK-NEXT: [1]: #uOps
24+
# CHECK-NEXT: [2]: Latency
25+
# CHECK-NEXT: [3]: RThroughput
26+
# CHECK-NEXT: [4]: MayLoad
27+
# CHECK-NEXT: [5]: MayStore
28+
# CHECK-NEXT: [6]: HasSideEffects (U)
29+
30+
# CHECK: [1] [2] [3] [4] [5] [6] Instructions:
31+
# CHECK-NEXT: 1 2 1.00 mul s6, s6, s7
32+
# CHECK-NEXT: 1 2 1.00 mulw s4, s4, a2
33+
# CHECK-NEXT: 1 2 1.00 cpop t1, t1
34+
# CHECK-NEXT: 1 2 1.00 cpopw t2, t2
35+
36+
# CHECK: Resources:
37+
# CHECK-NEXT: [0] - SiFiveP400Div
38+
# CHECK-NEXT: [1] - SiFiveP400FEXQ0
39+
# CHECK-NEXT: [2] - SiFiveP400FloatDiv
40+
# CHECK-NEXT: [3] - SiFiveP400IEXQ0
41+
# CHECK-NEXT: [4] - SiFiveP400IEXQ1
42+
# CHECK-NEXT: [5] - SiFiveP400IEXQ2
43+
# CHECK-NEXT: [6] - SiFiveP400Load
44+
# CHECK-NEXT: [7] - SiFiveP400Store
45+
# CHECK-NEXT: [8] - SiFiveP400VDiv
46+
# CHECK-NEXT: [9] - SiFiveP400VEXQ0
47+
# CHECK-NEXT: [10] - SiFiveP400VFloatDiv
48+
# CHECK-NEXT: [11] - SiFiveP400VLD
49+
# CHECK-NEXT: [12] - SiFiveP400VST
50+
51+
# CHECK: Resource pressure per iteration:
52+
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
53+
# CHECK-NEXT: - - - - - 4.00 - - - - - - -
54+
55+
# CHECK: Resource pressure by instruction:
56+
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] Instructions:
57+
# CHECK-NEXT: - - - - - 1.00 - - - - - - - mul s6, s6, s7
58+
# CHECK-NEXT: - - - - - 1.00 - - - - - - - mulw s4, s4, a2
59+
# CHECK-NEXT: - - - - - 1.00 - - - - - - - cpop t1, t1
60+
# CHECK-NEXT: - - - - - 1.00 - - - - - - - cpopw t2, t2

0 commit comments

Comments
 (0)