1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 4
2 # RUN: llc %s -mtriple=riscv64 -run-pass=riscv-opt-w-instrs -verify-machineinstrs \
3 # RUN: -mattr=+m -o - | FileCheck %s -check-prefixes=NO-PREFER-W-INST
4 # RUN: llc %s -mtriple=riscv64 -run-pass=riscv-opt-w-instrs -verify-machineinstrs \
5 # RUN: -mattr=+m,+prefer-w-inst -o - | FileCheck %s -check-prefixes=PREFER-W-INST
12 ; NO-PREFER-W-INST-LABEL: name: addi
13 ; NO-PREFER-W-INST: liveins: $x10, $x11
14 ; NO-PREFER-W-INST-NEXT: {{ $}}
15 ; NO-PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
16 ; NO-PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
17 ; NO-PREFER-W-INST-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI [[COPY]], 1
18 ; NO-PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[ADDI]], 1
19 ; NO-PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
20 ; NO-PREFER-W-INST-NEXT: PseudoRET
22 ; PREFER-W-INST-LABEL: name: addi
23 ; PREFER-W-INST: liveins: $x10, $x11
24 ; PREFER-W-INST-NEXT: {{ $}}
25 ; PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
26 ; PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
27 ; PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[COPY]], 1
28 ; PREFER-W-INST-NEXT: [[ADDIW1:%[0-9]+]]:gpr = ADDIW [[ADDIW]], 1
29 ; PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW1]]
30 ; PREFER-W-INST-NEXT: PseudoRET
44 ; NO-PREFER-W-INST-LABEL: name: add
45 ; NO-PREFER-W-INST: liveins: $x10, $x11
46 ; NO-PREFER-W-INST-NEXT: {{ $}}
47 ; NO-PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
48 ; NO-PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
49 ; NO-PREFER-W-INST-NEXT: [[ADD:%[0-9]+]]:gpr = ADD [[COPY]], [[COPY1]]
50 ; NO-PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[ADD]], 1
51 ; NO-PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
52 ; NO-PREFER-W-INST-NEXT: PseudoRET
54 ; PREFER-W-INST-LABEL: name: add
55 ; PREFER-W-INST: liveins: $x10, $x11
56 ; PREFER-W-INST-NEXT: {{ $}}
57 ; PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
58 ; PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
59 ; PREFER-W-INST-NEXT: [[ADDW:%[0-9]+]]:gpr = ADDW [[COPY]], [[COPY1]]
60 ; PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[ADDW]], 1
61 ; PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
62 ; PREFER-W-INST-NEXT: PseudoRET
76 ; NO-PREFER-W-INST-LABEL: name: sub
77 ; NO-PREFER-W-INST: liveins: $x10, $x11
78 ; NO-PREFER-W-INST-NEXT: {{ $}}
79 ; NO-PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
80 ; NO-PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
81 ; NO-PREFER-W-INST-NEXT: [[SUB:%[0-9]+]]:gpr = SUB [[COPY]], [[COPY1]]
82 ; NO-PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[SUB]], 1
83 ; NO-PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
84 ; NO-PREFER-W-INST-NEXT: PseudoRET
86 ; PREFER-W-INST-LABEL: name: sub
87 ; PREFER-W-INST: liveins: $x10, $x11
88 ; PREFER-W-INST-NEXT: {{ $}}
89 ; PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
90 ; PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
91 ; PREFER-W-INST-NEXT: [[SUBW:%[0-9]+]]:gpr = SUBW [[COPY]], [[COPY1]]
92 ; PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[SUBW]], 1
93 ; PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
94 ; PREFER-W-INST-NEXT: PseudoRET
108 ; NO-PREFER-W-INST-LABEL: name: mul
109 ; NO-PREFER-W-INST: liveins: $x10, $x11
110 ; NO-PREFER-W-INST-NEXT: {{ $}}
111 ; NO-PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
112 ; NO-PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
113 ; NO-PREFER-W-INST-NEXT: [[MUL:%[0-9]+]]:gpr = MUL [[COPY]], [[COPY1]]
114 ; NO-PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[MUL]], 1
115 ; NO-PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
116 ; NO-PREFER-W-INST-NEXT: PseudoRET
118 ; PREFER-W-INST-LABEL: name: mul
119 ; PREFER-W-INST: liveins: $x10, $x11
120 ; PREFER-W-INST-NEXT: {{ $}}
121 ; PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
122 ; PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
123 ; PREFER-W-INST-NEXT: [[MULW:%[0-9]+]]:gpr = MULW [[COPY]], [[COPY1]]
124 ; PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[MULW]], 1
125 ; PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
126 ; PREFER-W-INST-NEXT: PseudoRET
141 ; NO-PREFER-W-INST-LABEL: name: slli_31
142 ; NO-PREFER-W-INST: liveins: $x10, $x11
143 ; NO-PREFER-W-INST-NEXT: {{ $}}
144 ; NO-PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
145 ; NO-PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
146 ; NO-PREFER-W-INST-NEXT: [[SLLI:%[0-9]+]]:gpr = SLLI [[COPY]], 31
147 ; NO-PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[SLLI]], 1
148 ; NO-PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
149 ; NO-PREFER-W-INST-NEXT: PseudoRET
151 ; PREFER-W-INST-LABEL: name: slli_31
152 ; PREFER-W-INST: liveins: $x10, $x11
153 ; PREFER-W-INST-NEXT: {{ $}}
154 ; PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
155 ; PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
156 ; PREFER-W-INST-NEXT: [[SLLIW:%[0-9]+]]:gpr = SLLIW [[COPY]], 31
157 ; PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[SLLIW]], 1
158 ; PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
159 ; PREFER-W-INST-NEXT: PseudoRET
173 ; NO-PREFER-W-INST-LABEL: name: slli_32
174 ; NO-PREFER-W-INST: liveins: $x10, $x11
175 ; NO-PREFER-W-INST-NEXT: {{ $}}
176 ; NO-PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
177 ; NO-PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
178 ; NO-PREFER-W-INST-NEXT: [[SLLI:%[0-9]+]]:gpr = SLLI [[COPY]], 32
179 ; NO-PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[SLLI]], 1
180 ; NO-PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
181 ; NO-PREFER-W-INST-NEXT: PseudoRET
183 ; PREFER-W-INST-LABEL: name: slli_32
184 ; PREFER-W-INST: liveins: $x10, $x11
185 ; PREFER-W-INST-NEXT: {{ $}}
186 ; PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
187 ; PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
188 ; PREFER-W-INST-NEXT: [[SLLI:%[0-9]+]]:gpr = SLLI [[COPY]], 32
189 ; PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[SLLI]], 1
190 ; PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
191 ; PREFER-W-INST-NEXT: PseudoRET
205 ; NO-PREFER-W-INST-LABEL: name: ld
206 ; NO-PREFER-W-INST: liveins: $x10, $x11
207 ; NO-PREFER-W-INST-NEXT: {{ $}}
208 ; NO-PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
209 ; NO-PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
210 ; NO-PREFER-W-INST-NEXT: [[LD:%[0-9]+]]:gpr = LD [[COPY]], 0
211 ; NO-PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[LD]], 1
212 ; NO-PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
213 ; NO-PREFER-W-INST-NEXT: PseudoRET
215 ; PREFER-W-INST-LABEL: name: ld
216 ; PREFER-W-INST: liveins: $x10, $x11
217 ; PREFER-W-INST-NEXT: {{ $}}
218 ; PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
219 ; PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
220 ; PREFER-W-INST-NEXT: [[LW:%[0-9]+]]:gpr = LW [[COPY]], 0
221 ; PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[LW]], 1
222 ; PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
223 ; PREFER-W-INST-NEXT: PseudoRET
237 ; NO-PREFER-W-INST-LABEL: name: lwu
238 ; NO-PREFER-W-INST: liveins: $x10, $x11
239 ; NO-PREFER-W-INST-NEXT: {{ $}}
240 ; NO-PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
241 ; NO-PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
242 ; NO-PREFER-W-INST-NEXT: [[LWU:%[0-9]+]]:gpr = LWU [[COPY]], 0
243 ; NO-PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[LWU]], 1
244 ; NO-PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
245 ; NO-PREFER-W-INST-NEXT: PseudoRET
247 ; PREFER-W-INST-LABEL: name: lwu
248 ; PREFER-W-INST: liveins: $x10, $x11
249 ; PREFER-W-INST-NEXT: {{ $}}
250 ; PREFER-W-INST-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
251 ; PREFER-W-INST-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
252 ; PREFER-W-INST-NEXT: [[LW:%[0-9]+]]:gpr = LW [[COPY]], 0
253 ; PREFER-W-INST-NEXT: [[ADDIW:%[0-9]+]]:gpr = ADDIW [[LW]], 1
254 ; PREFER-W-INST-NEXT: $x10 = COPY [[ADDIW]]
255 ; PREFER-W-INST-NEXT: PseudoRET