1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt -passes=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(ptr %a, ptr %b, i32 %n) {
12 ; CHECK-LABEL: @PR50256(
13 ; CHECK-NEXT: [[ARRAYIDX_8:%.*]] = getelementptr inbounds i8, ptr [[A:%.*]], i64 8
14 ; CHECK-NEXT: [[ARRAYIDX3_8:%.*]] = getelementptr inbounds i16, ptr [[B:%.*]], i64 8
15 ; CHECK-NEXT: [[TMP2:%.*]] = load <8 x i8>, ptr [[A]], align 1
16 ; CHECK-NEXT: [[TMP3:%.*]] = zext <8 x i8> [[TMP2]] to <8 x i16>
17 ; CHECK-NEXT: [[TMP4:%.*]] = shl nuw <8 x i16> [[TMP3]], splat (i16 8)
18 ; CHECK-NEXT: [[TMP7:%.*]] = load <8 x i8>, ptr [[ARRAYIDX_8]], align 1
19 ; CHECK-NEXT: [[TMP8:%.*]] = zext <8 x i8> [[TMP7]] to <8 x i16>
20 ; CHECK-NEXT: [[TMP9:%.*]] = shl nuw <8 x i16> [[TMP8]], splat (i16 8)
21 ; CHECK-NEXT: store <8 x i16> [[TMP4]], ptr [[B]], align 2
22 ; CHECK-NEXT: store <8 x i16> [[TMP9]], ptr [[ARRAYIDX3_8]], align 2
23 ; CHECK-NEXT: ret void
25 %arrayidx.1 = getelementptr inbounds i8, ptr %a, i64 1
26 %arrayidx.2 = getelementptr inbounds i8, ptr %a, i64 2
27 %arrayidx.3 = getelementptr inbounds i8, ptr %a, i64 3
28 %arrayidx.4 = getelementptr inbounds i8, ptr %a, i64 4
29 %arrayidx.5 = getelementptr inbounds i8, ptr %a, i64 5
30 %arrayidx.7 = getelementptr inbounds i8, ptr %a, i64 7
31 %arrayidx.6 = getelementptr inbounds i8, ptr %a, i64 6
32 %arrayidx.8 = getelementptr inbounds i8, ptr %a, i64 8
33 %arrayidx.9 = getelementptr inbounds i8, ptr %a, i64 9
34 %arrayidx.10 = getelementptr inbounds i8, ptr %a, i64 10
35 %arrayidx.11 = getelementptr inbounds i8, ptr %a, i64 11
36 %arrayidx.12 = getelementptr inbounds i8, ptr %a, i64 12
37 %arrayidx.13 = getelementptr inbounds i8, ptr %a, i64 13
38 %arrayidx.14 = getelementptr inbounds i8, ptr %a, i64 14
39 %arrayidx.15 = getelementptr inbounds i8, ptr %a, i64 15
40 %i = load i8, ptr %a, align 1
41 %i1 = load i8, ptr %arrayidx.1, align 1
42 %i2 = load i8, ptr %arrayidx.2, align 1
43 %i3 = load i8, ptr %arrayidx.3, align 1
44 %i4 = load i8, ptr %arrayidx.4, align 1
45 %i5 = load i8, ptr %arrayidx.5, align 1
46 %i6 = load i8, ptr %arrayidx.6, align 1
47 %i7 = load i8, ptr %arrayidx.7, align 1
48 %i8 = load i8, ptr %arrayidx.8, align 1
49 %i9 = load i8, ptr %arrayidx.9, align 1
50 %i10 = load i8, ptr %arrayidx.10, align 1
51 %i11 = load i8, ptr %arrayidx.11, align 1
52 %i12 = load i8, ptr %arrayidx.12, align 1
53 %i13 = load i8, ptr %arrayidx.13, align 1
54 %i14 = load i8, ptr %arrayidx.14, align 1
55 %i15 = load i8, ptr %arrayidx.15, align 1
56 %conv5 = zext i8 %i to i16
57 %conv5.1 = zext i8 %i1 to i16
58 %conv5.2 = zext i8 %i2 to i16
59 %conv5.3 = zext i8 %i3 to i16
60 %conv5.4 = zext i8 %i4 to i16
61 %conv5.5 = zext i8 %i5 to i16
62 %conv5.6 = zext i8 %i6 to i16
63 %conv5.7 = zext i8 %i7 to i16
64 %conv5.8 = zext i8 %i8 to i16
65 %conv5.9 = zext i8 %i9 to i16
66 %conv5.10 = zext i8 %i10 to i16
67 %conv5.11 = zext i8 %i11 to i16
68 %conv5.12 = zext i8 %i12 to i16
69 %conv5.13 = zext i8 %i13 to i16
70 %conv5.14 = zext i8 %i14 to i16
71 %conv5.15 = zext i8 %i15 to i16
72 %shl = shl nuw i16 %conv5, 8
73 %shl.1 = shl nuw i16 %conv5.1, 8
74 %shl.2 = shl nuw i16 %conv5.2, 8
75 %shl.3 = shl nuw i16 %conv5.3, 8
76 %shl.4 = shl nuw i16 %conv5.4, 8
77 %shl.5 = shl nuw i16 %conv5.5, 8
78 %shl.6 = shl nuw i16 %conv5.6, 8
79 %shl.7 = shl nuw i16 %conv5.7, 8
80 %shl.8 = shl nuw i16 %conv5.8, 8
81 %shl.9 = shl nuw i16 %conv5.9, 8
82 %shl.10 = shl nuw i16 %conv5.10, 8
83 %shl.11 = shl nuw i16 %conv5.11, 8
84 %shl.12 = shl nuw i16 %conv5.12, 8
85 %shl.13 = shl nuw i16 %conv5.13, 8
86 %shl.14 = shl nuw i16 %conv5.14, 8
87 %shl.15 = shl nuw i16 %conv5.15, 8
88 %arrayidx3.1 = getelementptr inbounds i16, ptr %b, i64 1
89 %arrayidx3.2 = getelementptr inbounds i16, ptr %b, i64 2
90 %arrayidx3.3 = getelementptr inbounds i16, ptr %b, i64 3
91 %arrayidx3.4 = getelementptr inbounds i16, ptr %b, i64 4
92 %arrayidx3.5 = getelementptr inbounds i16, ptr %b, i64 5
93 %arrayidx3.6 = getelementptr inbounds i16, ptr %b, i64 6
94 %arrayidx3.7 = getelementptr inbounds i16, ptr %b, i64 7
95 %arrayidx3.8 = getelementptr inbounds i16, ptr %b, i64 8
96 %arrayidx3.9 = getelementptr inbounds i16, ptr %b, i64 9
97 %arrayidx3.10 = getelementptr inbounds i16, ptr %b, i64 10
98 %arrayidx3.11 = getelementptr inbounds i16, ptr %b, i64 11
99 %arrayidx3.12 = getelementptr inbounds i16, ptr %b, i64 12
100 %arrayidx3.13 = getelementptr inbounds i16, ptr %b, i64 13
101 %arrayidx3.14 = getelementptr inbounds i16, ptr %b, i64 14
102 %arrayidx3.15 = getelementptr inbounds i16, ptr %b, i64 15
103 store i16 %shl, ptr %b, align 2
104 store i16 %shl.1, ptr %arrayidx3.1, align 2
105 store i16 %shl.2, ptr %arrayidx3.2, align 2
106 store i16 %shl.3, ptr %arrayidx3.3, align 2
107 store i16 %shl.4, ptr %arrayidx3.4, align 2
108 store i16 %shl.5, ptr %arrayidx3.5, align 2
109 store i16 %shl.6, ptr %arrayidx3.6, align 2
110 store i16 %shl.7, ptr %arrayidx3.7, align 2
111 store i16 %shl.8, ptr %arrayidx3.8, align 2
112 store i16 %shl.9, ptr %arrayidx3.9, align 2
113 store i16 %shl.10, ptr %arrayidx3.10, align 2
114 store i16 %shl.11, ptr %arrayidx3.11, align 2
115 store i16 %shl.12, ptr %arrayidx3.12, align 2
116 store i16 %shl.13, ptr %arrayidx3.13, align 2
117 store i16 %shl.14, ptr %arrayidx3.14, align 2
118 store i16 %shl.15, ptr %arrayidx3.15, align 2