@@ -119,14 +119,17 @@ define void @msubpt1(i32 %index, i32 %elem) {
119119; CHECK-CPA-O0: // %bb.0: // %entry
120120; CHECK-CPA-O0-NEXT: // implicit-def: $x8
121121; CHECK-CPA-O0-NEXT: mov w8, w0
122- ; CHECK-CPA-O0-NEXT: sxtw x8 , w8
123- ; CHECK-CPA-O0-NEXT: mov w9, #48 // =0x30
124- ; CHECK-CPA-O0-NEXT: // kill: def $x9 killed $w9
125- ; CHECK-CPA-O0-NEXT: mneg x8, x8, x9
126- ; CHECK-CPA-O0-NEXT: add x8 , x8, #288
122+ ; CHECK-CPA-O0-NEXT: sxtw x9 , w8
123+ ; CHECK-CPA-O0-NEXT: mov x8, xzr
124+ ; CHECK-CPA-O0-NEXT: subs x8, x8, x9
125+ ; CHECK-CPA-O0-NEXT: lsl x8, x8, #1
126+ ; CHECK-CPA-O0-NEXT: subs x10 , x8, x9
127127; CHECK-CPA-O0-NEXT: adrp x9, array2
128128; CHECK-CPA-O0-NEXT: add x9, x9, :lo12:array2
129+ ; CHECK-CPA-O0-NEXT: mov w8, #288 // =0x120
130+ ; CHECK-CPA-O0-NEXT: // kill: def $x8 killed $w8
129131; CHECK-CPA-O0-NEXT: addpt x8, x9, x8
132+ ; CHECK-CPA-O0-NEXT: addpt x8, x8, x10, lsl #4
130133; CHECK-CPA-O0-NEXT: mov w10, #96 // =0x60
131134; CHECK-CPA-O0-NEXT: // kill: def $x10 killed $w10
132135; CHECK-CPA-O0-NEXT: addpt x10, x9, x10
@@ -141,19 +144,21 @@ define void @msubpt1(i32 %index, i32 %elem) {
141144; CHECK-CPA-O3-LABEL: msubpt1:
142145; CHECK-CPA-O3: // %bb.0: // %entry
143146; CHECK-CPA-O3-NEXT: // kill: def $w0 killed $w0 def $x0
144- ; CHECK-CPA-O3-NEXT: sxtw x8, w0
145- ; CHECK-CPA-O3-NEXT: mov w9, #48 // =0x30
146- ; CHECK-CPA-O3-NEXT: adrp x10, array2
147- ; CHECK-CPA-O3-NEXT: add x10, x10, :lo12:array2
148- ; CHECK-CPA-O3-NEXT: mneg x8, x8, x9
149- ; CHECK-CPA-O3-NEXT: mov w9, #96 // =0x60
150- ; CHECK-CPA-O3-NEXT: ldr q2, [x10, #96]
151- ; CHECK-CPA-O3-NEXT: addpt x9, x10, x9
152- ; CHECK-CPA-O3-NEXT: ldp q1, q0, [x9, #16]
153- ; CHECK-CPA-O3-NEXT: add x8, x8, #288
154- ; CHECK-CPA-O3-NEXT: addpt x8, x10, x8
155- ; CHECK-CPA-O3-NEXT: stp q1, q0, [x8, #16]
156- ; CHECK-CPA-O3-NEXT: str q2, [x8]
147+ ; CHECK-CPA-O3-NEXT: sxtw x9, w0
148+ ; CHECK-CPA-O3-NEXT: adrp x8, array2
149+ ; CHECK-CPA-O3-NEXT: add x8, x8, :lo12:array2
150+ ; CHECK-CPA-O3-NEXT: mov w11, #96 // =0x60
151+ ; CHECK-CPA-O3-NEXT: mov w12, #288 // =0x120
152+ ; CHECK-CPA-O3-NEXT: ldr q2, [x8, #96]
153+ ; CHECK-CPA-O3-NEXT: neg x10, x9
154+ ; CHECK-CPA-O3-NEXT: addpt x11, x8, x11
155+ ; CHECK-CPA-O3-NEXT: lsl x10, x10, #1
156+ ; CHECK-CPA-O3-NEXT: ldp q1, q0, [x11, #16]
157+ ; CHECK-CPA-O3-NEXT: sub x9, x10, x9
158+ ; CHECK-CPA-O3-NEXT: addpt x10, x8, x12
159+ ; CHECK-CPA-O3-NEXT: addpt x9, x10, x9, lsl #4
160+ ; CHECK-CPA-O3-NEXT: stp q1, q0, [x9, #16]
161+ ; CHECK-CPA-O3-NEXT: str q2, [x9]
157162; CHECK-CPA-O3-NEXT: ret
158163;
159164; CHECK-NOCPA-O0-LABEL: msubpt1:
@@ -200,29 +205,29 @@ entry:
200205define void @subpt1 (i32 %index , i32 %elem ) {
201206; CHECK-CPA-O0-LABEL: subpt1:
202207; CHECK-CPA-O0: // %bb.0: // %entry
203- ; CHECK-CPA-O0-NEXT: // implicit-def: $x8
204- ; CHECK-CPA-O0-NEXT: mov w8, w0
205- ; CHECK-CPA-O0-NEXT: sxtw x9, w8
206- ; CHECK-CPA-O0-NEXT: mov w8, #96 // =0x60
207- ; CHECK-CPA-O0-NEXT: // kill: def $x8 killed $w8
208- ; CHECK-CPA-O0-NEXT: subs x8, x8, x9, lsl #8
209208; CHECK-CPA-O0-NEXT: adrp x9, array
210209; CHECK-CPA-O0-NEXT: add x9, x9, :lo12:array
210+ ; CHECK-CPA-O0-NEXT: mov w8, #96 // =0x60
211+ ; CHECK-CPA-O0-NEXT: // kill: def $x8 killed $w8
211212; CHECK-CPA-O0-NEXT: addpt x8, x9, x8
213+ ; CHECK-CPA-O0-NEXT: // implicit-def: $x10
214+ ; CHECK-CPA-O0-NEXT: mov w10, w0
215+ ; CHECK-CPA-O0-NEXT: sbfiz x10, x10, #8, #32
216+ ; CHECK-CPA-O0-NEXT: subpt x8, x8, x10
212217; CHECK-CPA-O0-NEXT: ldr q0, [x9, #32]
213218; CHECK-CPA-O0-NEXT: str q0, [x8]
214219; CHECK-CPA-O0-NEXT: ret
215220;
216221; CHECK-CPA-O3-LABEL: subpt1:
217222; CHECK-CPA-O3: // %bb.0: // %entry
218223; CHECK-CPA-O3-NEXT: // kill: def $w0 killed $w0 def $x0
219- ; CHECK-CPA-O3-NEXT: sxtw x8, w0
224+ ; CHECK-CPA-O3-NEXT: adrp x8, array
225+ ; CHECK-CPA-O3-NEXT: add x8, x8, :lo12:array
220226; CHECK-CPA-O3-NEXT: mov w9, #96 // =0x60
221- ; CHECK-CPA-O3-NEXT: sub x8, x9, x8, lsl #8
222- ; CHECK-CPA-O3-NEXT: adrp x9, array
223- ; CHECK-CPA-O3-NEXT: add x9, x9, :lo12:array
224- ; CHECK-CPA-O3-NEXT: ldr q0, [x9, #32]
225- ; CHECK-CPA-O3-NEXT: addpt x8, x9, x8
227+ ; CHECK-CPA-O3-NEXT: sbfiz x10, x0, #8, #32
228+ ; CHECK-CPA-O3-NEXT: addpt x9, x8, x9
229+ ; CHECK-CPA-O3-NEXT: ldr q0, [x8, #32]
230+ ; CHECK-CPA-O3-NEXT: subpt x8, x9, x10
226231; CHECK-CPA-O3-NEXT: str q0, [x8]
227232; CHECK-CPA-O3-NEXT: ret
228233;
@@ -259,24 +264,28 @@ entry:
259264define void @subpt2 (i32 %index , i32 %elem ) {
260265; CHECK-CPA-O0-LABEL: subpt2:
261266; CHECK-CPA-O0: // %bb.0: // %entry
262- ; CHECK-CPA-O0-NEXT: mov w8, #96 // =0x60
263- ; CHECK-CPA-O0-NEXT: // kill: def $x8 killed $w8
264- ; CHECK-CPA-O0-NEXT: subs x8, x8, w0, sxtw #4
267+ ; CHECK-CPA-O0-NEXT: mov x8, xzr
268+ ; CHECK-CPA-O0-NEXT: subs x10, x8, w0, sxtw
265269; CHECK-CPA-O0-NEXT: adrp x9, array
266270; CHECK-CPA-O0-NEXT: add x9, x9, :lo12:array
271+ ; CHECK-CPA-O0-NEXT: mov w8, #96 // =0x60
272+ ; CHECK-CPA-O0-NEXT: // kill: def $x8 killed $w8
267273; CHECK-CPA-O0-NEXT: addpt x8, x9, x8
274+ ; CHECK-CPA-O0-NEXT: addpt x8, x8, x10, lsl #4
268275; CHECK-CPA-O0-NEXT: ldr q0, [x9, #32]
269276; CHECK-CPA-O0-NEXT: str q0, [x8]
270277; CHECK-CPA-O0-NEXT: ret
271278;
272279; CHECK-CPA-O3-LABEL: subpt2:
273280; CHECK-CPA-O3: // %bb.0: // %entry
274- ; CHECK-CPA-O3-NEXT: mov w8, #96 // =0x60
275- ; CHECK-CPA-O3-NEXT: adrp x9, array
276- ; CHECK-CPA-O3-NEXT: add x9, x9, :lo12:array
277- ; CHECK-CPA-O3-NEXT: sub x8, x8, w0, sxtw #4
278- ; CHECK-CPA-O3-NEXT: ldr q0, [x9, #32]
279- ; CHECK-CPA-O3-NEXT: addpt x8, x9, x8
281+ ; CHECK-CPA-O3-NEXT: mov x8, xzr
282+ ; CHECK-CPA-O3-NEXT: mov w9, #96 // =0x60
283+ ; CHECK-CPA-O3-NEXT: adrp x10, array
284+ ; CHECK-CPA-O3-NEXT: add x10, x10, :lo12:array
285+ ; CHECK-CPA-O3-NEXT: sub x8, x8, w0, sxtw
286+ ; CHECK-CPA-O3-NEXT: addpt x9, x10, x9
287+ ; CHECK-CPA-O3-NEXT: ldr q0, [x10, #32]
288+ ; CHECK-CPA-O3-NEXT: addpt x8, x9, x8, lsl #4
280289; CHECK-CPA-O3-NEXT: str q0, [x8]
281290; CHECK-CPA-O3-NEXT: ret
282291;
@@ -656,14 +665,18 @@ define hidden void @multidim() {
656665; CHECK-CPA-O0-LABEL: multidim:
657666; CHECK-CPA-O0: // %bb.0: // %entry
658667; CHECK-CPA-O0-NEXT: adrp x8, b
659- ; CHECK-CPA-O0-NEXT: ldrh w10, [x8, :lo12:b]
668+ ; CHECK-CPA-O0-NEXT: ldrh w9, [x8, :lo12:b]
669+ ; CHECK-CPA-O0-NEXT: mov w8, w9
670+ ; CHECK-CPA-O0-NEXT: mov w10, w8
660671; CHECK-CPA-O0-NEXT: adrp x8, a
661672; CHECK-CPA-O0-NEXT: add x8, x8, :lo12:a
662- ; CHECK-CPA-O0-NEXT: add w9, w10, #1
673+ ; CHECK-CPA-O0-NEXT: mov w11, #2 // =0x2
674+ ; CHECK-CPA-O0-NEXT: // kill: def $x11 killed $w11
675+ ; CHECK-CPA-O0-NEXT: addpt x8, x8, x11
676+ ; CHECK-CPA-O0-NEXT: addpt x8, x8, x10, lsl #1
677+ ; CHECK-CPA-O0-NEXT: add w9, w9, #1
663678; CHECK-CPA-O0-NEXT: mov w9, w9
664679; CHECK-CPA-O0-NEXT: // kill: def $x9 killed $w9
665- ; CHECK-CPA-O0-NEXT: add x9, x9, w10, uxtw #1
666- ; CHECK-CPA-O0-NEXT: add x9, x9, #2
667680; CHECK-CPA-O0-NEXT: addpt x8, x8, x9
668681; CHECK-CPA-O0-NEXT: ldrb w8, [x8]
669682; CHECK-CPA-O0-NEXT: cbz w8, .LBB14_2
0 commit comments