1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
5 ; CHECK-LABEL: define void @test() {
7 ; CHECK-NEXT: [[TMP0:%.*]] = load i16, ptr null, align 2
8 ; CHECK-NEXT: [[TMP1:%.*]] = and i8 0, 1
9 ; CHECK-NEXT: [[TMP2:%.*]] = and i32 0, 0
10 ; CHECK-NEXT: [[TMP3:%.*]] = select i1 false, i32 0, i32 0
11 ; CHECK-NEXT: [[TMP4:%.*]] = insertelement <4 x i8> <i8 0, i8 poison, i8 poison, i8 poison>, i8 [[TMP1]], i32 1
12 ; CHECK-NEXT: [[TMP5:%.*]] = shufflevector <4 x i8> [[TMP4]], <4 x i8> poison, <4 x i32> <i32 0, i32 1, i32 1, i32 1>
13 ; CHECK-NEXT: [[TMP15:%.*]] = trunc <4 x i8> [[TMP5]] to <4 x i1>
14 ; CHECK-NEXT: [[TMP7:%.*]] = shufflevector <4 x i8> [[TMP4]], <4 x i8> poison, <4 x i32> <i32 1, i32 1, i32 1, i32 1>
15 ; CHECK-NEXT: [[TMP8:%.*]] = or <4 x i8> [[TMP7]], zeroinitializer
16 ; CHECK-NEXT: [[TMP9:%.*]] = trunc <4 x i8> [[TMP8]] to <4 x i1>
17 ; CHECK-NEXT: [[TMP10:%.*]] = or <4 x i1> zeroinitializer, [[TMP15]]
18 ; CHECK-NEXT: [[TMP11:%.*]] = icmp eq <4 x i1> [[TMP9]], [[TMP10]]
19 ; CHECK-NEXT: [[TMP6:%.*]] = zext <4 x i1> [[TMP15]] to <4 x i32>
20 ; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <4 x i32> [[TMP6]], <4 x i32> <i32 0, i32 poison, i32 0, i32 0>, <4 x i32> <i32 4, i32 1, i32 6, i32 7>
21 ; CHECK-NEXT: [[TMP13:%.*]] = select <4 x i1> [[TMP11]], <4 x i32> [[TMP12]], <4 x i32> zeroinitializer
22 ; CHECK-NEXT: [[TMP14:%.*]] = call i32 @llvm.vector.reduce.and.v4i32(<4 x i32> [[TMP13]])
23 ; CHECK-NEXT: [[OP_RDX:%.*]] = and i32 0, [[TMP14]]
24 ; CHECK-NEXT: store i32 [[OP_RDX]], ptr null, align 4
25 ; CHECK-NEXT: ret void
28 %0 = load i16, ptr null, align 2
31 %3 = select i1 false, i32 0, i32 0
32 %i2 = sext i8 %1 to i32
34 %i4 = sext i8 %i3 to i32
36 %b1 = icmp eq i32 %i4, %i5
37 %a1 = select i1 %b1, i32 0, i32 0
40 %i8 = sext i8 %1 to i32
42 %i10 = sext i8 %i9 to i32
44 %b2 = icmp eq i32 %i10, %i11
45 %a2 = select i1 %b2, i32 0, i32 0
48 %i14 = sext i8 %1 to i32
50 %i16 = sext i8 %i15 to i32
52 %b3 = icmp eq i32 %i16, %i17
53 %a3 = select i1 %b3, i32 %i14, i32 0
56 %i20 = sext i8 0 to i32
58 %i22 = sext i8 %i21 to i32
60 %b4 = icmp eq i32 %i22, %i23
61 %a4 = select i1 %b4, i32 0, i32 0
64 store i32 %s4, ptr null, align 4