1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -instcombine -S | FileCheck %s
4 define i1 @reduction_logical_or(<4 x i1> %x) {
5 ; CHECK-LABEL: @reduction_logical_or(
6 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i1> [[X:%.*]] to i4
7 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ne i4 [[TMP1]], 0
8 ; CHECK-NEXT: ret i1 [[TMP2]]
10 %r = call i1 @llvm.vector.reduce.or.v4i1(<4 x i1> %x)
14 define i1 @reduction_logical_and(<4 x i1> %x) {
15 ; CHECK-LABEL: @reduction_logical_and(
16 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast <4 x i1> [[X:%.*]] to i4
17 ; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i4 [[TMP1]], -1
18 ; CHECK-NEXT: ret i1 [[TMP2]]
20 %r = call i1 @llvm.vector.reduce.and.v4i1(<4 x i1> %x)
24 declare i1 @llvm.vector.reduce.or.v4i1(<4 x i1>)
25 declare i1 @llvm.vector.reduce.and.v4i1(<4 x i1>)