1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2 ; RUN: opt -S --passes=slp-vectorizer -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
4 define void @test(i32 %arg) {
5 ; CHECK-LABEL: define void @test(
6 ; CHECK-SAME: i32 [[ARG:%.*]]) {
7 ; CHECK-NEXT: [[BB:.*]]:
8 ; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i32> <i32 poison, i32 0>, i32 [[ARG]], i32 0
9 ; CHECK-NEXT: br label %[[BB1:.*]]
11 ; CHECK-NEXT: [[PHI:%.*]] = phi i32 [ 0, %[[BB]] ], [ [[TMP5:%.*]], %[[BB1]] ]
12 ; CHECK-NEXT: [[PHI2:%.*]] = phi i32 [ 0, %[[BB]] ], [ [[TMP6:%.*]], %[[BB1]] ]
13 ; CHECK-NEXT: [[PHI3:%.*]] = phi i32 [ 0, %[[BB]] ], [ [[OP_RDX4:%.*]], %[[BB1]] ]
14 ; CHECK-NEXT: [[TMP1:%.*]] = phi <2 x i32> [ zeroinitializer, %[[BB]] ], [ [[TMP4:%.*]], %[[BB1]] ]
15 ; CHECK-NEXT: [[TMP2:%.*]] = shufflevector <2 x i32> [[TMP1]], <2 x i32> poison, <8 x i32> <i32 0, i32 0, i32 0, i32 1, i32 0, i32 0, i32 1, i32 0>
16 ; CHECK-NEXT: [[TMP3:%.*]] = add <8 x i32> [[TMP2]], zeroinitializer
17 ; CHECK-NEXT: [[ADD17:%.*]] = add i32 [[PHI]], 0
18 ; CHECK-NEXT: [[ADD18:%.*]] = add i32 [[PHI2]], 0
19 ; CHECK-NEXT: [[ADD19:%.*]] = add i32 [[PHI2]], 0
20 ; CHECK-NEXT: [[ADD23:%.*]] = add i32 [[PHI2]], 0
21 ; CHECK-NEXT: [[TMP4]] = add <2 x i32> [[TMP0]], <i32 0, i32 1>
22 ; CHECK-NEXT: [[TMP5]] = extractelement <2 x i32> [[TMP4]], i32 1
23 ; CHECK-NEXT: [[TMP6]] = extractelement <2 x i32> [[TMP4]], i32 0
24 ; CHECK-NEXT: [[TMP7:%.*]] = call i32 @llvm.vector.reduce.xor.v8i32(<8 x i32> [[TMP3]])
25 ; CHECK-NEXT: [[OP_RDX:%.*]] = xor i32 [[TMP7]], [[ADD18]]
26 ; CHECK-NEXT: [[OP_RDX1:%.*]] = xor i32 [[ADD17]], [[ADD19]]
27 ; CHECK-NEXT: [[OP_RDX2:%.*]] = xor i32 [[ADD23]], [[TMP6]]
28 ; CHECK-NEXT: [[OP_RDX3:%.*]] = xor i32 [[OP_RDX]], [[OP_RDX1]]
29 ; CHECK-NEXT: [[OP_RDX4]] = xor i32 [[OP_RDX3]], [[OP_RDX2]]
30 ; CHECK-NEXT: [[ICMP:%.*]] = icmp ult i32 [[TMP5]], 0
31 ; CHECK-NEXT: br label %[[BB1]]
37 %phi = phi i32 [ 0, %bb ], [ %add27, %bb1 ]
38 %phi2 = phi i32 [ 0, %bb ], [ %add24, %bb1 ]
39 %phi3 = phi i32 [ 0, %bb ], [ %xor26, %bb1 ]
40 %add = add i32 %phi2, 0
41 %add4 = add i32 %phi2, 0
42 %xor = xor i32 %add, %add4
43 %add5 = add i32 %phi, 0
44 %add6 = add i32 %phi2, 0
45 %add7 = add i32 %phi2, 0
46 %xor8 = xor i32 %add6, %xor
47 %xor9 = xor i32 %xor8, %add5
48 %xor10 = xor i32 %xor9, %add7
49 %add11 = add i32 %phi, 0
50 %add12 = add i32 %phi2, 0
51 %add13 = add i32 %phi2, 0
52 %xor14 = xor i32 %add12, %xor10
53 %xor15 = xor i32 %xor14, %add11
54 %xor16 = xor i32 %xor15, %add13
55 %add17 = add i32 %phi, 0
56 %add18 = add i32 %phi2, 0
57 %add19 = add i32 %phi2, 0
58 %xor20 = xor i32 %add18, %xor16
59 %xor21 = xor i32 %xor20, %add17
60 %xor22 = xor i32 %xor21, %add19
61 %add23 = add i32 %phi2, 0
62 %add24 = add i32 %arg, 0
63 %xor25 = xor i32 %add23, %xor22
64 %xor26 = xor i32 %xor25, %add24
66 %icmp = icmp ult i32 %add27, 0