1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -passes=slp-vectorizer -mtriple=arm64-apple-ios -S %s | FileCheck %s
4 define void @v15_load_i8_mul_by_constant_store(ptr %src, ptr noalias %dst) {
5 ; CHECK-LABEL: define void @v15_load_i8_mul_by_constant_store(
6 ; CHECK-SAME: ptr [[SRC:%.*]], ptr noalias [[DST:%.*]]) {
8 ; CHECK-NEXT: [[GEP_SRC_0:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i8 0
9 ; CHECK-NEXT: [[TMP0:%.*]] = load <8 x i8>, ptr [[GEP_SRC_0]], align 4
10 ; CHECK-NEXT: [[TMP1:%.*]] = mul nsw <8 x i8> [[TMP0]], <i8 10, i8 10, i8 10, i8 10, i8 10, i8 10, i8 10, i8 10>
11 ; CHECK-NEXT: store <8 x i8> [[TMP1]], ptr [[DST]], align 1
12 ; CHECK-NEXT: [[GEP_SRC_8:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i8 8
13 ; CHECK-NEXT: [[DST_8:%.*]] = getelementptr i8, ptr [[DST]], i8 8
14 ; CHECK-NEXT: [[TMP2:%.*]] = load <4 x i8>, ptr [[GEP_SRC_8]], align 4
15 ; CHECK-NEXT: [[TMP3:%.*]] = mul nsw <4 x i8> [[TMP2]], <i8 10, i8 10, i8 10, i8 10>
16 ; CHECK-NEXT: store <4 x i8> [[TMP3]], ptr [[DST_8]], align 1
17 ; CHECK-NEXT: [[GEP_SRC_12:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i8 12
18 ; CHECK-NEXT: [[L_SRC_12:%.*]] = load i8, ptr [[GEP_SRC_12]], align 4
19 ; CHECK-NEXT: [[MUL_12:%.*]] = mul nsw i8 [[L_SRC_12]], 10
20 ; CHECK-NEXT: [[DST_12:%.*]] = getelementptr i8, ptr [[DST]], i8 12
21 ; CHECK-NEXT: store i8 [[MUL_12]], ptr [[DST_12]], align 1
22 ; CHECK-NEXT: [[GEP_SRC_13:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i8 13
23 ; CHECK-NEXT: [[L_SRC_13:%.*]] = load i8, ptr [[GEP_SRC_13]], align 4
24 ; CHECK-NEXT: [[MUL_13:%.*]] = mul nsw i8 [[L_SRC_13]], 10
25 ; CHECK-NEXT: [[DST_13:%.*]] = getelementptr i8, ptr [[DST]], i8 13
26 ; CHECK-NEXT: store i8 [[MUL_13]], ptr [[DST_13]], align 1
27 ; CHECK-NEXT: [[GEP_SRC_14:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i8 14
28 ; CHECK-NEXT: [[L_SRC_14:%.*]] = load i8, ptr [[GEP_SRC_14]], align 4
29 ; CHECK-NEXT: [[MUL_14:%.*]] = mul nsw i8 [[L_SRC_14]], 10
30 ; CHECK-NEXT: [[DST_14:%.*]] = getelementptr i8, ptr [[DST]], i8 14
31 ; CHECK-NEXT: store i8 [[MUL_14]], ptr [[DST_14]], align 1
32 ; CHECK-NEXT: ret void
35 %gep.src.0 = getelementptr inbounds i8, ptr %src, i8 0
36 %l.src.0 = load i8, ptr %gep.src.0, align 4
37 %mul.0 = mul nsw i8 %l.src.0, 10
38 store i8 %mul.0, ptr %dst
40 %gep.src.1 = getelementptr inbounds i8, ptr %src, i8 1
41 %l.src.1 = load i8, ptr %gep.src.1, align 4
42 %mul.1 = mul nsw i8 %l.src.1, 10
43 %dst.1 = getelementptr i8, ptr %dst, i8 1
44 store i8 %mul.1, ptr %dst.1
46 %gep.src.2 = getelementptr inbounds i8, ptr %src, i8 2
47 %l.src.2 = load i8, ptr %gep.src.2, align 4
48 %mul.2 = mul nsw i8 %l.src.2, 10
49 %dst.2 = getelementptr i8, ptr %dst, i8 2
50 store i8 %mul.2, ptr %dst.2
52 %gep.src.3 = getelementptr inbounds i8, ptr %src, i8 3
53 %l.src.3 = load i8, ptr %gep.src.3, align 4
54 %mul.3 = mul nsw i8 %l.src.3, 10
55 %dst.3 = getelementptr i8, ptr %dst, i8 3
56 store i8 %mul.3, ptr %dst.3
58 %gep.src.4 = getelementptr inbounds i8, ptr %src, i8 4
59 %l.src.4 = load i8, ptr %gep.src.4, align 4
60 %mul.4 = mul nsw i8 %l.src.4, 10
61 %dst.4 = getelementptr i8, ptr %dst, i8 4
62 store i8 %mul.4, ptr %dst.4
64 %gep.src.5 = getelementptr inbounds i8, ptr %src, i8 5
65 %l.src.5 = load i8, ptr %gep.src.5, align 4
66 %mul.5 = mul nsw i8 %l.src.5, 10
67 %dst.5 = getelementptr i8, ptr %dst, i8 5
68 store i8 %mul.5, ptr %dst.5
70 %gep.src.6 = getelementptr inbounds i8, ptr %src, i8 6
71 %l.src.6 = load i8, ptr %gep.src.6, align 4
72 %mul.6 = mul nsw i8 %l.src.6, 10
73 %dst.6 = getelementptr i8, ptr %dst, i8 6
74 store i8 %mul.6, ptr %dst.6
76 %gep.src.7 = getelementptr inbounds i8, ptr %src, i8 7
77 %l.src.7 = load i8, ptr %gep.src.7, align 4
78 %mul.7 = mul nsw i8 %l.src.7, 10
79 %dst.7 = getelementptr i8, ptr %dst, i8 7
80 store i8 %mul.7, ptr %dst.7
82 %gep.src.8 = getelementptr inbounds i8, ptr %src, i8 8
83 %l.src.8 = load i8, ptr %gep.src.8, align 4
84 %mul.8 = mul nsw i8 %l.src.8, 10
85 %dst.8 = getelementptr i8, ptr %dst, i8 8
86 store i8 %mul.8, ptr %dst.8
88 %gep.src.9 = getelementptr inbounds i8, ptr %src, i8 9
89 %l.src.9 = load i8, ptr %gep.src.9, align 4
90 %mul.9 = mul nsw i8 %l.src.9, 10
91 %dst.9 = getelementptr i8, ptr %dst, i8 9
92 store i8 %mul.9, ptr %dst.9
94 %gep.src.10 = getelementptr inbounds i8, ptr %src, i8 10
95 %l.src.10 = load i8, ptr %gep.src.10, align 4
96 %mul.10 = mul nsw i8 %l.src.10, 10
97 %dst.10 = getelementptr i8, ptr %dst, i8 10
98 store i8 %mul.10, ptr %dst.10
100 %gep.src.11 = getelementptr inbounds i8, ptr %src, i8 11
101 %l.src.11 = load i8, ptr %gep.src.11, align 4
102 %mul.11 = mul nsw i8 %l.src.11, 10
103 %dst.11 = getelementptr i8, ptr %dst, i8 11
104 store i8 %mul.11, ptr %dst.11
106 %gep.src.12 = getelementptr inbounds i8, ptr %src, i8 12
107 %l.src.12 = load i8, ptr %gep.src.12, align 4
108 %mul.12 = mul nsw i8 %l.src.12, 10
109 %dst.12 = getelementptr i8, ptr %dst, i8 12
110 store i8 %mul.12, ptr %dst.12
112 %gep.src.13 = getelementptr inbounds i8, ptr %src, i8 13
113 %l.src.13 = load i8, ptr %gep.src.13, align 4
114 %mul.13 = mul nsw i8 %l.src.13, 10
115 %dst.13 = getelementptr i8, ptr %dst, i8 13
116 store i8 %mul.13, ptr %dst.13
118 %gep.src.14 = getelementptr inbounds i8, ptr %src, i8 14
119 %l.src.14 = load i8, ptr %gep.src.14, align 4
120 %mul.14 = mul nsw i8 %l.src.14, 10
121 %dst.14 = getelementptr i8, ptr %dst, i8 14
122 store i8 %mul.14, ptr %dst.14