1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=slp-vectorizer,verify -slp-threshold=-99999 -mtriple=aarch64-unknown-linux -S -pass-remarks-output=%t | FileCheck %s
3 ; RUN: FileCheck --input-file=%t --check-prefix=YAML %s
5 ; YAML-LABEL: --- !Passed
6 ; YAML-NEXT: Pass: slp-vectorizer
7 ; YAML-NEXT: Name: VectorizedList
8 ; YAML-NEXT: Function: foo
10 ; YAML-NEXT: - String: 'SLP vectorized with cost '
11 ; YAML-NEXT: - Cost: '2'
12 ; YAML-NEXT: - String: ' and with tree size '
13 ; YAML-NEXT: - TreeSize: '2'
15 ; YAML-LABEL: --- !Passed
16 ; YAML-NEXT: Pass: slp-vectorizer
17 ; YAML-NEXT: Name: VectorizedList
18 ; YAML-NEXT: Function: foo
20 ; YAML-NEXT: - String: 'SLP vectorized with cost '
21 ; YAML-NEXT: - Cost: '0'
22 ; YAML-NEXT: - String: ' and with tree size '
23 ; YAML-NEXT: - TreeSize: '3'
25 ; YAML-LABEL: --- !Passed
26 ; YAML-NEXT: Pass: slp-vectorizer
27 ; YAML-NEXT: Name: VectorizedList
28 ; YAML-NEXT: Function: foo
30 ; YAML-NEXT: - String: 'SLP vectorized with cost '
31 ; YAML-NEXT: - Cost: '8'
32 ; YAML-NEXT: - String: ' and with tree size '
33 ; YAML-NEXT: - TreeSize: '5'
35 define void @foo() personality ptr @bar {
38 ; CHECK-NEXT: br label [[BB3:%.*]]
39 ; CHECK: bb2.loopexit:
40 ; CHECK-NEXT: br label [[BB2:%.*]]
42 ; CHECK-NEXT: [[TMP0:%.*]] = phi <2 x i64> [ poison, [[BB9:%.*]] ], [ poison, [[BB2_LOOPEXIT:%.*]] ]
43 ; CHECK-NEXT: [[TMP1:%.*]] = phi <2 x i64> [ [[TMP7:%.*]], [[BB9]] ], [ poison, [[BB2_LOOPEXIT]] ]
44 ; CHECK-NEXT: ret void
46 ; CHECK-NEXT: [[TMP2:%.*]] = phi <2 x i64> [ [[TMP4:%.*]], [[BB6:%.*]] ], [ poison, [[BB1:%.*]] ]
47 ; CHECK-NEXT: [[TMP5:%.*]] = extractelement <2 x i64> [[TMP2]], i32 0
48 ; CHECK-NEXT: [[TMP10:%.*]] = extractelement <2 x i64> [[TMP2]], i32 1
49 ; CHECK-NEXT: [[TMP3:%.*]] = invoke i64 poison(ptr addrspace(1) nonnull poison, i64 0, i64 0, i64 poison) [ "deopt"() ]
50 ; CHECK-NEXT: to label [[BB4:%.*]] unwind label [[BB10:%.*]]
52 ; CHECK-NEXT: br i1 poison, label [[BB11:%.*]], label [[BB5:%.*]]
54 ; CHECK-NEXT: br label [[BB7:%.*]]
56 ; CHECK-NEXT: [[TMP4]] = phi <2 x i64> [ <i64 0, i64 poison>, [[BB8:%.*]] ]
57 ; CHECK-NEXT: br label [[BB3]]
59 ; CHECK-NEXT: [[LOCAL_5_84111:%.*]] = phi i64 [ poison, [[BB8]] ], [ poison, [[BB5]] ]
60 ; CHECK-NEXT: [[TMP6:%.*]] = invoke i64 poison(ptr addrspace(1) nonnull poison, i64 poison, i64 poison, i64 poison) [ "deopt"() ]
61 ; CHECK-NEXT: to label [[BB8]] unwind label [[BB12:%.*]]
63 ; CHECK-NEXT: br i1 poison, label [[BB7]], label [[BB6]]
65 ; CHECK-NEXT: [[INDVARS_IV528799:%.*]] = phi i64 [ poison, [[BB10]] ], [ poison, [[BB12]] ]
66 ; CHECK-NEXT: [[TMP7]] = phi <2 x i64> [ [[TMP8:%.*]], [[BB10]] ], [ [[TMP9:%.*]], [[BB12]] ]
67 ; CHECK-NEXT: br label [[BB2]]
69 ; CHECK-NEXT: [[LOCAL_10_38123_LCSSA:%.*]] = phi i64 [ [[TMP10]], [[BB3]] ]
70 ; CHECK-NEXT: [[LOCAL_5_33118_LCSSA:%.*]] = phi i64 [ [[TMP5]], [[BB3]] ]
71 ; CHECK-NEXT: [[LANDING_PAD68:%.*]] = landingpad { ptr, i64 }
73 ; CHECK-NEXT: [[TMP12:%.*]] = insertelement <2 x i64> poison, i64 [[LOCAL_10_38123_LCSSA]], i32 0
74 ; CHECK-NEXT: [[TMP8]] = insertelement <2 x i64> [[TMP12]], i64 [[LOCAL_5_33118_LCSSA]], i32 1
75 ; CHECK-NEXT: br label [[BB9]]
77 ; CHECK-NEXT: ret void
79 ; CHECK-NEXT: [[LOCAL_10_89113_LCSSA:%.*]] = phi i64 [ poison, [[BB7]] ]
80 ; CHECK-NEXT: [[LOCAL_5_84111_LCSSA:%.*]] = phi i64 [ [[LOCAL_5_84111]], [[BB7]] ]
81 ; CHECK-NEXT: [[LANDING_PAD149:%.*]] = landingpad { ptr, i64 }
83 ; CHECK-NEXT: [[TMP11:%.*]] = insertelement <2 x i64> poison, i64 [[LOCAL_10_89113_LCSSA]], i32 0
84 ; CHECK-NEXT: [[TMP9]] = insertelement <2 x i64> [[TMP11]], i64 [[LOCAL_5_84111_LCSSA]], i32 1
85 ; CHECK-NEXT: br label [[BB9]]
94 %local_8_3681 = phi i64 [ poison, %bb9 ], [ 1, %bb2.loopexit ]
95 %local_2_44 = phi i64 [ poison, %bb9 ], [ poison, %bb2.loopexit ]
96 %local_5_47 = phi i64 [ %local_5_19, %bb9 ], [ poison, %bb2.loopexit ]
97 %local_10_52 = phi i64 [ %local_10_24, %bb9 ], [ poison, %bb2.loopexit ]
101 %local_10_38123 = phi i64 [ %.lcssa773, %bb6 ], [ poison, %bb1 ]
102 %local_5_33118 = phi i64 [ poison, %bb6 ], [ poison, %bb1 ]
103 %0 = invoke i64 poison(ptr addrspace(1) nonnull poison, i64 0, i64 0, i64 poison) [ "deopt"() ]
104 to label %bb4 unwind label %bb10
107 br i1 poison, label %bb11, label %bb5
113 %.lcssa773 = phi i64 [ poison, %bb8 ]
114 %.lcssa770 = phi i64 [ 0, %bb8 ]
118 %local_5_84111 = phi i64 [ poison, %bb8 ], [ poison, %bb5 ]
119 %1 = invoke i64 poison(ptr addrspace(1) nonnull poison, i64 poison, i64 poison, i64 poison) [ "deopt"() ]
120 to label %bb8 unwind label %bb12
123 br i1 poison, label %bb7, label %bb6
126 %indvars.iv528799 = phi i64 [ poison, %bb10 ], [ poison, %bb12 ]
127 %local_5_19 = phi i64 [ %local_5_33118.lcssa, %bb10 ], [ %local_5_84111.lcssa, %bb12 ]
128 %local_10_24 = phi i64 [ %local_10_38123.lcssa, %bb10 ], [ %local_10_89113.lcssa, %bb12 ]
132 %local_10_38123.lcssa = phi i64 [ %local_10_38123, %bb3 ]
133 %local_5_33118.lcssa = phi i64 [ %local_5_33118, %bb3 ]
134 %landing_pad68 = landingpad { ptr, i64 }
142 %local_10_89113.lcssa = phi i64 [ poison, %bb7 ]
143 %local_5_84111.lcssa = phi i64 [ %local_5_84111, %bb7 ]
144 %landing_pad149 = landingpad { ptr, i64 }