1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu -mcpu=bdver2 < %s | FileCheck %s
4 %"struct.std::array" = type { [32 x i8] }
6 ; Function Attrs: nounwind uwtable
7 define fastcc void @_ZN12_GLOBAL__N_127PolynomialMultiplyRecognize9recognizeEv() unnamed_addr #0 align 2 {
8 ; CHECK-LABEL: @_ZN12_GLOBAL__N_127PolynomialMultiplyRecognize9recognizeEv(
10 ; CHECK-NEXT: br i1 undef, label [[IF_END50_I:%.*]], label [[IF_THEN22_I:%.*]]
12 ; CHECK-NEXT: [[SUB_I:%.*]] = add nsw i32 undef, -1
13 ; CHECK-NEXT: [[CONV31_I:%.*]] = and i32 undef, [[SUB_I]]
14 ; CHECK-NEXT: [[TMP0:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 0
15 ; CHECK-NEXT: [[ARRAYIDX_I_I7_1_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 1
16 ; CHECK-NEXT: [[ARRAYIDX_I_I7_2_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 2
17 ; CHECK-NEXT: [[ARRAYIDX_I_I7_3_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 3
18 ; CHECK-NEXT: [[ARRAYIDX_I_I7_4_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 4
19 ; CHECK-NEXT: [[ARRAYIDX_I_I7_5_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 5
20 ; CHECK-NEXT: [[ARRAYIDX_I_I7_6_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 6
21 ; CHECK-NEXT: [[ARRAYIDX_I_I7_7_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 7
22 ; CHECK-NEXT: [[TMP1:%.*]] = insertelement <8 x i32> poison, i32 [[CONV31_I]], i32 0
23 ; CHECK-NEXT: [[SHUFFLE:%.*]] = shufflevector <8 x i32> [[TMP1]], <8 x i32> poison, <8 x i32> zeroinitializer
24 ; CHECK-NEXT: [[TMP2:%.*]] = lshr <8 x i32> [[SHUFFLE]], <i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8>
25 ; CHECK-NEXT: [[ARRAYIDX_I_I7_8_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 8
26 ; CHECK-NEXT: [[ARRAYIDX_I_I7_9_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 9
27 ; CHECK-NEXT: [[ARRAYIDX_I_I7_10_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 10
28 ; CHECK-NEXT: [[ARRAYIDX_I_I7_11_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 11
29 ; CHECK-NEXT: [[TMP3:%.*]] = insertelement <4 x i32> poison, i32 [[CONV31_I]], i32 0
30 ; CHECK-NEXT: [[SHUFFLE1:%.*]] = shufflevector <4 x i32> [[TMP3]], <4 x i32> poison, <4 x i32> zeroinitializer
31 ; CHECK-NEXT: [[TMP4:%.*]] = lshr <4 x i32> [[SHUFFLE1]], <i32 9, i32 10, i32 11, i32 12>
32 ; CHECK-NEXT: [[ARRAYIDX_I_I7_12_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 12
33 ; CHECK-NEXT: [[SHR_12_I_I:%.*]] = lshr i32 [[CONV31_I]], 13
34 ; CHECK-NEXT: [[ARRAYIDX_I_I7_13_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 13
35 ; CHECK-NEXT: [[ARRAYIDX_I_I7_14_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 14
36 ; CHECK-NEXT: [[TMP5:%.*]] = insertelement <2 x i32> poison, i32 [[CONV31_I]], i32 0
37 ; CHECK-NEXT: [[TMP6:%.*]] = insertelement <2 x i32> [[TMP5]], i32 [[CONV31_I]], i32 1
38 ; CHECK-NEXT: [[TMP7:%.*]] = lshr <2 x i32> [[TMP6]], <i32 14, i32 15>
39 ; CHECK-NEXT: [[TMP8:%.*]] = insertelement <16 x i32> poison, i32 [[SUB_I]], i32 0
40 ; CHECK-NEXT: [[TMP9:%.*]] = shufflevector <8 x i32> [[TMP2]], <8 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
41 ; CHECK-NEXT: [[TMP10:%.*]] = shufflevector <16 x i32> [[TMP8]], <16 x i32> [[TMP9]], <16 x i32> <i32 0, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
42 ; CHECK-NEXT: [[TMP11:%.*]] = shufflevector <4 x i32> [[TMP4]], <4 x i32> poison, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
43 ; CHECK-NEXT: [[TMP12:%.*]] = shufflevector <16 x i32> [[TMP10]], <16 x i32> [[TMP11]], <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 16, i32 17, i32 18, i32 19, i32 13, i32 14, i32 15>
44 ; CHECK-NEXT: [[TMP13:%.*]] = insertelement <16 x i32> [[TMP12]], i32 [[SHR_12_I_I]], i32 13
45 ; CHECK-NEXT: [[TMP14:%.*]] = shufflevector <2 x i32> [[TMP7]], <2 x i32> poison, <16 x i32> <i32 0, i32 1, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef, i32 undef>
46 ; CHECK-NEXT: [[TMP15:%.*]] = shufflevector <16 x i32> [[TMP13]], <16 x i32> [[TMP14]], <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 16, i32 17>
47 ; CHECK-NEXT: [[TMP16:%.*]] = trunc <16 x i32> [[TMP15]] to <16 x i8>
48 ; CHECK-NEXT: [[TMP17:%.*]] = and <16 x i8> [[TMP16]], <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
49 ; CHECK-NEXT: [[ARRAYIDX_I_I7_15_I_I:%.*]] = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 15
50 ; CHECK-NEXT: [[TMP18:%.*]] = bitcast i8* [[TMP0]] to <16 x i8>*
51 ; CHECK-NEXT: store <16 x i8> [[TMP17]], <16 x i8>* [[TMP18]], align 1
52 ; CHECK-NEXT: unreachable
54 ; CHECK-NEXT: ret void
57 br i1 undef, label %if.end50.i, label %if.then22.i
59 if.then22.i: ; preds = %entry
60 %sub.i = add nsw i32 undef, -1
61 %conv31.i = and i32 undef, %sub.i
62 %0 = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 0
63 %1 = trunc i32 %sub.i to i8
64 %conv.i.i1199 = and i8 %1, 1
65 store i8 %conv.i.i1199, i8* %0, align 1
66 %shr.i.i = lshr i32 %conv31.i, 1
67 %2 = trunc i32 %shr.i.i to i8
68 %conv.1.i.i = and i8 %2, 1
69 %arrayidx.i.i7.1.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 1
70 store i8 %conv.1.i.i, i8* %arrayidx.i.i7.1.i.i, align 1
71 %shr.1.i.i = lshr i32 %conv31.i, 2
72 %3 = trunc i32 %shr.1.i.i to i8
73 %conv.2.i.i = and i8 %3, 1
74 %arrayidx.i.i7.2.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 2
75 store i8 %conv.2.i.i, i8* %arrayidx.i.i7.2.i.i, align 1
76 %shr.2.i.i = lshr i32 %conv31.i, 3
77 %4 = trunc i32 %shr.2.i.i to i8
78 %conv.3.i.i = and i8 %4, 1
79 %arrayidx.i.i7.3.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 3
80 store i8 %conv.3.i.i, i8* %arrayidx.i.i7.3.i.i, align 1
81 %shr.3.i.i = lshr i32 %conv31.i, 4
82 %5 = trunc i32 %shr.3.i.i to i8
83 %conv.4.i.i = and i8 %5, 1
84 %arrayidx.i.i7.4.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 4
85 store i8 %conv.4.i.i, i8* %arrayidx.i.i7.4.i.i, align 1
86 %shr.4.i.i = lshr i32 %conv31.i, 5
87 %6 = trunc i32 %shr.4.i.i to i8
88 %conv.5.i.i = and i8 %6, 1
89 %arrayidx.i.i7.5.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 5
90 store i8 %conv.5.i.i, i8* %arrayidx.i.i7.5.i.i, align 1
91 %shr.5.i.i = lshr i32 %conv31.i, 6
92 %7 = trunc i32 %shr.5.i.i to i8
93 %conv.6.i.i = and i8 %7, 1
94 %arrayidx.i.i7.6.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 6
95 store i8 %conv.6.i.i, i8* %arrayidx.i.i7.6.i.i, align 1
96 %shr.6.i.i = lshr i32 %conv31.i, 7
97 %8 = trunc i32 %shr.6.i.i to i8
98 %conv.7.i.i = and i8 %8, 1
99 %arrayidx.i.i7.7.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 7
100 store i8 %conv.7.i.i, i8* %arrayidx.i.i7.7.i.i, align 1
101 %shr.7.i.i = lshr i32 %conv31.i, 8
102 %9 = trunc i32 %shr.7.i.i to i8
103 %conv.8.i.i = and i8 %9, 1
104 %arrayidx.i.i7.8.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 8
105 store i8 %conv.8.i.i, i8* %arrayidx.i.i7.8.i.i, align 1
106 %shr.8.i.i = lshr i32 %conv31.i, 9
107 %10 = trunc i32 %shr.8.i.i to i8
108 %conv.9.i.i = and i8 %10, 1
109 %arrayidx.i.i7.9.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 9
110 store i8 %conv.9.i.i, i8* %arrayidx.i.i7.9.i.i, align 1
111 %shr.9.i.i = lshr i32 %conv31.i, 10
112 %11 = trunc i32 %shr.9.i.i to i8
113 %conv.10.i.i = and i8 %11, 1
114 %arrayidx.i.i7.10.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 10
115 store i8 %conv.10.i.i, i8* %arrayidx.i.i7.10.i.i, align 1
116 %shr.10.i.i = lshr i32 %conv31.i, 11
117 %12 = trunc i32 %shr.10.i.i to i8
118 %conv.11.i.i = and i8 %12, 1
119 %arrayidx.i.i7.11.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 11
120 store i8 %conv.11.i.i, i8* %arrayidx.i.i7.11.i.i, align 1
121 %shr.11.i.i = lshr i32 %conv31.i, 12
122 %13 = trunc i32 %shr.11.i.i to i8
123 %conv.12.i.i = and i8 %13, 1
124 %arrayidx.i.i7.12.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 12
125 store i8 %conv.12.i.i, i8* %arrayidx.i.i7.12.i.i, align 1
126 %shr.12.i.i = lshr i32 %conv31.i, 13
127 %14 = trunc i32 %shr.12.i.i to i8
128 %conv.13.i.i = and i8 %14, 1
129 %arrayidx.i.i7.13.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 13
130 store i8 %conv.13.i.i, i8* %arrayidx.i.i7.13.i.i, align 1
131 %shr.13.i.i = lshr i32 %conv31.i, 14
132 %15 = trunc i32 %shr.13.i.i to i8
133 %conv.14.i.i = and i8 %15, 1
134 %arrayidx.i.i7.14.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 14
135 store i8 %conv.14.i.i, i8* %arrayidx.i.i7.14.i.i, align 1
136 %shr.14.i.i = lshr i32 %conv31.i, 15
137 %16 = trunc i32 %shr.14.i.i to i8
138 %conv.15.i.i = and i8 %16, 1
139 %arrayidx.i.i7.15.i.i = getelementptr inbounds %"struct.std::array", %"struct.std::array"* undef, i64 0, i32 0, i64 15
140 store i8 %conv.15.i.i, i8* %arrayidx.i.i7.15.i.i, align 1
143 if.end50.i: ; preds = %entry