Skip to content

Commit 4a2bec5

Browse files
committed
Added test.
1 parent dad5db6 commit 4a2bec5

File tree

2 files changed

+160
-1
lines changed

2 files changed

+160
-1
lines changed

llvm/lib/Target/RISCV/RISCVProcessors.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def VENTANA_VEYRON_V1 : RISCVProcessorModel<"veyron-v1",
254254
FeatureStdExtZicbop,
255255
FeatureStdExtZicboz,
256256
FeatureVendorXVentanaCondOps],
257-
[TuneVentanaVeyron]>;
257+
[TuneVeyronFusions]>;
258258

259259
def XIANGSHAN_NANHU : RISCVProcessorModel<"xiangshan-nanhu",
260260
NoSchedModel,
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# REQUIRES: asserts
2+
# RUN: llc -mtriple=riscv64-linux-gnu -mcpu=veyron-v1 -x=mir < %s \
3+
# RUN: -debug-only=machine-scheduler -start-before=machine-scheduler 2>&1 \
4+
# RUN: -mattr=+lui-addi-fusion,+auipc-addi-fusion,+slli-srli-fusion,+ld-add-fusion \
5+
# RUN: | FileCheck %s
6+
7+
# CHECK: lui_addi:%bb.0
8+
# CHECK: Macro fuse: {{.*}}LUI - ADDI
9+
---
10+
name: lui_addi
11+
tracksRegLiveness: true
12+
body: |
13+
bb.0.entry:
14+
liveins: $x10
15+
%1:gpr = COPY $x10
16+
%2:gpr = LUI 1
17+
%3:gpr = ADDI %1, 2
18+
%4:gpr = ADDI %2, 3
19+
$x10 = COPY %3
20+
$x11 = COPY %4
21+
PseudoRET
22+
...
23+
24+
# CHECK: auipc_addi
25+
# CHECK: Macro fuse: {{.*}}AUIPC - ADDI
26+
---
27+
name: auipc_addi
28+
tracksRegLiveness: true
29+
body: |
30+
bb.0.entry:
31+
liveins: $x10
32+
%1:gpr = COPY $x10
33+
%2:gpr = AUIPC 1
34+
%3:gpr = ADDI %1, 2
35+
%4:gpr = ADDI %2, 3
36+
$x10 = COPY %3
37+
$x11 = COPY %4
38+
PseudoRET
39+
...
40+
41+
# CHECK: slli_srli
42+
# CHECK: Macro fuse: {{.*}}SLLI - SRLI
43+
---
44+
name: slli_srli
45+
tracksRegLiveness: true
46+
body: |
47+
bb.0.entry:
48+
liveins: $x10
49+
%1:gpr = COPY $x10
50+
%2:gpr = SLLI %1, 32
51+
%3:gpr = ADDI %1, 3
52+
%4:gpr = SRLI %2, 4
53+
$x10 = COPY %3
54+
$x11 = COPY %4
55+
PseudoRET
56+
...
57+
58+
# CHECK: slli_srli_48
59+
# CHECK: Macro fuse: {{.*}}SLLI - SRLI
60+
---
61+
name: slli_srli_48
62+
tracksRegLiveness: true
63+
body: |
64+
bb.0.entry:
65+
liveins: $x10
66+
%1:gpr = COPY $x10
67+
%2:gpr = SLLI %1, 48
68+
%3:gpr = ADDI %1, 3
69+
%4:gpr = SRLI %2, 48
70+
$x10 = COPY %3
71+
$x11 = COPY %4
72+
PseudoRET
73+
...
74+
75+
# CHECK: slli_srli_no_fusion_0
76+
# CHECK-NOT: Macro fuse: {{.*}}SLLI - SRLI
77+
---
78+
name: slli_srli_no_fusion_0
79+
tracksRegLiveness: true
80+
body: |
81+
bb.0.entry:
82+
liveins: $x10
83+
%1:gpr = COPY $x10
84+
%2:gpr = SLLI %1, 32
85+
%3:gpr = ADDI %1, 3
86+
%4:gpr = SRLI %2, 33
87+
$x10 = COPY %3
88+
$x11 = COPY %4
89+
PseudoRET
90+
...
91+
92+
# CHECK: slli_srli_no_fusion_1
93+
# CHECK-NOT: Macro fuse: {{.*}}SLLI - SRLI
94+
---
95+
name: slli_srli_no_fusion_1
96+
tracksRegLiveness: true
97+
body: |
98+
bb.0.entry:
99+
liveins: $x10
100+
%1:gpr = COPY $x10
101+
%2:gpr = SLLI %1, 48
102+
%3:gpr = ADDI %1, 3
103+
%4:gpr = SRLI %2, 4
104+
$x10 = COPY %3
105+
$x11 = COPY %4
106+
PseudoRET
107+
...
108+
109+
# CHECK: slli_srli_no_fusion_2
110+
# CHECK-NOT: Macro fuse: {{.*}}SLLI - SRLI
111+
---
112+
name: slli_srli_no_fusion_2
113+
tracksRegLiveness: true
114+
body: |
115+
bb.0.entry:
116+
liveins: $x10
117+
%1:gpr = COPY $x10
118+
%2:gpr = SLLI %1, 31
119+
%3:gpr = ADDI %1, 3
120+
%4:gpr = SRLI %2, 4
121+
$x10 = COPY %3
122+
$x11 = COPY %4
123+
PseudoRET
124+
...
125+
126+
# CHECK: slli_srli_no_fusion_3
127+
# CHECK-NOT: Macro fuse: {{.*}}SLLI - SRLI
128+
---
129+
name: slli_srli_no_fusion_3
130+
tracksRegLiveness: true
131+
body: |
132+
bb.0.entry:
133+
liveins: $x10
134+
%1:gpr = COPY $x10
135+
%2:gpr = SLLI %1, 31
136+
%3:gpr = ADDI %1, 3
137+
%4:gpr = SRLI %2, 48
138+
$x10 = COPY %3
139+
$x11 = COPY %4
140+
PseudoRET
141+
...
142+
143+
# CHECK: ld_add
144+
# CHECK: Macro fuse: {{.*}}ADD - LD
145+
---
146+
name: ld_add
147+
tracksRegLiveness: true
148+
body: |
149+
bb.0.entry:
150+
liveins: $x10, $x11
151+
%1:gpr = COPY $x10
152+
%2:gpr = COPY $x11
153+
%3:gpr = ADD %1, %2
154+
%4:gpr = ADDI %2, 3
155+
%5:gpr = LD %3, 0
156+
$x10 = COPY %4
157+
$x11 = COPY %5
158+
PseudoRET
159+
...

0 commit comments

Comments
 (0)