1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -S --passes=slp-vectorizer < %s | FileCheck %s
4 define i32 @test(i1 %.b, i8 %conv18, i32 %k.promoted61) {
5 ; CHECK-LABEL: define i32 @test(
6 ; CHECK-SAME: i1 [[DOTB:%.*]], i8 [[CONV18:%.*]], i32 [[K_PROMOTED61:%.*]]) {
7 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <4 x i1> poison, i1 [[DOTB]], i32 0
8 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <4 x i1> [[TMP1]], <4 x i1> poison, <4 x i32> zeroinitializer
9 ; CHECK-NEXT: [[TMP3:%.*]] = xor <4 x i1> [[TMP2]], splat (i1 true)
10 ; CHECK-NEXT: [[TMP4:%.*]] = zext <4 x i1> [[TMP3]] to <4 x i8>
11 ; CHECK-NEXT: [[TMP5:%.*]] = icmp eq <4 x i8> [[TMP4]], zeroinitializer
12 ; CHECK-NEXT: [[TMP6:%.*]] = zext <4 x i1> [[TMP3]] to <4 x i8>
13 ; CHECK-NEXT: [[TMP7:%.*]] = freeze <4 x i8> [[TMP6]]
14 ; CHECK-NEXT: [[TMP8:%.*]] = insertelement <4 x i8> poison, i8 [[CONV18]], i32 0
15 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <4 x i8> [[TMP8]], <4 x i8> poison, <4 x i32> zeroinitializer
16 ; CHECK-NEXT: [[TMP10:%.*]] = icmp ugt <4 x i8> [[TMP7]], [[TMP9]]
17 ; CHECK-NEXT: [[TMP11:%.*]] = select <4 x i1> [[TMP10]], <4 x i8> zeroinitializer, <4 x i8> [[TMP7]]
18 ; CHECK-NEXT: [[TMP12:%.*]] = sub nuw <4 x i8> [[TMP9]], [[TMP11]]
19 ; CHECK-NEXT: [[TMP13:%.*]] = select <4 x i1> [[TMP5]], <4 x i8> [[TMP9]], <4 x i8> [[TMP12]]
20 ; CHECK-NEXT: [[TMP14:%.*]] = zext <4 x i8> [[TMP13]] to <4 x i32>
21 ; CHECK-NEXT: [[TMP15:%.*]] = call i32 @llvm.vector.reduce.or.v4i32(<4 x i32> [[TMP14]])
22 ; CHECK-NEXT: [[OP_RDX:%.*]] = or i32 [[TMP15]], [[K_PROMOTED61]]
23 ; CHECK-NEXT: ret i32 [[OP_RDX]]
25 %not..b79 = xor i1 %.b, true
26 %3 = zext i1 %not..b79 to i8
27 %cmp.i51 = icmp eq i8 %3, 0
28 %cond.i55 = freeze i8 %3
29 %.cmp = icmp ugt i8 %cond.i55, %conv18
30 %.urem = select i1 %.cmp, i8 0, i8 %cond.i55
31 %4 = sub nuw i8 %conv18, %.urem
32 %cond.in.i = select i1 %cmp.i51, i8 %conv18, i8 %4
33 %not..b80 = xor i1 %.b, true
34 %5 = zext i1 %not..b80 to i8
35 %cmp.i51.1 = icmp eq i8 %5, 0
36 %cond.i55.1 = freeze i8 %5
37 %.cmp.1 = icmp ugt i8 %cond.i55.1, %conv18
38 %.urem.1 = select i1 %.cmp.1, i8 0, i8 %cond.i55.1
39 %6 = sub nuw i8 %conv18, %.urem.1
40 %cond.in.i.1 = select i1 %cmp.i51.1, i8 %conv18, i8 %6
41 %not..b81 = xor i1 %.b, true
42 %7 = zext i1 %not..b81 to i8
43 %cmp.i51.2 = icmp eq i8 %7, 0
44 %cond.i55.2 = freeze i8 %7
45 %.cmp.2 = icmp ugt i8 %cond.i55.2, %conv18
46 %.urem.2 = select i1 %.cmp.2, i8 0, i8 %cond.i55.2
47 %8 = sub nuw i8 %conv18, %.urem.2
48 %cond.in.i.2 = select i1 %cmp.i51.2, i8 %conv18, i8 %8
49 %not..b = xor i1 %.b, true
50 %9 = zext i1 %not..b to i8
51 %cmp.i51.3 = icmp eq i8 %9, 0
52 %cond.i55.3 = freeze i8 %9
53 %.cmp.3 = icmp ugt i8 %cond.i55.3, %conv18
54 %.urem.3 = select i1 %.cmp.3, i8 0, i8 %cond.i55.3
55 %10 = sub nuw i8 %conv18, %.urem.3
56 %cond.in.i.3 = select i1 %cmp.i51.3, i8 %conv18, i8 %10
57 %conv26 = zext nneg i8 %cond.in.i to i32
58 %or = or i32 %k.promoted61, %conv26
59 %conv26.1 = zext nneg i8 %cond.in.i.1 to i32
60 %or.1 = or i32 %or, %conv26.1
61 %conv26.2 = zext nneg i8 %cond.in.i.2 to i32
62 %or.2 = or i32 %or.1, %conv26.2
63 %conv26.3 = zext nneg i8 %cond.in.i.3 to i32
64 %or.3 = or i32 %or.2, %conv26.3