File: sink-mul-exts.ll

package info (click to toggle)
llvm-toolchain-20 1%3A20.1.6-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,111,304 kB
  • sloc: cpp: 7,438,677; ansic: 1,393,822; asm: 1,012,926; python: 241,650; f90: 86,635; objc: 75,479; lisp: 42,144; pascal: 17,286; sh: 10,027; ml: 5,082; perl: 4,730; awk: 3,523; makefile: 3,349; javascript: 2,251; xml: 892; fortran: 672
file content (232 lines) | stat: -rw-r--r-- 7,331 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=aarch64-linux-gnu -o - %s | FileCheck %s

define <8 x i16> @mul_splat_sext_v8i16(ptr %x, ptr %y) {
; CHECK-LABEL: mul_splat_sext_v8i16:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    ldr d1, [x0]
; CHECK-NEXT:    movi v0.2d, #0000000000000000
; CHECK-NEXT:    mov x8, xzr
; CHECK-NEXT:    dup v1.8b, v1.b[3]
; CHECK-NEXT:  .LBB0_1: // %l1
; CHECK-NEXT:    // =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    ldr d2, [x1, x8]
; CHECK-NEXT:    add x8, x8, #4
; CHECK-NEXT:    cmp w8, #4
; CHECK-NEXT:    smlal v0.8h, v2.8b, v1.8b
; CHECK-NEXT:    b.eq .LBB0_1
; CHECK-NEXT:  // %bb.2: // %l2
; CHECK-NEXT:    ret
entry:
  %x.val = load <8 x i8>, ptr %x
  %x.ext = sext <8 x i8> %x.val to <8 x i16>
  %a = shufflevector <8 x i16> %x.ext, <8 x i16> undef, <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
  br label %l1

l1:
  %p = phi i32 [ 0, %entry ], [ %pa, %l1 ]
  %q = phi <8 x i16> [ zeroinitializer, %entry ], [ %c, %l1 ]
  %y.idx = mul nuw nsw i32 %p, 4
  %y.ptr = getelementptr i8, ptr %y, i32 %y.idx
  %y.val = load <8 x i8>, ptr %y.ptr
  %y.ext = sext <8 x i8> %y.val to <8 x i16>
  %b = mul <8 x i16> %y.ext, %a
  %c = add <8 x i16> %q, %b
  %pa = add i32 %p, 1
  %c1 = icmp eq i32 %p, 0
  br i1 %c1, label %l1, label %l2

l2:
  ret <8 x i16> %c
}

define <4 x i32> @mul_splat_sext_v4i32(ptr %x, ptr %y) {
; CHECK-LABEL: mul_splat_sext_v4i32:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    movi v0.2d, #0000000000000000
; CHECK-NEXT:    ldr d1, [x0]
; CHECK-NEXT:    mov x8, xzr
; CHECK-NEXT:  .LBB1_1: // %l1
; CHECK-NEXT:    // =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    ldr d2, [x1, x8]
; CHECK-NEXT:    add x8, x8, #8
; CHECK-NEXT:    cmp w8, #8
; CHECK-NEXT:    smlal v0.4s, v2.4h, v1.h[3]
; CHECK-NEXT:    b.eq .LBB1_1
; CHECK-NEXT:  // %bb.2: // %l2
; CHECK-NEXT:    ret
entry:
  %x.val = load <4 x i16>, ptr %x
  %x.ext = sext <4 x i16> %x.val to <4 x i32>
  %a = shufflevector <4 x i32> %x.ext, <4 x i32> undef, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
  br label %l1

l1:
  %p = phi i32 [ 0, %entry ], [ %pa, %l1 ]
  %q = phi <4 x i32> [ zeroinitializer, %entry ], [ %c, %l1 ]
  %y.idx = mul nuw nsw i32 %p, 4
  %y.ptr = getelementptr i16, ptr %y, i32 %y.idx
  %y.val = load <4 x i16>, ptr %y.ptr
  %y.ext = sext <4 x i16> %y.val to <4 x i32>
  %b = mul <4 x i32> %y.ext, %a
  %c = add <4 x i32> %q, %b
  %pa = add i32 %p, 1
  %c1 = icmp eq i32 %p, 0
  br i1 %c1, label %l1, label %l2

l2:
  ret <4 x i32> %c
}

define <2 x i64> @mul_splat_sext_v2i64(ptr %x, ptr %y) {
; CHECK-LABEL: mul_splat_sext_v2i64:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    movi v0.2d, #0000000000000000
; CHECK-NEXT:    ldr d1, [x0]
; CHECK-NEXT:    mov x8, xzr
; CHECK-NEXT:  .LBB2_1: // %l1
; CHECK-NEXT:    // =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    ldr d2, [x1, x8]
; CHECK-NEXT:    add x8, x8, #16
; CHECK-NEXT:    cmp w8, #16
; CHECK-NEXT:    smlal v0.2d, v2.2s, v1.s[1]
; CHECK-NEXT:    b.eq .LBB2_1
; CHECK-NEXT:  // %bb.2: // %l2
; CHECK-NEXT:    ret
entry:
  %x.val = load <2 x i32>, ptr %x
  %x.ext = sext <2 x i32> %x.val to <2 x i64>
  %a = shufflevector <2 x i64> %x.ext, <2 x i64> undef, <2 x i32> <i32 1, i32 1>
  br label %l1

l1:
  %p = phi i32 [ 0, %entry ], [ %pa, %l1 ]
  %q = phi <2 x i64> [ zeroinitializer, %entry ], [ %c, %l1 ]
  %y.idx = mul nuw nsw i32 %p, 4
  %y.ptr = getelementptr i32, ptr %y, i32 %y.idx
  %y.val = load <2 x i32>, ptr %y.ptr
  %y.ext = sext <2 x i32> %y.val to <2 x i64>
  %b = mul <2 x i64> %y.ext, %a
  %c = add <2 x i64> %q, %b
  %pa = add i32 %p, 1
  %c1 = icmp eq i32 %p, 0
  br i1 %c1, label %l1, label %l2

l2:
  ret <2 x i64> %c
}

define <8 x i16> @mul_sext_splat_v8i16(ptr %x, ptr %y) {
; CHECK-LABEL: mul_sext_splat_v8i16:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    ldr d1, [x0]
; CHECK-NEXT:    movi v0.2d, #0000000000000000
; CHECK-NEXT:    mov x8, xzr
; CHECK-NEXT:    dup v1.8b, v1.b[3]
; CHECK-NEXT:  .LBB3_1: // %l1
; CHECK-NEXT:    // =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    ldr d2, [x1, x8]
; CHECK-NEXT:    add x8, x8, #4
; CHECK-NEXT:    cmp w8, #4
; CHECK-NEXT:    smlal v0.8h, v2.8b, v1.8b
; CHECK-NEXT:    b.eq .LBB3_1
; CHECK-NEXT:  // %bb.2: // %l2
; CHECK-NEXT:    ret
entry:
  %x.val = load <8 x i8>, ptr %x
  %x.spt = shufflevector <8 x i8> %x.val, <8 x i8> undef, <8 x i32> <i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3, i32 3>
  %a = sext <8 x i8> %x.spt to <8 x i16>
  br label %l1

l1:
  %p = phi i32 [ 0, %entry ], [ %pa, %l1 ]
  %q = phi <8 x i16> [ zeroinitializer, %entry ], [ %c, %l1 ]
  %y.idx = mul nuw nsw i32 %p, 4
  %y.ptr = getelementptr i8, ptr %y, i32 %y.idx
  %y.val = load <8 x i8>, ptr %y.ptr
  %y.ext = sext <8 x i8> %y.val to <8 x i16>
  %b = mul <8 x i16> %y.ext, %a
  %c = add <8 x i16> %q, %b
  %pa = add i32 %p, 1
  %c1 = icmp eq i32 %p, 0
  br i1 %c1, label %l1, label %l2

l2:
  ret <8 x i16> %c
}

define <4 x i32> @mul_sext_splat_v4i32(ptr %x, ptr %y) {
; CHECK-LABEL: mul_sext_splat_v4i32:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    movi v0.2d, #0000000000000000
; CHECK-NEXT:    ldr d1, [x0]
; CHECK-NEXT:    mov x8, xzr
; CHECK-NEXT:  .LBB4_1: // %l1
; CHECK-NEXT:    // =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    ldr d2, [x1, x8]
; CHECK-NEXT:    add x8, x8, #8
; CHECK-NEXT:    cmp w8, #8
; CHECK-NEXT:    smlal v0.4s, v2.4h, v1.h[3]
; CHECK-NEXT:    b.eq .LBB4_1
; CHECK-NEXT:  // %bb.2: // %l2
; CHECK-NEXT:    ret
entry:
  %x.val = load <4 x i16>, ptr %x
  %x.spt = shufflevector <4 x i16> %x.val, <4 x i16> undef, <4 x i32> <i32 3, i32 3, i32 3, i32 3>
  %a = sext <4 x i16> %x.spt to <4 x i32>
  br label %l1

l1:
  %p = phi i32 [ 0, %entry ], [ %pa, %l1 ]
  %q = phi <4 x i32> [ zeroinitializer, %entry ], [ %c, %l1 ]
  %y.idx = mul nuw nsw i32 %p, 4
  %y.ptr = getelementptr i16, ptr %y, i32 %y.idx
  %y.val = load <4 x i16>, ptr %y.ptr
  %y.ext = sext <4 x i16> %y.val to <4 x i32>
  %b = mul <4 x i32> %y.ext, %a
  %c = add <4 x i32> %q, %b
  %pa = add i32 %p, 1
  %c1 = icmp eq i32 %p, 0
  br i1 %c1, label %l1, label %l2

l2:
  ret <4 x i32> %c
}

define <2 x i64> @mul_sext_splat_v2i64(ptr %x, ptr %y) {
; CHECK-LABEL: mul_sext_splat_v2i64:
; CHECK:       // %bb.0: // %entry
; CHECK-NEXT:    movi v0.2d, #0000000000000000
; CHECK-NEXT:    ldr d1, [x0]
; CHECK-NEXT:    mov x8, xzr
; CHECK-NEXT:  .LBB5_1: // %l1
; CHECK-NEXT:    // =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    ldr d2, [x1, x8]
; CHECK-NEXT:    add x8, x8, #16
; CHECK-NEXT:    cmp w8, #16
; CHECK-NEXT:    smlal v0.2d, v2.2s, v1.s[1]
; CHECK-NEXT:    b.eq .LBB5_1
; CHECK-NEXT:  // %bb.2: // %l2
; CHECK-NEXT:    ret
entry:
  %x.val = load <2 x i32>, ptr %x
  %x.spt = shufflevector <2 x i32> %x.val, <2 x i32> undef, <2 x i32> <i32 1, i32 1>
  %a = sext <2 x i32> %x.spt to <2 x i64>
  br label %l1

l1:
  %p = phi i32 [ 0, %entry ], [ %pa, %l1 ]
  %q = phi <2 x i64> [ zeroinitializer, %entry ], [ %c, %l1 ]
  %y.idx = mul nuw nsw i32 %p, 4
  %y.ptr = getelementptr i32, ptr %y, i32 %y.idx
  %y.val = load <2 x i32>, ptr %y.ptr
  %y.ext = sext <2 x i32> %y.val to <2 x i64>
  %b = mul <2 x i64> %y.ext, %a
  %c = add <2 x i64> %q, %b
  %pa = add i32 %p, 1
  %c1 = icmp eq i32 %p, 0
  br i1 %c1, label %l1, label %l2

l2:
  ret <2 x i64> %c
}