Skip to content

Commit dccb1fe

Browse files
authored
[RISCV] Update latency of MUL & CPOP in SiFive P600's scheduling model (#115042)
It should be 2 cycles rather than 3 cycles.
1 parent 823625c commit dccb1fe

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

llvm/lib/Target/RISCV/RISCVSchedSiFiveP600.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def P600WriteCMOV : SchedWriteRes<[SiFiveP600Branch, SiFiveP600CMOV]> {
119119
}
120120
def : InstRW<[P600WriteCMOV], (instrs PseudoCCMOVGPRNoX0)>;
121121

122-
let Latency = 3 in {
122+
let Latency = 2 in {
123123
// Integer multiplication
124124
def : WriteRes<WriteIMul, [SiFiveP600MulI2F]>;
125125
def : WriteRes<WriteIMul32, [SiFiveP600MulI2F]>;
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# NOTE: Assertions have been autogenerated by utils/update_mca_test_checks.py
2+
# RUN: llvm-mca -mtriple=riscv64 -mcpu=sifive-p670 -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: 4
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] - SiFiveP600Div
38+
# CHECK-NEXT: [1] - SiFiveP600FEXQ0
39+
# CHECK-NEXT: [2] - SiFiveP600FEXQ1
40+
# CHECK-NEXT: [3] - SiFiveP600FloatDiv
41+
# CHECK-NEXT: [4] - SiFiveP600IEXQ0
42+
# CHECK-NEXT: [5] - SiFiveP600IEXQ1
43+
# CHECK-NEXT: [6] - SiFiveP600IEXQ2
44+
# CHECK-NEXT: [7] - SiFiveP600IEXQ3
45+
# CHECK-NEXT: [8.0] - SiFiveP600LDST
46+
# CHECK-NEXT: [8.1] - SiFiveP600LDST
47+
# CHECK-NEXT: [9] - SiFiveP600VDiv
48+
# CHECK-NEXT: [10] - SiFiveP600VEXQ0
49+
# CHECK-NEXT: [11] - SiFiveP600VEXQ1
50+
# CHECK-NEXT: [12] - SiFiveP600VFloatDiv
51+
# CHECK-NEXT: [13] - SiFiveP600VLD
52+
# CHECK-NEXT: [14] - SiFiveP600VST
53+
54+
# CHECK: Resource pressure per iteration:
55+
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8.0] [8.1] [9] [10] [11] [12] [13] [14]
56+
# CHECK-NEXT: - - - - - 4.00 - - - - - - - - - -
57+
58+
# CHECK: Resource pressure by instruction:
59+
# CHECK-NEXT: [0] [1] [2] [3] [4] [5] [6] [7] [8.0] [8.1] [9] [10] [11] [12] [13] [14] Instructions:
60+
# CHECK-NEXT: - - - - - 1.00 - - - - - - - - - - mul s6, s6, s7
61+
# CHECK-NEXT: - - - - - 1.00 - - - - - - - - - - mulw s4, s4, a2
62+
# CHECK-NEXT: - - - - - 1.00 - - - - - - - - - - cpop t1, t1
63+
# CHECK-NEXT: - - - - - 1.00 - - - - - - - - - - cpopw t2, t2

0 commit comments

Comments
 (0)