1 ; RUN: opt -instsimplify -S < %s | FileCheck %s
6 %r = mul i64 undef, undef
11 ; CHECK: ret i64 undef
18 ; CHECK: ret i64 undef
39 ; CHECK: ret i64 undef
41 %r = and i64 undef, undef
46 ; CHECK: ret i64 undef
48 %r = or i64 undef, undef
53 ; CHECK: ret i64 undef
55 %r = udiv i64 undef, 1
60 ; CHECK: ret i64 undef
62 %r = sdiv i64 undef, 1
69 %r = urem i64 undef, 1
75 define i64 @test10() {
76 %r = srem i64 undef, 1
81 ; CHECK: ret i64 undef
82 define i64 @test11() {
83 %r = shl i64 undef, undef
88 ; CHECK: ret i64 undef
89 define i64 @test11b(i64 %a) {
90 %r = shl i64 %a, undef
95 ; CHECK: ret i64 undef
96 define i64 @test12() {
97 %r = ashr i64 undef, undef
102 ; CHECK: ret i64 undef
103 define i64 @test12b(i64 %a) {
104 %r = ashr i64 %a, undef
109 ; CHECK: ret i64 undef
110 define i64 @test13() {
111 %r = lshr i64 undef, undef
116 ; CHECK: ret i64 undef
117 define i64 @test13b(i64 %a) {
118 %r = lshr i64 %a, undef
123 ; CHECK: ret i1 undef
124 define i1 @test14() {
125 %r = icmp slt i64 undef, undef
130 ; CHECK: ret i1 undef
131 define i1 @test15() {
132 %r = icmp ult i64 undef, undef
137 ; CHECK: ret i64 undef
138 define i64 @test16(i64 %a) {
139 %r = select i1 undef, i64 %a, i64 undef
144 ; CHECK: ret i64 undef
145 define i64 @test17(i64 %a) {
146 %r = select i1 undef, i64 undef, i64 %a
151 ; CHECK: ret i64 undef
152 define i64 @test18(i64 %a) {
153 %r = call i64 (i64) undef(i64 %a)
157 ; CHECK-LABEL: @test19
158 ; CHECK: ret <4 x i8> undef
159 define <4 x i8> @test19(<4 x i8> %a) {
160 %b = shl <4 x i8> %a, <i8 8, i8 9, i8 undef, i8 -1>
164 ; CHECK-LABEL: @test20
165 ; CHECK: ret i32 undef
166 define i32 @test20(i32 %a) {
171 ; CHECK-LABEL: @test21
172 ; CHECK: ret i32 undef
173 define i32 @test21(i32 %a) {
178 ; CHECK-LABEL: @test22
179 ; CHECK: ret i32 undef
180 define i32 @test22(i32 %a) {
181 %b = ashr exact i32 undef, %a
185 ; CHECK-LABEL: @test23
186 ; CHECK: ret i32 undef
187 define i32 @test23(i32 %a) {
188 %b = lshr exact i32 undef, %a
192 ; CHECK-LABEL: @test24
193 ; CHECK: ret i32 undef
194 define i32 @test24() {
195 %b = udiv i32 undef, 0
199 ; CHECK-LABEL: @test25
200 ; CHECK: ret i32 undef
201 define i32 @test25() {
202 %b = lshr i32 0, undef
206 ; CHECK-LABEL: @test26
207 ; CHECK: ret i32 undef
208 define i32 @test26() {
209 %b = ashr i32 0, undef
213 ; CHECK-LABEL: @test27
214 ; CHECK: ret i32 undef
215 define i32 @test27() {
216 %b = shl i32 0, undef
220 ; CHECK-LABEL: @test28
221 ; CHECK: ret i32 undef
222 define i32 @test28(i32 %a) {
223 %b = shl nsw i32 undef, %a
227 ; CHECK-LABEL: @test29
228 ; CHECK: ret i32 undef
229 define i32 @test29(i32 %a) {
230 %b = shl nuw i32 undef, %a
234 ; CHECK-LABEL: @test30
235 ; CHECK: ret i32 undef
236 define i32 @test30(i32 %a) {
237 %b = shl nsw nuw i32 undef, %a
241 ; CHECK-LABEL: @test31
243 define i32 @test31(i32 %a) {
244 %b = shl i32 undef, %a
248 ; CHECK-LABEL: @test32
249 ; CHECK: ret i32 undef
250 define i32 @test32(i32 %a) {
251 %b = shl i32 undef, 0
255 ; CHECK-LABEL: @test33
256 ; CHECK: ret i32 undef
257 define i32 @test33(i32 %a) {
258 %b = ashr i32 undef, 0
262 ; CHECK-LABEL: @test34
263 ; CHECK: ret i32 undef
264 define i32 @test34(i32 %a) {
265 %b = lshr i32 undef, 0
269 ; CHECK-LABEL: @test35
270 ; CHECK: ret i32 undef
271 define i32 @test35(<4 x i32> %V) {
272 %b = extractelement <4 x i32> %V, i32 4
276 ; CHECK-LABEL: @test36
277 ; CHECK: ret i32 undef
278 define i32 @test36(i32 %V) {
279 %b = extractelement <4 x i32> undef, i32 %V