1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -slp-vectorizer -S < %s | FileCheck %s
4 target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64"
7 ; This should not be matched as a load combining candidate.
8 ; There are no 'or' operations, so it can't be a bswap or
9 ; other pattern that we are expecting the backend to handle.
11 define void @PR50256(i8* %a, i16* %b, i32 %n) {
12 ; CHECK-LABEL: @PR50256(
13 ; CHECK-NEXT: [[ARRAYIDX_1:%.*]] = getelementptr inbounds i8, i8* [[A:%.*]], i64 1
14 ; CHECK-NEXT: [[ARRAYIDX_2:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 2
15 ; CHECK-NEXT: [[ARRAYIDX_3:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 3
16 ; CHECK-NEXT: [[ARRAYIDX_4:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 4
17 ; CHECK-NEXT: [[ARRAYIDX_5:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 5
18 ; CHECK-NEXT: [[ARRAYIDX_7:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 7
19 ; CHECK-NEXT: [[ARRAYIDX_6:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 6
20 ; CHECK-NEXT: [[ARRAYIDX_8:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 8
21 ; CHECK-NEXT: [[ARRAYIDX_9:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 9
22 ; CHECK-NEXT: [[ARRAYIDX_10:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 10
23 ; CHECK-NEXT: [[ARRAYIDX_11:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 11
24 ; CHECK-NEXT: [[ARRAYIDX_12:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 12
25 ; CHECK-NEXT: [[ARRAYIDX_13:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 13
26 ; CHECK-NEXT: [[ARRAYIDX_14:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 14
27 ; CHECK-NEXT: [[ARRAYIDX_15:%.*]] = getelementptr inbounds i8, i8* [[A]], i64 15
28 ; CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[A]] to <8 x i8>*
29 ; CHECK-NEXT: [[TMP2:%.*]] = load <8 x i8>, <8 x i8>* [[TMP1]], align 1
30 ; CHECK-NEXT: [[TMP3:%.*]] = bitcast i8* [[ARRAYIDX_8]] to <8 x i8>*
31 ; CHECK-NEXT: [[TMP4:%.*]] = load <8 x i8>, <8 x i8>* [[TMP3]], align 1
32 ; CHECK-NEXT: [[TMP5:%.*]] = zext <8 x i8> [[TMP2]] to <8 x i16>
33 ; CHECK-NEXT: [[TMP6:%.*]] = zext <8 x i8> [[TMP4]] to <8 x i16>
34 ; CHECK-NEXT: [[TMP7:%.*]] = shl nuw <8 x i16> [[TMP5]], <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
35 ; CHECK-NEXT: [[TMP8:%.*]] = shl nuw <8 x i16> [[TMP6]], <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
36 ; CHECK-NEXT: [[ARRAYIDX3_1:%.*]] = getelementptr inbounds i16, i16* [[B:%.*]], i64 1
37 ; CHECK-NEXT: [[ARRAYIDX3_2:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 2
38 ; CHECK-NEXT: [[ARRAYIDX3_3:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 3
39 ; CHECK-NEXT: [[ARRAYIDX3_4:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 4
40 ; CHECK-NEXT: [[ARRAYIDX3_5:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 5
41 ; CHECK-NEXT: [[ARRAYIDX3_6:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 6
42 ; CHECK-NEXT: [[ARRAYIDX3_7:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 7
43 ; CHECK-NEXT: [[ARRAYIDX3_8:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 8
44 ; CHECK-NEXT: [[ARRAYIDX3_9:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 9
45 ; CHECK-NEXT: [[ARRAYIDX3_10:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 10
46 ; CHECK-NEXT: [[ARRAYIDX3_11:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 11
47 ; CHECK-NEXT: [[ARRAYIDX3_12:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 12
48 ; CHECK-NEXT: [[ARRAYIDX3_13:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 13
49 ; CHECK-NEXT: [[ARRAYIDX3_14:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 14
50 ; CHECK-NEXT: [[ARRAYIDX3_15:%.*]] = getelementptr inbounds i16, i16* [[B]], i64 15
51 ; CHECK-NEXT: [[TMP9:%.*]] = bitcast i16* [[B]] to <8 x i16>*
52 ; CHECK-NEXT: store <8 x i16> [[TMP7]], <8 x i16>* [[TMP9]], align 2
53 ; CHECK-NEXT: [[TMP10:%.*]] = bitcast i16* [[ARRAYIDX3_8]] to <8 x i16>*
54 ; CHECK-NEXT: store <8 x i16> [[TMP8]], <8 x i16>* [[TMP10]], align 2
55 ; CHECK-NEXT: ret void
57 %arrayidx.1 = getelementptr inbounds i8, i8* %a, i64 1
58 %arrayidx.2 = getelementptr inbounds i8, i8* %a, i64 2
59 %arrayidx.3 = getelementptr inbounds i8, i8* %a, i64 3
60 %arrayidx.4 = getelementptr inbounds i8, i8* %a, i64 4
61 %arrayidx.5 = getelementptr inbounds i8, i8* %a, i64 5
62 %arrayidx.7 = getelementptr inbounds i8, i8* %a, i64 7
63 %arrayidx.6 = getelementptr inbounds i8, i8* %a, i64 6
64 %arrayidx.8 = getelementptr inbounds i8, i8* %a, i64 8
65 %arrayidx.9 = getelementptr inbounds i8, i8* %a, i64 9
66 %arrayidx.10 = getelementptr inbounds i8, i8* %a, i64 10
67 %arrayidx.11 = getelementptr inbounds i8, i8* %a, i64 11
68 %arrayidx.12 = getelementptr inbounds i8, i8* %a, i64 12
69 %arrayidx.13 = getelementptr inbounds i8, i8* %a, i64 13
70 %arrayidx.14 = getelementptr inbounds i8, i8* %a, i64 14
71 %arrayidx.15 = getelementptr inbounds i8, i8* %a, i64 15
72 %i = load i8, i8* %a, align 1
73 %i1 = load i8, i8* %arrayidx.1, align 1
74 %i2 = load i8, i8* %arrayidx.2, align 1
75 %i3 = load i8, i8* %arrayidx.3, align 1
76 %i4 = load i8, i8* %arrayidx.4, align 1
77 %i5 = load i8, i8* %arrayidx.5, align 1
78 %i6 = load i8, i8* %arrayidx.6, align 1
79 %i7 = load i8, i8* %arrayidx.7, align 1
80 %i8 = load i8, i8* %arrayidx.8, align 1
81 %i9 = load i8, i8* %arrayidx.9, align 1
82 %i10 = load i8, i8* %arrayidx.10, align 1
83 %i11 = load i8, i8* %arrayidx.11, align 1
84 %i12 = load i8, i8* %arrayidx.12, align 1
85 %i13 = load i8, i8* %arrayidx.13, align 1
86 %i14 = load i8, i8* %arrayidx.14, align 1
87 %i15 = load i8, i8* %arrayidx.15, align 1
88 %conv5 = zext i8 %i to i16
89 %conv5.1 = zext i8 %i1 to i16
90 %conv5.2 = zext i8 %i2 to i16
91 %conv5.3 = zext i8 %i3 to i16
92 %conv5.4 = zext i8 %i4 to i16
93 %conv5.5 = zext i8 %i5 to i16
94 %conv5.6 = zext i8 %i6 to i16
95 %conv5.7 = zext i8 %i7 to i16
96 %conv5.8 = zext i8 %i8 to i16
97 %conv5.9 = zext i8 %i9 to i16
98 %conv5.10 = zext i8 %i10 to i16
99 %conv5.11 = zext i8 %i11 to i16
100 %conv5.12 = zext i8 %i12 to i16
101 %conv5.13 = zext i8 %i13 to i16
102 %conv5.14 = zext i8 %i14 to i16
103 %conv5.15 = zext i8 %i15 to i16
104 %shl = shl nuw i16 %conv5, 8
105 %shl.1 = shl nuw i16 %conv5.1, 8
106 %shl.2 = shl nuw i16 %conv5.2, 8
107 %shl.3 = shl nuw i16 %conv5.3, 8
108 %shl.4 = shl nuw i16 %conv5.4, 8
109 %shl.5 = shl nuw i16 %conv5.5, 8
110 %shl.6 = shl nuw i16 %conv5.6, 8
111 %shl.7 = shl nuw i16 %conv5.7, 8
112 %shl.8 = shl nuw i16 %conv5.8, 8
113 %shl.9 = shl nuw i16 %conv5.9, 8
114 %shl.10 = shl nuw i16 %conv5.10, 8
115 %shl.11 = shl nuw i16 %conv5.11, 8
116 %shl.12 = shl nuw i16 %conv5.12, 8
117 %shl.13 = shl nuw i16 %conv5.13, 8
118 %shl.14 = shl nuw i16 %conv5.14, 8
119 %shl.15 = shl nuw i16 %conv5.15, 8
120 %arrayidx3.1 = getelementptr inbounds i16, i16* %b, i64 1
121 %arrayidx3.2 = getelementptr inbounds i16, i16* %b, i64 2
122 %arrayidx3.3 = getelementptr inbounds i16, i16* %b, i64 3
123 %arrayidx3.4 = getelementptr inbounds i16, i16* %b, i64 4
124 %arrayidx3.5 = getelementptr inbounds i16, i16* %b, i64 5
125 %arrayidx3.6 = getelementptr inbounds i16, i16* %b, i64 6
126 %arrayidx3.7 = getelementptr inbounds i16, i16* %b, i64 7
127 %arrayidx3.8 = getelementptr inbounds i16, i16* %b, i64 8
128 %arrayidx3.9 = getelementptr inbounds i16, i16* %b, i64 9
129 %arrayidx3.10 = getelementptr inbounds i16, i16* %b, i64 10
130 %arrayidx3.11 = getelementptr inbounds i16, i16* %b, i64 11
131 %arrayidx3.12 = getelementptr inbounds i16, i16* %b, i64 12
132 %arrayidx3.13 = getelementptr inbounds i16, i16* %b, i64 13
133 %arrayidx3.14 = getelementptr inbounds i16, i16* %b, i64 14
134 %arrayidx3.15 = getelementptr inbounds i16, i16* %b, i64 15
135 store i16 %shl, i16* %b, align 2
136 store i16 %shl.1, i16* %arrayidx3.1, align 2
137 store i16 %shl.2, i16* %arrayidx3.2, align 2
138 store i16 %shl.3, i16* %arrayidx3.3, align 2
139 store i16 %shl.4, i16* %arrayidx3.4, align 2
140 store i16 %shl.5, i16* %arrayidx3.5, align 2
141 store i16 %shl.6, i16* %arrayidx3.6, align 2
142 store i16 %shl.7, i16* %arrayidx3.7, align 2
143 store i16 %shl.8, i16* %arrayidx3.8, align 2
144 store i16 %shl.9, i16* %arrayidx3.9, align 2
145 store i16 %shl.10, i16* %arrayidx3.10, align 2
146 store i16 %shl.11, i16* %arrayidx3.11, align 2
147 store i16 %shl.12, i16* %arrayidx3.12, align 2
148 store i16 %shl.13, i16* %arrayidx3.13, align 2
149 store i16 %shl.14, i16* %arrayidx3.14, align 2
150 store i16 %shl.15, i16* %arrayidx3.15, align 2