; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=instsimplify -S < %s | FileCheck %s
define i1 @bitcast() {
; CHECK-LABEL: @bitcast(
; CHECK-NEXT: ret i1 false
;
%a = alloca i32
%b = alloca i64
%y = call ptr @func1(ptr %b)
%cmp = icmp eq ptr %a, %y
ret i1 %cmp
}
%gept = type { i32, i32 }
define i1 @gep3() {
; CHECK-LABEL: @gep3(
; CHECK-NEXT: ret i1 false
;
%x = alloca %gept, align 8
%y = call ptr @func2(ptr %x)
%b = getelementptr %gept, ptr %y, i64 0, i32 1
%equal = icmp eq ptr %x, %b
ret i1 %equal
}
define <8 x i1> @returned_vec_arg_casted(<2 x i32> %a) {
; CHECK-LABEL: @returned_vec_arg_casted(
; CHECK-NEXT: [[X:%.*]] = call <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> [[A:%.*]])
; CHECK-NEXT: [[C:%.*]] = icmp slt <8 x i8> [[X]], zeroinitializer
; CHECK-NEXT: ret <8 x i1> [[C]]
;
%x = call <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> %a)
%C = icmp slt <8 x i8> %x, zeroinitializer
ret <8 x i1> %C
}
define <8 x i1> @returned_vec_arg_casted2(<2 x i32> %a) {
; CHECK-LABEL: @returned_vec_arg_casted2(
; CHECK-NEXT: [[OR:%.*]] = or <2 x i32> [[A:%.*]], <i32 1, i32 1>
; CHECK-NEXT: [[X:%.*]] = call <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> [[OR]])
; CHECK-NEXT: [[C:%.*]] = icmp ne <8 x i8> [[X]], zeroinitializer
; CHECK-NEXT: ret <8 x i1> [[C]]
;
%or = or <2 x i32> %a, <i32 1, i32 1>
%x = call <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> %or)
%C = icmp ne <8 x i8> %x, zeroinitializer
ret <8 x i1> %C
}
declare <8 x i8> @passthru_8i8v_from_2i32v(<2 x i32> returned)
declare ptr @func1(ptr returned) nounwind readnone willreturn
declare ptr @func2(ptr returned) nounwind readnone willreturn