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 ; CHECK-LABEL: define i64 @foo() {
9 ; CHECK-NEXT: br label [[BB3:%.*]]
11 ; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ [[ADD:%.*]], [[BB3]] ]
12 ; CHECK-NEXT: [[PHI2:%.*]] = phi i64 [ [[TMP9:%.*]], [[BB3]] ]
13 ; CHECK-NEXT: ret i64 0
15 ; CHECK-NEXT: [[PHI5:%.*]] = phi i64 [ 0, [[BB:%.*]] ], [ 0, [[BB3]] ]
16 ; CHECK-NEXT: [[TMP1:%.*]] = phi <2 x i64> [ zeroinitializer, [[BB]] ], [ [[TMP7:%.*]], [[BB3]] ]
17 ; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x i64> [[TMP1]], i32 0
18 ; CHECK-NEXT: [[TMP2:%.*]] = extractelement <2 x i64> [[TMP1]], i32 1
19 ; CHECK-NEXT: [[ADD]] = add i64 [[TMP3]], [[TMP2]]
20 ; CHECK-NEXT: [[GETELEMENTPTR:%.*]] = getelementptr i64, ptr addrspace(1) null, i64 0
21 ; CHECK-NEXT: [[TMP9]] = or i64 [[PHI5]], 0
22 ; CHECK-NEXT: [[ICMP:%.*]] = icmp ult i64 [[TMP9]], 0
23 ; CHECK-NEXT: [[TMP7]] = insertelement <2 x i64> <i64 poison, i64 0>, i64 [[ADD]], i32 0
24 ; CHECK-NEXT: br i1 false, label [[BB3]], label [[BB1:%.*]]
26 ; FORCED-LABEL: define i64 @foo() {
28 ; FORCED-NEXT: [[TMP8:%.*]] = add i64 0, 0
29 ; FORCED-NEXT: br label [[BB3:%.*]]
31 ; FORCED-NEXT: [[TMP0:%.*]] = phi <2 x i64> [ [[TMP5:%.*]], [[BB3]] ]
32 ; FORCED-NEXT: ret i64 0
34 ; FORCED-NEXT: [[PHI5:%.*]] = phi i64 [ 0, [[BB:%.*]] ], [ 0, [[BB3]] ]
35 ; FORCED-NEXT: [[TMP1:%.*]] = phi <2 x i64> [ zeroinitializer, [[BB]] ], [ [[TMP7:%.*]], [[BB3]] ]
36 ; FORCED-NEXT: [[TMP2:%.*]] = insertelement <2 x i64> <i64 poison, i64 0>, i64 [[PHI5]], i32 0
37 ; FORCED-NEXT: [[TMP3:%.*]] = add <2 x i64> [[TMP1]], [[TMP2]]
38 ; FORCED-NEXT: [[TMP4:%.*]] = or <2 x i64> [[TMP1]], [[TMP2]]
39 ; FORCED-NEXT: [[TMP5]] = shufflevector <2 x i64> [[TMP3]], <2 x i64> [[TMP4]], <2 x i32> <i32 0, i32 3>
40 ; FORCED-NEXT: [[TMP6:%.*]] = shufflevector <2 x i64> [[TMP1]], <2 x i64> <i64 poison, i64 0>, <2 x i32> <i32 0, i32 3>
41 ; FORCED-NEXT: [[TMP7]] = add <2 x i64> [[TMP6]], [[TMP2]]
42 ; FORCED-NEXT: [[GETELEMENTPTR:%.*]] = getelementptr i64, ptr addrspace(1) null, i64 [[TMP8]]
43 ; FORCED-NEXT: [[TMP9:%.*]] = extractelement <2 x i64> [[TMP5]], i32 1
44 ; FORCED-NEXT: [[ICMP:%.*]] = icmp ult i64 [[TMP9]], 0
45 ; FORCED-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