1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=instsimplify -S < %s | FileCheck %s
5 ; CHECK-LABEL: @bitcast(
6 ; CHECK-NEXT: ret i1 false
10 %y = call ptr @func1(ptr %b)
11 %cmp = icmp eq ptr %a, %y
15 %gept = type { i32, i32 }
19 ; CHECK-NEXT: ret i1 false
21 %x = alloca %gept, align 8
22 %y = call ptr @func2(ptr %x)
23 %b = getelementptr %gept, ptr %y, i64 0, i32 1
24 %equal = icmp eq ptr %x, %b
28 define <8 x i1> @returned_vec_arg_casted(<2 x i32> %a) {
29 ; CHECK-LABEL: @returned_vec_arg_casted(
30 ; CHECK-NEXT: [[X:%.*]] = call <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> [[A:%.*]])
31 ; CHECK-NEXT: [[C:%.*]] = icmp slt <8 x i8> [[X]], zeroinitializer
32 ; CHECK-NEXT: ret <8 x i1> [[C]]
34 %x = call <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> %a)
35 %C = icmp slt <8 x i8> %x, zeroinitializer
39 define <8 x i1> @returned_vec_arg_casted2(<2 x i32> %a) {
40 ; CHECK-LABEL: @returned_vec_arg_casted2(
41 ; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[A:%.*]], <i32 1, i32 1>
42 ; CHECK-NEXT: [[X:%.*]] = call <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> [[OR]])
43 ; CHECK-NEXT: [[C:%.*]] = icmp ne <8 x i8> [[X]], zeroinitializer
44 ; CHECK-NEXT: ret <8 x i1> [[C]]
46 %or = or <2 x i32> %a, <i32 1, i32 1>
47 %x = call <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> %or)
48 %C = icmp ne <8 x i8> %x, zeroinitializer
52 declare <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> returned)
53 declare ptr @func1(ptr returned) nounwind readnone willreturn
54 declare ptr @func2(ptr returned) nounwind readnone willreturn