1 ; RUN: opt < %s -passes=instsimplify -S | FileCheck %s
3 ; CHECK-LABEL: shift_undef_64
4 define void @shift_undef_64(ptr %p) {
5 %r1 = lshr i64 -1, 4294967296 ; 2^32
6 ; CHECK: store i64 poison
9 %r2 = ashr i64 -1, 4294967297 ; 2^32 + 1
10 ; CHECK: store i64 poison
13 %r3 = shl i64 -1, 4294967298 ; 2^32 + 2
14 ; CHECK: store i64 poison
20 ; CHECK-LABEL: shift_undef_65
21 define void @shift_undef_65(ptr %p) {
22 %r1 = lshr i65 2, 18446744073709551617
23 ; CHECK: store i65 poison
26 %r2 = ashr i65 4, 18446744073709551617
27 ; CHECK: store i65 poison
30 %r3 = shl i65 1, 18446744073709551617
31 ; CHECK: store i65 poison
37 ; CHECK-LABEL: shift_undef_256
38 define void @shift_undef_256(ptr %p) {
39 %r1 = lshr i256 2, 18446744073709551617
40 ; CHECK: store i256 poison
41 store i256 %r1, ptr %p
43 %r2 = ashr i256 4, 18446744073709551618
44 ; CHECK: store i256 poison
45 store i256 %r2, ptr %p
47 %r3 = shl i256 1, 18446744073709551619
48 ; CHECK: store i256 poison
49 store i256 %r3, ptr %p
54 ; CHECK-LABEL: shift_undef_511
55 define void @shift_undef_511(ptr %p) {
56 %r1 = lshr i511 -1, 1208925819614629174706276 ; 2^80 + 100
57 ; CHECK: store i511 poison
58 store i511 %r1, ptr %p
60 %r2 = ashr i511 -2, 1208925819614629174706200
61 ; CHECK: store i511 poison
62 store i511 %r2, ptr %p
64 %r3 = shl i511 -3, 1208925819614629174706180
65 ; CHECK: store i511 poison
66 store i511 %r3, ptr %p