1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer -S | FileCheck %s
3 target triple = "aarch64-unknown-linux-gnu"
4 @d = internal unnamed_addr global i32 5, align 4
6 define dso_local void @l() local_unnamed_addr {
9 ; CHECK-NEXT: br label [[BB1:%.*]]
11 ; CHECK-NEXT: [[TMP0:%.*]] = phi <2 x i16> [ undef, [[BB:%.*]] ], [ [[TMP11:%.*]], [[BB25:%.*]] ]
12 ; CHECK-NEXT: br i1 undef, label [[BB3:%.*]], label [[BB11:%.*]]
14 ; CHECK-NEXT: [[I4:%.*]] = zext i1 undef to i32
15 ; CHECK-NEXT: [[TMP1:%.*]] = xor <2 x i16> [[TMP0]], undef
16 ; CHECK-NEXT: [[TMP2:%.*]] = icmp ugt <2 x i16> [[TMP1]], <i16 8, i16 8>
17 ; CHECK-NEXT: [[TMP3:%.*]] = zext <2 x i1> [[TMP2]] to <2 x i32>
18 ; CHECK-NEXT: br label [[BB25]]
20 ; CHECK-NEXT: [[I12:%.*]] = zext i1 undef to i32
21 ; CHECK-NEXT: [[TMP4:%.*]] = xor <2 x i16> [[TMP0]], undef
22 ; CHECK-NEXT: [[TMP5:%.*]] = sext <2 x i16> [[TMP4]] to <2 x i64>
23 ; CHECK-NEXT: [[TMP6:%.*]] = icmp ule <2 x i64> undef, [[TMP5]]
24 ; CHECK-NEXT: [[TMP7:%.*]] = zext <2 x i1> [[TMP6]] to <2 x i32>
25 ; CHECK-NEXT: [[TMP8:%.*]] = icmp ult <2 x i32> undef, [[TMP7]]
26 ; CHECK-NEXT: [[TMP9:%.*]] = zext <2 x i1> [[TMP8]] to <2 x i32>
27 ; CHECK-NEXT: br label [[BB25]]
29 ; CHECK-NEXT: [[I28:%.*]] = phi i32 [ [[I12]], [[BB11]] ], [ [[I4]], [[BB3]] ]
30 ; CHECK-NEXT: [[TMP10:%.*]] = phi <2 x i32> [ [[TMP9]], [[BB11]] ], [ [[TMP3]], [[BB3]] ]
31 ; CHECK-NEXT: [[TMP11]] = phi <2 x i16> [ [[TMP4]], [[BB11]] ], [ [[TMP1]], [[BB3]] ]
32 ; CHECK-NEXT: [[TMP12:%.*]] = trunc <2 x i32> [[TMP10]] to <2 x i8>
33 ; CHECK-NEXT: [[TMP13:%.*]] = extractelement <2 x i8> [[TMP12]], i32 0
34 ; CHECK-NEXT: [[TMP14:%.*]] = zext i8 [[TMP13]] to i32
35 ; CHECK-NEXT: [[I31:%.*]] = and i32 undef, [[TMP14]]
36 ; CHECK-NEXT: [[TMP15:%.*]] = extractelement <2 x i8> [[TMP12]], i32 1
37 ; CHECK-NEXT: [[TMP16:%.*]] = zext i8 [[TMP15]] to i32
38 ; CHECK-NEXT: [[I32:%.*]] = and i32 [[I31]], [[TMP16]]
39 ; CHECK-NEXT: [[I33:%.*]] = and i32 [[I32]], [[I28]]
40 ; CHECK-NEXT: br i1 undef, label [[BB34:%.*]], label [[BB1]]
42 ; CHECK-NEXT: [[I35:%.*]] = phi i32 [ [[I33]], [[BB25]] ]
43 ; CHECK-NEXT: br label [[BB36:%.*]]
45 ; CHECK-NEXT: store i32 [[I35]], ptr @d, align 4
46 ; CHECK-NEXT: ret void
51 bb1: ; preds = %bb25, %bb
52 %i = phi i16 [ undef, %bb ], [ %i29, %bb25 ]
53 %i2 = phi i16 [ undef, %bb ], [ %i30, %bb25 ]
54 br i1 undef, label %bb3, label %bb11
57 %i4 = zext i1 undef to i32
58 %i5 = xor i16 %i2, undef
59 %i6 = icmp ugt i16 %i5, 8
60 %i7 = zext i1 %i6 to i32
61 %i8 = xor i16 %i, undef
62 %i9 = icmp ugt i16 %i8, 8
63 %i10 = zext i1 %i9 to i32
67 %i12 = zext i1 undef to i32
68 %i13 = xor i16 %i2, undef
69 %i14 = sext i16 %i13 to i64
70 %i15 = icmp ule i64 undef, %i14
71 %i16 = zext i1 %i15 to i32
72 %i17 = icmp ult i32 undef, %i16
73 %i18 = zext i1 %i17 to i32
74 %i19 = xor i16 %i, undef
75 %i20 = sext i16 %i19 to i64
76 %i21 = icmp ule i64 undef, %i20
77 %i22 = zext i1 %i21 to i32
78 %i23 = icmp ult i32 undef, %i22
79 %i24 = zext i1 %i23 to i32
82 bb25: ; preds = %bb11, %bb3
83 %i26 = phi i32 [ %i24, %bb11 ], [ %i10, %bb3 ]
84 %i27 = phi i32 [ %i18, %bb11 ], [ %i7, %bb3 ]
85 %i28 = phi i32 [ %i12, %bb11 ], [ %i4, %bb3 ]
86 %i29 = phi i16 [ %i19, %bb11 ], [ %i8, %bb3 ]
87 %i30 = phi i16 [ %i13, %bb11 ], [ %i5, %bb3 ]
88 %i31 = and i32 undef, %i26
89 %i32 = and i32 %i31, %i27
90 %i33 = and i32 %i32, %i28
91 br i1 undef, label %bb34, label %bb1
94 %i35 = phi i32 [ %i33, %bb25 ]
98 store i32 %i35, ptr @d, align 4