1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=slp-vectorizer -S -slp-threshold=-9999 < %s | FileCheck %s
3 ; RUN: opt -passes=slp-vectorizer -S -slp-threshold=-9999\
4 ; RUN: -slp-skip-early-profitability-check < %s | FileCheck %s --check-prefixes=FORCED
7 ; FORCED-LABEL: define i64 @foo() {
9 ; FORCED-NEXT: br label [[BB3:%.*]]
11 ; FORCED-NEXT: [[TMP0:%.*]] = phi <2 x i64> [ [[TMP5:%.*]], [[BB3]] ]
12 ; FORCED-NEXT: ret i64 0
14 ; FORCED-NEXT: [[PHI5:%.*]] = phi i64 [ 0, [[BB:%.*]] ], [ 0, [[BB3]] ]
15 ; FORCED-NEXT: [[TMP1:%.*]] = phi <2 x i64> [ zeroinitializer, [[BB]] ], [ [[TMP7:%.*]], [[BB3]] ]
16 ; FORCED-NEXT: [[TMP2:%.*]] = insertelement <2 x i64> <i64 poison, i64 0>, i64 [[PHI5]], i32 0
17 ; FORCED-NEXT: [[TMP3:%.*]] = add <2 x i64> [[TMP1]], [[TMP2]]
18 ; FORCED-NEXT: [[TMP4:%.*]] = or <2 x i64> [[TMP1]], [[TMP2]]
19 ; FORCED-NEXT: [[TMP5]] = shufflevector <2 x i64> [[TMP3]], <2 x i64> [[TMP4]], <2 x i32> <i32 0, i32 3>
20 ; FORCED-NEXT: [[TMP6:%.*]] = shufflevector <2 x i64> [[TMP1]], <2 x i64> <i64 poison, i64 0>, <2 x i32> <i32 0, i32 3>
21 ; FORCED-NEXT: [[TMP7]] = add <2 x i64> [[TMP6]], [[TMP2]]
22 ; FORCED-NEXT: [[TMP8:%.*]] = extractelement <2 x i64> [[TMP7]], i32 1
23 ; FORCED-NEXT: [[GETELEMENTPTR:%.*]] = getelementptr i64, ptr addrspace(1) null, i64 [[TMP8]]
24 ; FORCED-NEXT: [[TMP9:%.*]] = extractelement <2 x i64> [[TMP5]], i32 1
25 ; FORCED-NEXT: [[ICMP:%.*]] = icmp ult i64 [[TMP9]], 0
26 ; FORCED-NEXT: br i1 false, label [[BB3]], label [[BB1:%.*]]
28 ; CHECK-LABEL: define i64 @foo() {
30 ; CHECK-NEXT: br label [[BB3:%.*]]
32 ; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ [[ADD:%.*]], [[BB3]] ]
33 ; CHECK-NEXT: [[PHI2:%.*]] = phi i64 [ [[TMP9:%.*]], [[BB3]] ]
34 ; CHECK-NEXT: ret i64 0
36 ; CHECK-NEXT: [[PHI5:%.*]] = phi i64 [ 0, [[BB:%.*]] ], [ 0, [[BB3]] ]
37 ; CHECK-NEXT: [[TMP1:%.*]] = phi <2 x i64> [ zeroinitializer, [[BB]] ], [ [[TMP7:%.*]], [[BB3]] ]
38 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x i64> [[TMP1]], i32 0
39 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
40 ; CHECK-NEXT: [[ADD]] = add i64 [[TMP3]], [[TMP2]]
41 ; CHECK-NEXT: [[GETELEMENTPTR:%.*]] = getelementptr i64, ptr addrspace(1) null, i64 0
42 ; CHECK-NEXT: [[TMP9]] = or i64 [[PHI5]], 0
43 ; CHECK-NEXT: [[ICMP:%.*]] = icmp ult i64 [[TMP9]], 0
44 ; CHECK-NEXT: [[TMP7]] = insertelement <2 x i64> <i64 poison, i64 0>, i64 [[ADD]], i32 0
45 ; CHECK-NEXT: br i1 false, label [[BB3]], label [[BB1:%.*]]
51 %phi = phi i64 [ %add, %bb3 ]
52 %phi2 = phi i64 [ %or, %bb3 ]
56 %phi4 = phi i64 [ 0, %bb ], [ %add7, %bb3 ]
57 %phi5 = phi i64 [ 0, %bb ], [ 0, %bb3 ]
58 %phi6 = phi i64 [ 0, %bb ], [ %add, %bb3 ]
59 %add = add i64 %phi6, %phi5
61 %getelementptr = getelementptr i64, ptr addrspace(1) null, i64 %add7
63 %icmp = icmp ult i64 %or, 0
64 br i1 false, label %bb3, label %bb1