1 ; RUN: opt -instsimplify -S < %s | FileCheck %s
7 %r = mul i64 undef, undef
12 ; CHECK-LABEL: @test1(
13 ; CHECK: ret i64 undef
20 ; CHECK-LABEL: @test2(
21 ; CHECK: ret i64 undef
28 ; CHECK-LABEL: @test3(
36 ; CHECK-LABEL: @test4(
44 ; CHECK-LABEL: @test5(
45 ; CHECK: ret i64 undef
47 %r = and i64 undef, undef
52 ; CHECK-LABEL: @test6(
53 ; CHECK: ret i64 undef
55 %r = or i64 undef, undef
60 ; CHECK-LABEL: @test7(
61 ; CHECK: ret i64 undef
63 %r = udiv i64 undef, 1
68 ; CHECK-LABEL: @test8(
69 ; CHECK: ret i64 undef
71 %r = sdiv i64 undef, 1
76 ; CHECK-LABEL: @test9(
79 %r = urem i64 undef, 1
83 define i64 @test10() {
84 ; CHECK-LABEL: @test10(
87 %r = srem i64 undef, 1
91 define i64 @test11() {
92 ; CHECK-LABEL: @test11(
93 ; CHECK: ret i64 undef
95 %r = shl i64 undef, undef
99 define i64 @test11b(i64 %a) {
100 ; CHECK-LABEL: @test11b(
101 ; CHECK: ret i64 undef
103 %r = shl i64 %a, undef
107 define i64 @test12() {
108 ; CHECK-LABEL: @test12(
109 ; CHECK: ret i64 undef
111 %r = ashr i64 undef, undef
115 define i64 @test12b(i64 %a) {
116 ; CHECK-LABEL: @test12b(
117 ; CHECK: ret i64 undef
119 %r = ashr i64 %a, undef
123 define i64 @test13() {
124 ; CHECK-LABEL: @test13(
125 ; CHECK: ret i64 undef
127 %r = lshr i64 undef, undef
131 define i64 @test13b(i64 %a) {
132 ; CHECK-LABEL: @test13b(
133 ; CHECK: ret i64 undef
135 %r = lshr i64 %a, undef
139 define i1 @test14() {
140 ; CHECK-LABEL: @test14(
141 ; CHECK: ret i1 undef
143 %r = icmp slt i64 undef, undef
147 define i1 @test15() {
148 ; CHECK-LABEL: @test15(
149 ; CHECK: ret i1 undef
151 %r = icmp ult i64 undef, undef
155 define i64 @test16(i64 %a) {
156 ; CHECK-LABEL: @test16(
157 ; CHECK: ret i64 undef
159 %r = select i1 undef, i64 %a, i64 undef
163 define i64 @test17(i64 %a) {
164 ; CHECK-LABEL: @test17(
165 ; CHECK: ret i64 undef
167 %r = select i1 undef, i64 undef, i64 %a
171 define i64 @test18(i64 %a) {
172 ; CHECK-LABEL: @test18(
173 ; CHECK: [[R:%.*]] = call i64 undef(i64 %a)
174 ; CHECK-NEXT: ret i64 undef
176 %r = call i64 (i64) undef(i64 %a)
180 define <4 x i8> @test19(<4 x i8> %a) {
181 ; CHECK-LABEL: @test19(
182 ; CHECK: ret <4 x i8> undef
184 %b = shl <4 x i8> %a, <i8 8, i8 9, i8 undef, i8 -1>
188 define i32 @test20(i32 %a) {
189 ; CHECK-LABEL: @test20(
190 ; CHECK: ret i32 undef
196 define <2 x i32> @test20vec(<2 x i32> %a) {
197 ; CHECK-LABEL: @test20vec(
198 ; CHECK-NEXT: ret <2 x i32> undef
200 %b = udiv <2 x i32> %a, zeroinitializer
204 define i32 @test21(i32 %a) {
205 ; CHECK-LABEL: @test21(
206 ; CHECK: ret i32 undef
212 define <2 x i32> @test21vec(<2 x i32> %a) {
213 ; CHECK-LABEL: @test21vec(
214 ; CHECK-NEXT: ret <2 x i32> undef
216 %b = sdiv <2 x i32> %a, zeroinitializer
220 define i32 @test22(i32 %a) {
221 ; CHECK-LABEL: @test22(
222 ; CHECK: ret i32 undef
224 %b = ashr exact i32 undef, %a
228 define i32 @test23(i32 %a) {
229 ; CHECK-LABEL: @test23(
230 ; CHECK: ret i32 undef
232 %b = lshr exact i32 undef, %a
236 define i32 @test24() {
237 ; CHECK-LABEL: @test24(
238 ; CHECK: ret i32 undef
240 %b = udiv i32 undef, 0
244 define i32 @test25() {
245 ; CHECK-LABEL: @test25(
246 ; CHECK: ret i32 undef
248 %b = lshr i32 0, undef
252 define i32 @test26() {
253 ; CHECK-LABEL: @test26(
254 ; CHECK: ret i32 undef
256 %b = ashr i32 0, undef
260 define i32 @test27() {
261 ; CHECK-LABEL: @test27(
262 ; CHECK: ret i32 undef
264 %b = shl i32 0, undef
268 define i32 @test28(i32 %a) {
269 ; CHECK-LABEL: @test28(
270 ; CHECK: ret i32 undef
272 %b = shl nsw i32 undef, %a
276 define i32 @test29(i32 %a) {
277 ; CHECK-LABEL: @test29(
278 ; CHECK: ret i32 undef
280 %b = shl nuw i32 undef, %a
284 define i32 @test30(i32 %a) {
285 ; CHECK-LABEL: @test30(
286 ; CHECK: ret i32 undef
288 %b = shl nsw nuw i32 undef, %a
292 define i32 @test31(i32 %a) {
293 ; CHECK-LABEL: @test31(
296 %b = shl i32 undef, %a
300 define i32 @test32(i32 %a) {
301 ; CHECK-LABEL: @test32(
302 ; CHECK: ret i32 undef
304 %b = shl i32 undef, 0
308 define i32 @test33(i32 %a) {
309 ; CHECK-LABEL: @test33(
310 ; CHECK: ret i32 undef
312 %b = ashr i32 undef, 0
316 define i32 @test34(i32 %a) {
317 ; CHECK-LABEL: @test34(
318 ; CHECK: ret i32 undef
320 %b = lshr i32 undef, 0
324 define i32 @test35(<4 x i32> %V) {
325 ; CHECK-LABEL: @test35(
326 ; CHECK: ret i32 undef
328 %b = extractelement <4 x i32> %V, i32 4
332 define i32 @test36(i32 %V) {
333 ; CHECK-LABEL: @test36(
334 ; CHECK: ret i32 undef
336 %b = extractelement <4 x i32> undef, i32 %V
340 define i32 @test37() {
341 ; CHECK-LABEL: @test37(
342 ; CHECK: ret i32 undef
344 %b = udiv i32 undef, undef
348 define i32 @test38(i32 %a) {
349 ; CHECK-LABEL: @test38(
350 ; CHECK: ret i32 undef
352 %b = udiv i32 %a, undef
356 define i32 @test39() {
357 ; CHECK-LABEL: @test39(
358 ; CHECK: ret i32 undef
360 %b = udiv i32 0, undef