1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple aarch64 -run-pass=machine-sink -sink-insts-to-avoid-spills %s -o - 2>&1 | FileCheck %s
4 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
5 target triple = "aarch64"
7 @A = external dso_local global [100 x i32], align 4
8 %struct.A = type { i32, i32, i32, i32, i32, i32 }
10 define void @cant_sink_adds_call_in_block(i8* nocapture readonly %input, %struct.A* %a) {
11 %1 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 1
12 %2 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 2
13 %3 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 3
14 %4 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 4
15 %5 = getelementptr inbounds %struct.A, %struct.A* %a, i64 0, i32 5
16 %scevgep = getelementptr i8, i8* %input, i64 1
19 .backedge: ; preds = %.backedge.backedge, %0
20 %lsr.iv = phi i8* [ %scevgep1, %.backedge.backedge ], [ %scevgep, %0 ]
21 %6 = load i8, i8* %lsr.iv, align 1
22 %7 = zext i8 %6 to i32
23 switch i32 %7, label %.backedge.backedge [
32 8: ; preds = %.backedge
33 %9 = bitcast %struct.A* %a to i32*
34 tail call void @_Z6assignPj(i32* %9)
35 br label %.backedge.backedge
37 10: ; preds = %.backedge
38 tail call void @_Z6assignPj(i32* %1)
39 br label %.backedge.backedge
41 11: ; preds = %.backedge
42 tail call void @_Z6assignPj(i32* %2)
43 br label %.backedge.backedge
45 12: ; preds = %.backedge
46 tail call void @_Z6assignPj(i32* %3)
47 br label %.backedge.backedge
49 13: ; preds = %.backedge
50 tail call void @_Z6assignPj(i32* %4)
51 br label %.backedge.backedge
53 14: ; preds = %.backedge
54 tail call void @_Z6assignPj(i32* %5)
55 br label %.backedge.backedge
57 .backedge.backedge: ; preds = %14, %13, %12, %11, %10, %8, %.backedge
58 %scevgep1 = getelementptr i8, i8* %lsr.iv, i64 1
62 define i32 @load_not_safe_to_move_consecutive_call(i32 %n) {
64 %cmp63 = icmp sgt i32 %n, 0
65 br i1 %cmp63, label %for.body.preheader, label %for.cond.cleanup
67 for.body.preheader: ; preds = %entry
68 %0 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0), align 4
69 %call0 = tail call i32 @use(i32 %n)
72 for.cond.cleanup: ; preds = %for.body, %entry
73 %sum.0.lcssa = phi i32 [ %n, %entry ], [ %div, %for.body ]
76 for.body: ; preds = %for.body, %for.body.preheader
77 %lsr.iv = phi i32 [ %n, %for.body.preheader ], [ %lsr.iv.next, %for.body ]
78 %sum.065 = phi i32 [ %div, %for.body ], [ %n, %for.body.preheader ]
79 %div = sdiv i32 %sum.065, %0
80 %lsr.iv.next = add i32 %lsr.iv, -1
81 %exitcond.not = icmp eq i32 %lsr.iv.next, 0
82 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
85 define i32 @load_not_safe_to_move_consecutive_call_use(i32 %n) {
87 %cmp63 = icmp sgt i32 %n, 0
88 br i1 %cmp63, label %for.body.preheader, label %for.cond.cleanup
90 for.body.preheader: ; preds = %entry
91 %0 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0), align 4
92 %call0 = tail call i32 @use(i32 %0)
95 for.cond.cleanup: ; preds = %for.body, %entry
96 %sum.0.lcssa = phi i32 [ %n, %entry ], [ %div, %for.body ]
99 for.body: ; preds = %for.body, %for.body.preheader
100 %lsr.iv = phi i32 [ %n, %for.body.preheader ], [ %lsr.iv.next, %for.body ]
101 %sum.065 = phi i32 [ %div, %for.body ], [ %n, %for.body.preheader ]
102 %div = sdiv i32 %sum.065, %0
103 %lsr.iv.next = add i32 %lsr.iv, -1
104 %exitcond.not = icmp eq i32 %lsr.iv.next, 0
105 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
108 define i32 @cant_sink_use_outside_loop(i32 %n) {
110 %cmp63 = icmp sgt i32 %n, 0
111 br i1 %cmp63, label %for.body.preheader, label %for.cond.cleanup
113 for.body.preheader: ; preds = %entry
114 %0 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0), align 4
117 for.cond.cleanup: ; preds = %for.body, %entry
118 %sum.0.lcssa = phi i32 [ %n, %entry ], [ %div, %for.body ]
119 %use.outside.loop = phi i32 [ 0, %entry ], [ %0, %for.body ]
120 %call = tail call i32 @use(i32 %use.outside.loop)
123 for.body: ; preds = %for.body, %for.body.preheader
124 %lsr.iv = phi i32 [ %n, %for.body.preheader ], [ %lsr.iv.next, %for.body ]
125 %sum.065 = phi i32 [ %div, %for.body ], [ %n, %for.body.preheader ]
126 %div = sdiv i32 %sum.065, %sum.065
127 %lsr.iv.next = add i32 %lsr.iv, -1
128 %exitcond.not = icmp eq i32 %lsr.iv.next, 0
129 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
132 define i32 @use_is_not_a_copy(i32 %n) {
134 %cmp63 = icmp sgt i32 %n, 0
135 br i1 %cmp63, label %for.body.preheader, label %for.cond.cleanup
137 for.body.preheader: ; preds = %entry
138 %0 = load i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0), align 4
141 for.cond.cleanup: ; preds = %for.body, %entry
142 %sum.0.lcssa = phi i32 [ %n, %entry ], [ %div, %for.body ]
145 for.body: ; preds = %for.body, %for.body.preheader
146 %lsr.iv = phi i32 [ %n, %for.body.preheader ], [ %lsr.iv.next, %for.body ]
147 %sum.065 = phi i32 [ %div, %for.body ], [ %n, %for.body.preheader ]
148 %div = sdiv i32 %sum.065, %0
149 %lsr.iv.next = add i32 %lsr.iv, -1
150 %exitcond.not = icmp eq i32 %lsr.iv.next, 0
151 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
154 define dso_local void @sink_add(i32* noalias nocapture readonly %read, i32* noalias nocapture %write, i32 %n) local_unnamed_addr #0 {
156 %0 = load i32, i32* %read, align 4, !tbaa !6
157 %cmp10 = icmp sgt i32 %n, 0
158 br i1 %cmp10, label %for.body.preheader, label %for.cond.cleanup
160 for.body.preheader: ; preds = %entry
164 for.cond.cleanup: ; preds = %for.body, %entry
165 %sum.0.lcssa = phi i32 [ %n, %entry ], [ %div, %for.body ]
166 store i32 %sum.0.lcssa, i32* %write, align 4, !tbaa !6
169 for.body: ; preds = %for.body.preheader, %for.body
170 %lsr.iv1 = phi i32 [ %1, %for.body.preheader ], [ %lsr.iv.next2, %for.body ]
171 %lsr.iv = phi i32 [ %n, %for.body.preheader ], [ %lsr.iv.next, %for.body ]
172 %sum.011 = phi i32 [ %div, %for.body ], [ %n, %for.body.preheader ]
173 %div = sdiv i32 %sum.011, %lsr.iv1
174 %lsr.iv.next = add i32 %lsr.iv, -1
175 %lsr.iv.next2 = add i32 %lsr.iv1, 1
176 %exitcond.not = icmp eq i32 %lsr.iv.next, 0
177 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body
180 define dso_local void @store_after_add(i32* noalias nocapture readonly %read, i32* noalias nocapture %write, i32* nocapture %store, i32 %n) local_unnamed_addr #0 {
182 %0 = load i32, i32* %read, align 4, !tbaa !6
183 %cmp10 = icmp sgt i32 %n, 0
184 br i1 %cmp10, label %for.body.preheader, label %for.cond.cleanup
186 for.body.preheader: ; preds = %entry
188 store i32 43, i32* %store, align 4, !tbaa !6
191 for.cond.cleanup: ; preds = %for.body, %entry
192 %sum.0.lcssa = phi i32 [ %n, %entry ], [ %div, %for.body ]
193 store i32 %sum.0.lcssa, i32* %write, align 4, !tbaa !6
196 for.body: ; preds = %for.body.preheader, %for.body
197 %lsr.iv1 = phi i32 [ %1, %for.body.preheader ], [ %lsr.iv.next2, %for.body ]
198 %lsr.iv = phi i32 [ %n, %for.body.preheader ], [ %lsr.iv.next, %for.body ]
199 %sum.011 = phi i32 [ %div, %for.body ], [ %n, %for.body.preheader ]
200 %div = sdiv i32 %sum.011, %lsr.iv1
201 %lsr.iv.next = add i32 %lsr.iv, -1
202 %lsr.iv.next2 = add i32 %lsr.iv1, 1
203 %exitcond.not = icmp eq i32 %lsr.iv.next, 0
204 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !10
207 define dso_local void @aliased_store_after_add(i32* noalias nocapture readonly %read, i32* noalias nocapture %write, i32* nocapture %store, i32 %n) local_unnamed_addr #0 {
209 %0 = load i32, i32* %read, align 4, !tbaa !6
210 %cmp10 = icmp sgt i32 %n, 0
211 br i1 %cmp10, label %for.body.preheader, label %for.cond.cleanup
213 for.body.preheader: ; preds = %entry
215 store i32 43, i32* %read, align 4, !tbaa !6
218 for.cond.cleanup: ; preds = %for.body, %entry
219 %sum.0.lcssa = phi i32 [ %n, %entry ], [ %div, %for.body ]
220 store i32 %sum.0.lcssa, i32* %write, align 4, !tbaa !6
223 for.body: ; preds = %for.body.preheader, %for.body
224 %lsr.iv1 = phi i32 [ %1, %for.body.preheader ], [ %lsr.iv.next2, %for.body ]
225 %lsr.iv = phi i32 [ %n, %for.body.preheader ], [ %lsr.iv.next, %for.body ]
226 %sum.011 = phi i32 [ %div, %for.body ], [ %n, %for.body.preheader ]
227 %div = sdiv i32 %sum.011, %lsr.iv1
228 %lsr.iv.next = add i32 %lsr.iv, -1
229 %lsr.iv.next2 = add i32 %lsr.iv1, 1
230 %exitcond.not = icmp eq i32 %lsr.iv.next, 0
231 br i1 %exitcond.not, label %for.cond.cleanup, label %for.body, !llvm.loop !10
235 declare i32 @use(i32)
236 declare void @_Z6assignPj(i32*)
238 !6 = !{!7, !7, i64 0}
239 !7 = !{!"int", !8, i64 0}
240 !8 = !{!"omnipotent char", !9, i64 0}
241 !9 = !{!"Simple C/C++ TBAA"}
242 !10 = distinct !{!10, !11}
243 !11 = !{!"llvm.loop.mustprogress"}
247 name: cant_sink_adds_call_in_block
249 exposesReturnsTwice: false
251 regBankSelected: false
254 tracksRegLiveness: true
257 - { id: 0, class: gpr64all, preferred-register: '' }
258 - { id: 1, class: gpr64all, preferred-register: '' }
259 - { id: 2, class: gpr64all, preferred-register: '' }
260 - { id: 3, class: gpr64all, preferred-register: '' }
261 - { id: 4, class: gpr64all, preferred-register: '' }
262 - { id: 5, class: gpr64all, preferred-register: '' }
263 - { id: 6, class: gpr64sp, preferred-register: '' }
264 - { id: 7, class: gpr64all, preferred-register: '' }
265 - { id: 8, class: gpr64common, preferred-register: '' }
266 - { id: 9, class: gpr64common, preferred-register: '' }
267 - { id: 10, class: gpr64sp, preferred-register: '' }
268 - { id: 11, class: gpr64sp, preferred-register: '' }
269 - { id: 12, class: gpr64sp, preferred-register: '' }
270 - { id: 13, class: gpr64sp, preferred-register: '' }
271 - { id: 14, class: gpr64sp, preferred-register: '' }
272 - { id: 15, class: gpr64sp, preferred-register: '' }
273 - { id: 16, class: gpr64, preferred-register: '' }
274 - { id: 17, class: gpr32, preferred-register: '' }
275 - { id: 18, class: gpr32sp, preferred-register: '' }
276 - { id: 19, class: gpr32, preferred-register: '' }
277 - { id: 20, class: gpr64, preferred-register: '' }
278 - { id: 21, class: gpr64, preferred-register: '' }
279 - { id: 22, class: gpr64sp, preferred-register: '' }
280 - { id: 23, class: gpr64sp, preferred-register: '' }
282 - { reg: '$x0', virtual-reg: '%8' }
283 - { reg: '$x1', virtual-reg: '%9' }
285 isFrameAddressTaken: false
286 isReturnAddressTaken: false
296 cvBytesOfCalleeSavedRegisters: 0
297 hasOpaqueSPAdjustment: false
299 hasMustTailInVarArgFunc: false
306 debugValueSubstitutions: []
308 machineFunctionInfo: {}
313 blocks: [ '%bb.2', '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.8',
314 '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.3', '%bb.8',
315 '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.8',
316 '%bb.8', '%bb.8', '%bb.4', '%bb.8', '%bb.8', '%bb.8',
317 '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.8',
318 '%bb.5', '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.8',
319 '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.6', '%bb.8',
320 '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.8', '%bb.8',
321 '%bb.8', '%bb.8', '%bb.7' ]
323 ; CHECK-LABEL: name: cant_sink_adds_call_in_block
324 ; CHECK: bb.0 (%ir-block.0):
325 ; CHECK: successors: %bb.1(0x80000000)
326 ; CHECK: liveins: $x0, $x1
327 ; CHECK: [[COPY:%[0-9]+]]:gpr64common = COPY $x1
328 ; CHECK: [[COPY1:%[0-9]+]]:gpr64common = COPY $x0
329 ; CHECK: [[ADDXri:%[0-9]+]]:gpr64sp = nuw ADDXri [[COPY]], 4, 0
330 ; CHECK: [[COPY2:%[0-9]+]]:gpr64all = COPY [[ADDXri]]
331 ; CHECK: [[ADDXri1:%[0-9]+]]:gpr64sp = nuw ADDXri [[COPY]], 8, 0
332 ; CHECK: [[COPY3:%[0-9]+]]:gpr64all = COPY [[ADDXri1]]
333 ; CHECK: [[ADDXri2:%[0-9]+]]:gpr64sp = nuw ADDXri [[COPY]], 12, 0
334 ; CHECK: [[COPY4:%[0-9]+]]:gpr64all = COPY [[ADDXri2]]
335 ; CHECK: [[ADDXri3:%[0-9]+]]:gpr64sp = nuw ADDXri [[COPY]], 16, 0
336 ; CHECK: [[COPY5:%[0-9]+]]:gpr64all = COPY [[ADDXri3]]
337 ; CHECK: [[ADDXri4:%[0-9]+]]:gpr64sp = nuw ADDXri [[COPY]], 20, 0
338 ; CHECK: [[COPY6:%[0-9]+]]:gpr64all = COPY [[ADDXri4]]
339 ; CHECK: [[ADDXri5:%[0-9]+]]:gpr64sp = ADDXri [[COPY1]], 1, 0
340 ; CHECK: [[COPY7:%[0-9]+]]:gpr64all = COPY [[ADDXri5]]
341 ; CHECK: [[MOVaddrJT:%[0-9]+]]:gpr64 = MOVaddrJT target-flags(aarch64-page) %jump-table.0, target-flags(aarch64-pageoff, aarch64-nc) %jump-table.0
342 ; CHECK: bb.1..backedge:
343 ; CHECK: successors: %bb.9(0x09249249), %bb.2(0x76db6db7)
344 ; CHECK: [[PHI:%[0-9]+]]:gpr64sp = PHI [[COPY7]], %bb.0, %7, %bb.9
345 ; CHECK: [[LDRBBui:%[0-9]+]]:gpr32 = LDRBBui [[PHI]], 0 :: (load (s8) from %ir.lsr.iv)
346 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64 = SUBREG_TO_REG 0, killed [[LDRBBui]], %subreg.sub_32
347 ; CHECK: [[COPY8:%[0-9]+]]:gpr32sp = COPY [[SUBREG_TO_REG]].sub_32
348 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri killed [[COPY8]], 50, 0, implicit-def $nzcv
349 ; CHECK: Bcc 8, %bb.9, implicit $nzcv
350 ; CHECK: bb.2..backedge:
351 ; CHECK: successors: %bb.3(0x13b13b14), %bb.9(0x09d89d8a), %bb.4(0x13b13b14), %bb.5(0x13b13b14), %bb.6(0x13b13b14), %bb.7(0x13b13b14), %bb.8(0x13b13b14)
352 ; CHECK: early-clobber %21:gpr64, early-clobber %22:gpr64sp = JumpTableDest32 [[MOVaddrJT]], [[SUBREG_TO_REG]], %jump-table.0
353 ; CHECK: BR killed %21
354 ; CHECK: bb.3 (%ir-block.8):
355 ; CHECK: successors: %bb.9(0x80000000)
356 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
357 ; CHECK: $x0 = COPY [[COPY]]
358 ; CHECK: BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
359 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
361 ; CHECK: bb.4 (%ir-block.10):
362 ; CHECK: successors: %bb.9(0x80000000)
363 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
364 ; CHECK: $x0 = COPY [[COPY2]]
365 ; CHECK: BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
366 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
368 ; CHECK: bb.5 (%ir-block.11):
369 ; CHECK: successors: %bb.9(0x80000000)
370 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
371 ; CHECK: $x0 = COPY [[COPY3]]
372 ; CHECK: BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
373 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
375 ; CHECK: bb.6 (%ir-block.12):
376 ; CHECK: successors: %bb.9(0x80000000)
377 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
378 ; CHECK: $x0 = COPY [[COPY4]]
379 ; CHECK: BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
380 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
382 ; CHECK: bb.7 (%ir-block.13):
383 ; CHECK: successors: %bb.9(0x80000000)
384 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
385 ; CHECK: $x0 = COPY [[COPY5]]
386 ; CHECK: BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
387 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
389 ; CHECK: bb.8 (%ir-block.14):
390 ; CHECK: successors: %bb.9(0x80000000)
391 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
392 ; CHECK: $x0 = COPY [[COPY6]]
393 ; CHECK: BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
394 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
395 ; CHECK: bb.9..backedge.backedge:
396 ; CHECK: successors: %bb.1(0x80000000)
397 ; CHECK: [[ADDXri6:%[0-9]+]]:gpr64sp = ADDXri [[PHI]], 1, 0
398 ; CHECK: [[COPY9:%[0-9]+]]:gpr64all = COPY [[ADDXri6]]
401 successors: %bb.1(0x80000000)
404 %9:gpr64common = COPY $x1
405 %8:gpr64common = COPY $x0
406 %10:gpr64sp = nuw ADDXri %9, 4, 0
407 %0:gpr64all = COPY %10
408 %11:gpr64sp = nuw ADDXri %9, 8, 0
409 %1:gpr64all = COPY %11
410 %12:gpr64sp = nuw ADDXri %9, 12, 0
411 %2:gpr64all = COPY %12
412 %13:gpr64sp = nuw ADDXri %9, 16, 0
413 %3:gpr64all = COPY %13
414 %14:gpr64sp = nuw ADDXri %9, 20, 0
415 %4:gpr64all = COPY %14
416 %15:gpr64sp = ADDXri %8, 1, 0
417 %5:gpr64all = COPY %15
418 %20:gpr64 = MOVaddrJT target-flags(aarch64-page) %jump-table.0, target-flags(aarch64-pageoff, aarch64-nc) %jump-table.0
421 successors: %bb.8(0x09249249), %bb.9(0x76db6db7)
423 %6:gpr64sp = PHI %5, %bb.0, %7, %bb.8
424 %17:gpr32 = LDRBBui %6, 0 :: (load (s8) from %ir.lsr.iv)
425 %16:gpr64 = SUBREG_TO_REG 0, killed %17, %subreg.sub_32
426 %18:gpr32sp = COPY %16.sub_32
427 %19:gpr32 = SUBSWri killed %18, 50, 0, implicit-def $nzcv
428 Bcc 8, %bb.8, implicit $nzcv
431 successors: %bb.2(0x13b13b14), %bb.8(0x09d89d8a), %bb.3(0x13b13b14), %bb.4(0x13b13b14), %bb.5(0x13b13b14), %bb.6(0x13b13b14), %bb.7(0x13b13b14)
433 early-clobber %21:gpr64, early-clobber %22:gpr64sp = JumpTableDest32 %20, %16, %jump-table.0
437 successors: %bb.8(0x80000000)
439 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
441 BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
442 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
446 successors: %bb.8(0x80000000)
448 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
450 BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
451 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
455 successors: %bb.8(0x80000000)
457 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
459 BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
460 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
464 successors: %bb.8(0x80000000)
466 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
468 BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
469 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
473 successors: %bb.8(0x80000000)
475 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
477 BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
478 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
482 successors: %bb.8(0x80000000)
484 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
486 BL @_Z6assignPj, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $x0, implicit-def $sp
487 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
489 bb.8..backedge.backedge:
490 successors: %bb.1(0x80000000)
492 %23:gpr64sp = ADDXri %6, 1, 0
493 %7:gpr64all = COPY %23
498 name: load_not_safe_to_move_consecutive_call
500 exposesReturnsTwice: false
502 regBankSelected: false
505 tracksRegLiveness: true
508 - { id: 0, class: gpr32, preferred-register: '' }
509 - { id: 1, class: gpr32all, preferred-register: '' }
510 - { id: 2, class: gpr32sp, preferred-register: '' }
511 - { id: 3, class: gpr32, preferred-register: '' }
512 - { id: 4, class: gpr32all, preferred-register: '' }
513 - { id: 5, class: gpr32all, preferred-register: '' }
514 - { id: 6, class: gpr32common, preferred-register: '' }
515 - { id: 7, class: gpr32, preferred-register: '' }
516 - { id: 8, class: gpr64common, preferred-register: '' }
517 - { id: 9, class: gpr32, preferred-register: '' }
518 - { id: 10, class: gpr32all, preferred-register: '' }
519 - { id: 11, class: gpr32, preferred-register: '' }
520 - { id: 12, class: gpr32, preferred-register: '' }
522 - { reg: '$w0', virtual-reg: '%6' }
524 isFrameAddressTaken: false
525 isReturnAddressTaken: false
535 cvBytesOfCalleeSavedRegisters: 0
536 hasOpaqueSPAdjustment: false
538 hasMustTailInVarArgFunc: false
545 debugValueSubstitutions: []
547 machineFunctionInfo: {}
549 ; CHECK-LABEL: name: load_not_safe_to_move_consecutive_call
551 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
552 ; CHECK: liveins: $w0
553 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
554 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
555 ; CHECK: Bcc 11, %bb.2, implicit $nzcv
557 ; CHECK: bb.1.for.body.preheader:
558 ; CHECK: successors: %bb.3(0x80000000)
559 ; CHECK: [[ADRP:%[0-9]+]]:gpr64common = ADRP target-flags(aarch64-page) @A
560 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32 = LDRWui killed [[ADRP]], target-flags(aarch64-pageoff, aarch64-nc) @A :: (dereferenceable load (s32) from `i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0)`)
561 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
562 ; CHECK: $w0 = COPY [[COPY]]
563 ; CHECK: BL @use, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w0
564 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
566 ; CHECK: bb.2.for.cond.cleanup:
567 ; CHECK: [[PHI:%[0-9]+]]:gpr32all = PHI [[COPY]], %bb.0, %4, %bb.3
568 ; CHECK: $w0 = COPY [[PHI]]
569 ; CHECK: RET_ReallyLR implicit $w0
570 ; CHECK: bb.3.for.body:
571 ; CHECK: successors: %bb.2(0x04000000), %bb.3(0x7c000000)
572 ; CHECK: [[PHI1:%[0-9]+]]:gpr32sp = PHI [[COPY]], %bb.1, %5, %bb.3
573 ; CHECK: [[PHI2:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.1, %4, %bb.3
574 ; CHECK: [[SDIVWr:%[0-9]+]]:gpr32 = SDIVWr [[PHI2]], [[LDRWui]]
575 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[SDIVWr]]
576 ; CHECK: [[SUBSWri1:%[0-9]+]]:gpr32 = SUBSWri [[PHI1]], 1, 0, implicit-def $nzcv
577 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[SUBSWri1]]
578 ; CHECK: Bcc 0, %bb.2, implicit $nzcv
581 successors: %bb.1(0x50000000), %bb.2(0x30000000)
584 %6:gpr32common = COPY $w0
585 %7:gpr32 = SUBSWri %6, 1, 0, implicit-def $nzcv
586 Bcc 11, %bb.2, implicit $nzcv
589 bb.1.for.body.preheader:
590 successors: %bb.3(0x80000000)
592 %8:gpr64common = ADRP target-flags(aarch64-page) @A
593 %9:gpr32 = LDRWui killed %8, target-flags(aarch64-pageoff, aarch64-nc) @A :: (dereferenceable load (s32) from `i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0)`)
594 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
596 BL @use, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w0
597 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
600 bb.2.for.cond.cleanup:
601 %1:gpr32all = PHI %6, %bb.0, %4, %bb.3
603 RET_ReallyLR implicit $w0
606 successors: %bb.2(0x04000000), %bb.3(0x7c000000)
608 %2:gpr32sp = PHI %6, %bb.1, %5, %bb.3
609 %3:gpr32 = PHI %6, %bb.1, %4, %bb.3
610 %11:gpr32 = SDIVWr %3, %9
611 %4:gpr32all = COPY %11
612 %12:gpr32 = SUBSWri %2, 1, 0, implicit-def $nzcv
613 %5:gpr32all = COPY %12
614 Bcc 0, %bb.2, implicit $nzcv
619 name: load_not_safe_to_move_consecutive_call_use
621 exposesReturnsTwice: false
623 regBankSelected: false
626 tracksRegLiveness: true
629 - { id: 0, class: gpr32, preferred-register: '' }
630 - { id: 1, class: gpr32all, preferred-register: '' }
631 - { id: 2, class: gpr32sp, preferred-register: '' }
632 - { id: 3, class: gpr32, preferred-register: '' }
633 - { id: 4, class: gpr32all, preferred-register: '' }
634 - { id: 5, class: gpr32all, preferred-register: '' }
635 - { id: 6, class: gpr32common, preferred-register: '' }
636 - { id: 7, class: gpr32, preferred-register: '' }
637 - { id: 8, class: gpr64common, preferred-register: '' }
638 - { id: 9, class: gpr32, preferred-register: '' }
639 - { id: 10, class: gpr32all, preferred-register: '' }
640 - { id: 11, class: gpr32, preferred-register: '' }
641 - { id: 12, class: gpr32, preferred-register: '' }
643 - { reg: '$w0', virtual-reg: '%6' }
645 isFrameAddressTaken: false
646 isReturnAddressTaken: false
656 cvBytesOfCalleeSavedRegisters: 0
657 hasOpaqueSPAdjustment: false
659 hasMustTailInVarArgFunc: false
666 debugValueSubstitutions: []
668 machineFunctionInfo: {}
670 ; CHECK-LABEL: name: load_not_safe_to_move_consecutive_call_use
672 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
673 ; CHECK: liveins: $w0
674 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
675 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
676 ; CHECK: Bcc 11, %bb.2, implicit $nzcv
678 ; CHECK: bb.1.for.body.preheader:
679 ; CHECK: successors: %bb.3(0x80000000)
680 ; CHECK: [[ADRP:%[0-9]+]]:gpr64common = ADRP target-flags(aarch64-page) @A
681 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32 = LDRWui killed [[ADRP]], target-flags(aarch64-pageoff, aarch64-nc) @A :: (dereferenceable load (s32) from `i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0)`)
682 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
683 ; CHECK: $w0 = COPY [[LDRWui]]
684 ; CHECK: BL @use, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w0
685 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
687 ; CHECK: bb.2.for.cond.cleanup:
688 ; CHECK: [[PHI:%[0-9]+]]:gpr32all = PHI [[COPY]], %bb.0, %4, %bb.3
689 ; CHECK: $w0 = COPY [[PHI]]
690 ; CHECK: RET_ReallyLR implicit $w0
691 ; CHECK: bb.3.for.body:
692 ; CHECK: successors: %bb.2(0x04000000), %bb.3(0x7c000000)
693 ; CHECK: [[PHI1:%[0-9]+]]:gpr32sp = PHI [[COPY]], %bb.1, %5, %bb.3
694 ; CHECK: [[PHI2:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.1, %4, %bb.3
695 ; CHECK: [[SDIVWr:%[0-9]+]]:gpr32 = SDIVWr [[PHI2]], [[LDRWui]]
696 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[SDIVWr]]
697 ; CHECK: [[SUBSWri1:%[0-9]+]]:gpr32 = SUBSWri [[PHI1]], 1, 0, implicit-def $nzcv
698 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[SUBSWri1]]
699 ; CHECK: Bcc 0, %bb.2, implicit $nzcv
702 successors: %bb.1(0x50000000), %bb.2(0x30000000)
705 %6:gpr32common = COPY $w0
706 %7:gpr32 = SUBSWri %6, 1, 0, implicit-def $nzcv
707 Bcc 11, %bb.2, implicit $nzcv
710 bb.1.for.body.preheader:
711 successors: %bb.3(0x80000000)
713 %8:gpr64common = ADRP target-flags(aarch64-page) @A
714 %9:gpr32 = LDRWui killed %8, target-flags(aarch64-pageoff, aarch64-nc) @A :: (dereferenceable load (s32) from `i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0)`)
715 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
717 BL @use, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w0
718 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
721 bb.2.for.cond.cleanup:
722 %1:gpr32all = PHI %6, %bb.0, %4, %bb.3
724 RET_ReallyLR implicit $w0
727 successors: %bb.2(0x04000000), %bb.3(0x7c000000)
729 %2:gpr32sp = PHI %6, %bb.1, %5, %bb.3
730 %3:gpr32 = PHI %6, %bb.1, %4, %bb.3
731 %11:gpr32 = SDIVWr %3, %9
732 %4:gpr32all = COPY %11
733 %12:gpr32 = SUBSWri %2, 1, 0, implicit-def $nzcv
734 %5:gpr32all = COPY %12
735 Bcc 0, %bb.2, implicit $nzcv
740 name: cant_sink_use_outside_loop
742 exposesReturnsTwice: false
744 regBankSelected: false
747 tracksRegLiveness: true
750 - { id: 0, class: gpr32all, preferred-register: '' }
751 - { id: 1, class: gpr32all, preferred-register: '' }
752 - { id: 2, class: gpr32all, preferred-register: '' }
753 - { id: 3, class: gpr32sp, preferred-register: '' }
754 - { id: 4, class: gpr32all, preferred-register: '' }
755 - { id: 5, class: gpr32all, preferred-register: '' }
756 - { id: 6, class: gpr32all, preferred-register: '' }
757 - { id: 7, class: gpr32common, preferred-register: '' }
758 - { id: 8, class: gpr32all, preferred-register: '' }
759 - { id: 9, class: gpr32all, preferred-register: '' }
760 - { id: 10, class: gpr32, preferred-register: '' }
761 - { id: 11, class: gpr64common, preferred-register: '' }
762 - { id: 12, class: gpr32, preferred-register: '' }
763 - { id: 13, class: gpr32, preferred-register: '' }
764 - { id: 14, class: gpr32, preferred-register: '' }
765 - { id: 15, class: gpr32all, preferred-register: '' }
767 - { reg: '$w0', virtual-reg: '%7' }
769 isFrameAddressTaken: false
770 isReturnAddressTaken: false
780 cvBytesOfCalleeSavedRegisters: 0
781 hasOpaqueSPAdjustment: false
783 hasMustTailInVarArgFunc: false
790 debugValueSubstitutions: []
792 machineFunctionInfo: {}
794 ; CHECK-LABEL: name: cant_sink_use_outside_loop
796 ; CHECK: successors: %bb.1(0x50000000), %bb.4(0x30000000)
797 ; CHECK: liveins: $w0
798 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
799 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
800 ; CHECK: Bcc 10, %bb.1, implicit $nzcv
802 ; CHECK: successors: %bb.2(0x80000000)
803 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY $wzr
804 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[COPY1]]
806 ; CHECK: bb.1.for.body.preheader:
807 ; CHECK: successors: %bb.3(0x80000000)
808 ; CHECK: [[ADRP:%[0-9]+]]:gpr64common = ADRP target-flags(aarch64-page) @A
809 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32 = LDRWui killed [[ADRP]], target-flags(aarch64-pageoff, aarch64-nc) @A :: (dereferenceable load (s32) from `i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0)`)
810 ; CHECK: [[COPY3:%[0-9]+]]:gpr32all = COPY [[LDRWui]]
812 ; CHECK: bb.2.for.cond.cleanup:
813 ; CHECK: [[PHI:%[0-9]+]]:gpr32all = PHI [[COPY]], %bb.4, %5, %bb.5
814 ; CHECK: [[PHI1:%[0-9]+]]:gpr32all = PHI [[COPY2]], %bb.4, [[COPY3]], %bb.5
815 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
816 ; CHECK: $w0 = COPY [[PHI1]]
817 ; CHECK: BL @use, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w0
818 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
819 ; CHECK: $w0 = COPY [[PHI]]
820 ; CHECK: RET_ReallyLR implicit $w0
821 ; CHECK: bb.3.for.body:
822 ; CHECK: successors: %bb.5(0x04000000), %bb.3(0x7c000000)
823 ; CHECK: [[PHI2:%[0-9]+]]:gpr32sp = PHI [[COPY]], %bb.1, %6, %bb.3
824 ; CHECK: [[SUBSWri1:%[0-9]+]]:gpr32 = SUBSWri [[PHI2]], 1, 0, implicit-def $nzcv
825 ; CHECK: [[COPY4:%[0-9]+]]:gpr32all = COPY [[SUBSWri1]]
826 ; CHECK: Bcc 1, %bb.3, implicit $nzcv
828 ; CHECK: successors: %bb.2(0x80000000)
829 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 1
830 ; CHECK: [[COPY5:%[0-9]+]]:gpr32all = COPY [[MOVi32imm]]
833 successors: %bb.1(0x50000000), %bb.2(0x30000000)
836 %7:gpr32common = COPY $w0
837 %9:gpr32all = COPY $wzr
838 %8:gpr32all = COPY %9
839 %10:gpr32 = SUBSWri %7, 1, 0, implicit-def $nzcv
840 Bcc 11, %bb.2, implicit $nzcv
843 bb.1.for.body.preheader:
844 successors: %bb.3(0x80000000)
846 %11:gpr64common = ADRP target-flags(aarch64-page) @A
847 %12:gpr32 = LDRWui killed %11, target-flags(aarch64-pageoff, aarch64-nc) @A :: (dereferenceable load (s32) from `i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0)`)
848 %0:gpr32all = COPY %12
851 bb.2.for.cond.cleanup:
852 %1:gpr32all = PHI %7, %bb.0, %5, %bb.3
853 %2:gpr32all = PHI %8, %bb.0, %0, %bb.3
854 ADJCALLSTACKDOWN 0, 0, implicit-def dead $sp, implicit $sp
856 BL @use, csr_aarch64_aapcs, implicit-def dead $lr, implicit $sp, implicit $w0, implicit-def $sp, implicit-def $w0
857 ADJCALLSTACKUP 0, 0, implicit-def dead $sp, implicit $sp
859 RET_ReallyLR implicit $w0
862 successors: %bb.2(0x04000000), %bb.3(0x7c000000)
864 %3:gpr32sp = PHI %7, %bb.1, %6, %bb.3
865 %13:gpr32 = MOVi32imm 1
866 %5:gpr32all = COPY %13
867 %14:gpr32 = SUBSWri %3, 1, 0, implicit-def $nzcv
868 %6:gpr32all = COPY %14
869 Bcc 0, %bb.2, implicit $nzcv
874 name: use_is_not_a_copy
876 exposesReturnsTwice: false
878 regBankSelected: false
881 tracksRegLiveness: true
884 - { id: 0, class: gpr32, preferred-register: '' }
885 - { id: 1, class: gpr32all, preferred-register: '' }
886 - { id: 2, class: gpr32sp, preferred-register: '' }
887 - { id: 3, class: gpr32, preferred-register: '' }
888 - { id: 4, class: gpr32all, preferred-register: '' }
889 - { id: 5, class: gpr32all, preferred-register: '' }
890 - { id: 6, class: gpr32common, preferred-register: '' }
891 - { id: 7, class: gpr32, preferred-register: '' }
892 - { id: 8, class: gpr64common, preferred-register: '' }
893 - { id: 9, class: gpr32, preferred-register: '' }
894 - { id: 10, class: gpr32, preferred-register: '' }
895 - { id: 11, class: gpr32, preferred-register: '' }
897 - { reg: '$w0', virtual-reg: '%6' }
899 isFrameAddressTaken: false
900 isReturnAddressTaken: false
910 cvBytesOfCalleeSavedRegisters: 0
911 hasOpaqueSPAdjustment: false
913 hasMustTailInVarArgFunc: false
920 debugValueSubstitutions: []
922 machineFunctionInfo: {}
924 ; CHECK-LABEL: name: use_is_not_a_copy
926 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
927 ; CHECK: liveins: $w0
928 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
929 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
930 ; CHECK: Bcc 11, %bb.2, implicit $nzcv
932 ; CHECK: bb.1.for.body.preheader:
933 ; CHECK: successors: %bb.3(0x80000000)
934 ; CHECK: [[ADRP:%[0-9]+]]:gpr64common = ADRP target-flags(aarch64-page) @A
935 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32 = LDRWui killed [[ADRP]], target-flags(aarch64-pageoff, aarch64-nc) @A :: (dereferenceable load (s32) from `i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0)`)
937 ; CHECK: bb.2.for.cond.cleanup:
938 ; CHECK: [[PHI:%[0-9]+]]:gpr32all = PHI [[COPY]], %bb.0, %4, %bb.3
939 ; CHECK: $w0 = COPY [[PHI]]
940 ; CHECK: RET_ReallyLR implicit $w0
941 ; CHECK: bb.3.for.body:
942 ; CHECK: successors: %bb.2(0x04000000), %bb.3(0x7c000000)
943 ; CHECK: [[PHI1:%[0-9]+]]:gpr32sp = PHI [[COPY]], %bb.1, %5, %bb.3
944 ; CHECK: [[PHI2:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.1, %4, %bb.3
945 ; CHECK: [[SDIVWr:%[0-9]+]]:gpr32 = SDIVWr [[PHI2]], [[LDRWui]]
946 ; CHECK: [[COPY1:%[0-9]+]]:gpr32all = COPY [[SDIVWr]]
947 ; CHECK: [[SUBSWri1:%[0-9]+]]:gpr32 = SUBSWri [[PHI1]], 1, 0, implicit-def $nzcv
948 ; CHECK: [[COPY2:%[0-9]+]]:gpr32all = COPY [[SUBSWri1]]
949 ; CHECK: Bcc 0, %bb.2, implicit $nzcv
952 successors: %bb.1(0x50000000), %bb.2(0x30000000)
955 %6:gpr32common = COPY $w0
956 %7:gpr32 = SUBSWri %6, 1, 0, implicit-def $nzcv
957 Bcc 11, %bb.2, implicit $nzcv
960 bb.1.for.body.preheader:
961 successors: %bb.3(0x80000000)
963 %8:gpr64common = ADRP target-flags(aarch64-page) @A
964 %9:gpr32 = LDRWui killed %8, target-flags(aarch64-pageoff, aarch64-nc) @A :: (dereferenceable load (s32) from `i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i64 0, i64 0)`)
967 bb.2.for.cond.cleanup:
968 %1:gpr32all = PHI %6, %bb.0, %4, %bb.3
970 RET_ReallyLR implicit $w0
973 successors: %bb.2(0x04000000), %bb.3(0x7c000000)
975 %2:gpr32sp = PHI %6, %bb.1, %5, %bb.3
976 %3:gpr32 = PHI %6, %bb.1, %4, %bb.3
977 %10:gpr32 = SDIVWr %3, %9
978 %4:gpr32all = COPY %10
979 %11:gpr32 = SUBSWri %2, 1, 0, implicit-def $nzcv
980 %5:gpr32all = COPY %11
981 Bcc 0, %bb.2, implicit $nzcv
988 exposesReturnsTwice: false
990 regBankSelected: false
993 tracksRegLiveness: true
996 - { id: 0, class: gpr32sp, preferred-register: '' }
997 - { id: 1, class: gpr32all, preferred-register: '' }
998 - { id: 2, class: gpr32, preferred-register: '' }
999 - { id: 3, class: gpr32common, preferred-register: '' }
1000 - { id: 4, class: gpr32sp, preferred-register: '' }
1001 - { id: 5, class: gpr32, preferred-register: '' }
1002 - { id: 6, class: gpr32all, preferred-register: '' }
1003 - { id: 7, class: gpr32all, preferred-register: '' }
1004 - { id: 8, class: gpr32all, preferred-register: '' }
1005 - { id: 9, class: gpr64common, preferred-register: '' }
1006 - { id: 10, class: gpr64common, preferred-register: '' }
1007 - { id: 11, class: gpr32common, preferred-register: '' }
1008 - { id: 12, class: gpr32common, preferred-register: '' }
1009 - { id: 13, class: gpr32, preferred-register: '' }
1010 - { id: 14, class: gpr32sp, preferred-register: '' }
1011 - { id: 15, class: gpr32, preferred-register: '' }
1012 - { id: 16, class: gpr32, preferred-register: '' }
1013 - { id: 17, class: gpr32sp, preferred-register: '' }
1015 - { reg: '$x0', virtual-reg: '%9' }
1016 - { reg: '$x1', virtual-reg: '%10' }
1017 - { reg: '$w2', virtual-reg: '%11' }
1019 isFrameAddressTaken: false
1020 isReturnAddressTaken: false
1022 hasPatchPoint: false
1030 cvBytesOfCalleeSavedRegisters: 0
1031 hasOpaqueSPAdjustment: false
1033 hasMustTailInVarArgFunc: false
1040 debugValueSubstitutions: []
1042 machineFunctionInfo: {}
1044 ; CHECK-LABEL: name: sink_add
1045 ; CHECK: bb.0.entry:
1046 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
1047 ; CHECK: liveins: $x0, $x1, $w2
1048 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w2
1049 ; CHECK: [[COPY1:%[0-9]+]]:gpr64common = COPY $x1
1050 ; CHECK: [[COPY2:%[0-9]+]]:gpr64common = COPY $x0
1051 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
1052 ; CHECK: Bcc 11, %bb.2, implicit $nzcv
1054 ; CHECK: bb.1.for.body.preheader:
1055 ; CHECK: successors: %bb.3(0x80000000)
1056 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32common = LDRWui [[COPY2]], 0 :: (load (s32) from %ir.read, !tbaa !0)
1057 ; CHECK: [[ADDWri:%[0-9]+]]:gpr32sp = ADDWri [[LDRWui]], 42, 0
1058 ; CHECK: [[COPY3:%[0-9]+]]:gpr32all = COPY [[ADDWri]]
1060 ; CHECK: bb.2.for.cond.cleanup:
1061 ; CHECK: [[PHI:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.0, %6, %bb.3
1062 ; CHECK: STRWui [[PHI]], [[COPY1]], 0 :: (store (s32) into %ir.write, !tbaa !0)
1063 ; CHECK: RET_ReallyLR
1064 ; CHECK: bb.3.for.body:
1065 ; CHECK: successors: %bb.2(0x04000000), %bb.3(0x7c000000)
1066 ; CHECK: [[PHI1:%[0-9]+]]:gpr32common = PHI [[COPY3]], %bb.1, %8, %bb.3
1067 ; CHECK: [[PHI2:%[0-9]+]]:gpr32sp = PHI [[COPY]], %bb.1, %7, %bb.3
1068 ; CHECK: [[PHI3:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.1, %6, %bb.3
1069 ; CHECK: [[SDIVWr:%[0-9]+]]:gpr32 = SDIVWr [[PHI3]], [[PHI1]]
1070 ; CHECK: [[COPY4:%[0-9]+]]:gpr32all = COPY [[SDIVWr]]
1071 ; CHECK: [[SUBSWri1:%[0-9]+]]:gpr32 = SUBSWri [[PHI2]], 1, 0, implicit-def $nzcv
1072 ; CHECK: [[COPY5:%[0-9]+]]:gpr32all = COPY [[SUBSWri1]]
1073 ; CHECK: [[ADDWri1:%[0-9]+]]:gpr32sp = ADDWri [[PHI1]], 1, 0
1074 ; CHECK: [[COPY6:%[0-9]+]]:gpr32all = COPY [[ADDWri1]]
1075 ; CHECK: Bcc 0, %bb.2, implicit $nzcv
1078 successors: %bb.1(0x50000000), %bb.2(0x30000000)
1079 liveins: $x0, $x1, $w2
1081 %11:gpr32common = COPY $w2
1082 %10:gpr64common = COPY $x1
1083 %9:gpr64common = COPY $x0
1084 %12:gpr32common = LDRWui %9, 0 :: (load (s32) from %ir.read, !tbaa !6)
1085 %13:gpr32 = SUBSWri %11, 1, 0, implicit-def $nzcv
1086 Bcc 11, %bb.2, implicit $nzcv
1089 bb.1.for.body.preheader:
1090 successors: %bb.3(0x80000000)
1092 %14:gpr32sp = ADDWri %12, 42, 0
1093 %1:gpr32all = COPY %14
1096 bb.2.for.cond.cleanup:
1097 %2:gpr32 = PHI %11, %bb.0, %6, %bb.3
1098 STRWui %2, %10, 0 :: (store (s32) into %ir.write, !tbaa !6)
1102 successors: %bb.2(0x04000000), %bb.3(0x7c000000)
1104 %3:gpr32common = PHI %1, %bb.1, %8, %bb.3
1105 %4:gpr32sp = PHI %11, %bb.1, %7, %bb.3
1106 %5:gpr32 = PHI %11, %bb.1, %6, %bb.3
1107 %15:gpr32 = SDIVWr %5, %3
1108 %6:gpr32all = COPY %15
1109 %16:gpr32 = SUBSWri %4, 1, 0, implicit-def $nzcv
1110 %7:gpr32all = COPY %16
1111 %17:gpr32sp = ADDWri %3, 1, 0
1112 %8:gpr32all = COPY %17
1113 Bcc 0, %bb.2, implicit $nzcv
1118 name: store_after_add
1120 exposesReturnsTwice: false
1122 regBankSelected: false
1125 tracksRegLiveness: true
1128 - { id: 0, class: gpr32sp, preferred-register: '' }
1129 - { id: 1, class: gpr32all, preferred-register: '' }
1130 - { id: 2, class: gpr32, preferred-register: '' }
1131 - { id: 3, class: gpr32common, preferred-register: '' }
1132 - { id: 4, class: gpr32sp, preferred-register: '' }
1133 - { id: 5, class: gpr32, preferred-register: '' }
1134 - { id: 6, class: gpr32all, preferred-register: '' }
1135 - { id: 7, class: gpr32all, preferred-register: '' }
1136 - { id: 8, class: gpr32all, preferred-register: '' }
1137 - { id: 9, class: gpr64common, preferred-register: '' }
1138 - { id: 10, class: gpr64common, preferred-register: '' }
1139 - { id: 11, class: gpr64common, preferred-register: '' }
1140 - { id: 12, class: gpr32common, preferred-register: '' }
1141 - { id: 13, class: gpr32common, preferred-register: '' }
1142 - { id: 14, class: gpr32, preferred-register: '' }
1143 - { id: 15, class: gpr32, preferred-register: '' }
1144 - { id: 16, class: gpr32sp, preferred-register: '' }
1145 - { id: 17, class: gpr32, preferred-register: '' }
1146 - { id: 18, class: gpr32, preferred-register: '' }
1147 - { id: 19, class: gpr32sp, preferred-register: '' }
1149 - { reg: '$x0', virtual-reg: '%9' }
1150 - { reg: '$x1', virtual-reg: '%10' }
1151 - { reg: '$x2', virtual-reg: '%11' }
1152 - { reg: '$w3', virtual-reg: '%12' }
1154 isFrameAddressTaken: false
1155 isReturnAddressTaken: false
1157 hasPatchPoint: false
1165 cvBytesOfCalleeSavedRegisters: 0
1166 hasOpaqueSPAdjustment: false
1168 hasMustTailInVarArgFunc: false
1175 debugValueSubstitutions: []
1177 machineFunctionInfo: {}
1179 ; CHECK-LABEL: name: store_after_add
1180 ; CHECK: bb.0.entry:
1181 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
1182 ; CHECK: liveins: $x0, $x1, $x2, $w3
1183 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w3
1184 ; CHECK: [[COPY1:%[0-9]+]]:gpr64common = COPY $x2
1185 ; CHECK: [[COPY2:%[0-9]+]]:gpr64common = COPY $x1
1186 ; CHECK: [[COPY3:%[0-9]+]]:gpr64common = COPY $x0
1187 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
1188 ; CHECK: Bcc 11, %bb.2, implicit $nzcv
1190 ; CHECK: bb.1.for.body.preheader:
1191 ; CHECK: successors: %bb.3(0x80000000)
1192 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32common = LDRWui [[COPY3]], 0 :: (load (s32) from %ir.read, !tbaa !0)
1193 ; CHECK: [[ADDWri:%[0-9]+]]:gpr32sp = ADDWri [[LDRWui]], 42, 0
1194 ; CHECK: [[COPY4:%[0-9]+]]:gpr32all = COPY [[ADDWri]]
1195 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 43
1196 ; CHECK: STRWui killed [[MOVi32imm]], [[COPY1]], 0 :: (store (s32) into %ir.store, !tbaa !0)
1198 ; CHECK: bb.2.for.cond.cleanup:
1199 ; CHECK: [[PHI:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.0, %6, %bb.3
1200 ; CHECK: STRWui [[PHI]], [[COPY2]], 0 :: (store (s32) into %ir.write, !tbaa !0)
1201 ; CHECK: RET_ReallyLR
1202 ; CHECK: bb.3.for.body:
1203 ; CHECK: successors: %bb.2(0x04000000), %bb.3(0x7c000000)
1204 ; CHECK: [[PHI1:%[0-9]+]]:gpr32common = PHI [[COPY4]], %bb.1, %8, %bb.3
1205 ; CHECK: [[PHI2:%[0-9]+]]:gpr32sp = PHI [[COPY]], %bb.1, %7, %bb.3
1206 ; CHECK: [[PHI3:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.1, %6, %bb.3
1207 ; CHECK: [[SDIVWr:%[0-9]+]]:gpr32 = SDIVWr [[PHI3]], [[PHI1]]
1208 ; CHECK: [[COPY5:%[0-9]+]]:gpr32all = COPY [[SDIVWr]]
1209 ; CHECK: [[SUBSWri1:%[0-9]+]]:gpr32 = SUBSWri [[PHI2]], 1, 0, implicit-def $nzcv
1210 ; CHECK: [[COPY6:%[0-9]+]]:gpr32all = COPY [[SUBSWri1]]
1211 ; CHECK: [[ADDWri1:%[0-9]+]]:gpr32sp = ADDWri [[PHI1]], 1, 0
1212 ; CHECK: [[COPY7:%[0-9]+]]:gpr32all = COPY [[ADDWri1]]
1213 ; CHECK: Bcc 0, %bb.2, implicit $nzcv
1216 successors: %bb.1(0x50000000), %bb.2(0x30000000)
1217 liveins: $x0, $x1, $x2, $w3
1219 %12:gpr32common = COPY $w3
1220 %11:gpr64common = COPY $x2
1221 %10:gpr64common = COPY $x1
1222 %9:gpr64common = COPY $x0
1223 %13:gpr32common = LDRWui %9, 0 :: (load (s32) from %ir.read, !tbaa !6)
1224 %15:gpr32 = SUBSWri %12, 1, 0, implicit-def $nzcv
1225 Bcc 11, %bb.2, implicit $nzcv
1228 bb.1.for.body.preheader:
1229 successors: %bb.3(0x80000000)
1231 %16:gpr32sp = ADDWri %13, 42, 0
1232 %1:gpr32all = COPY %16
1233 %14:gpr32 = MOVi32imm 43
1234 STRWui killed %14, %11, 0 :: (store (s32) into %ir.store, !tbaa !6)
1237 bb.2.for.cond.cleanup:
1238 %2:gpr32 = PHI %12, %bb.0, %6, %bb.3
1239 STRWui %2, %10, 0 :: (store (s32) into %ir.write, !tbaa !6)
1243 successors: %bb.2(0x04000000), %bb.3(0x7c000000)
1245 %3:gpr32common = PHI %1, %bb.1, %8, %bb.3
1246 %4:gpr32sp = PHI %12, %bb.1, %7, %bb.3
1247 %5:gpr32 = PHI %12, %bb.1, %6, %bb.3
1248 %17:gpr32 = SDIVWr %5, %3
1249 %6:gpr32all = COPY %17
1250 %18:gpr32 = SUBSWri %4, 1, 0, implicit-def $nzcv
1251 %7:gpr32all = COPY %18
1252 %19:gpr32sp = ADDWri %3, 1, 0
1253 %8:gpr32all = COPY %19
1254 Bcc 0, %bb.2, implicit $nzcv
1259 name: aliased_store_after_add
1261 exposesReturnsTwice: false
1263 regBankSelected: false
1266 tracksRegLiveness: true
1269 - { id: 0, class: gpr32sp, preferred-register: '' }
1270 - { id: 1, class: gpr32all, preferred-register: '' }
1271 - { id: 2, class: gpr32, preferred-register: '' }
1272 - { id: 3, class: gpr32common, preferred-register: '' }
1273 - { id: 4, class: gpr32sp, preferred-register: '' }
1274 - { id: 5, class: gpr32, preferred-register: '' }
1275 - { id: 6, class: gpr32all, preferred-register: '' }
1276 - { id: 7, class: gpr32all, preferred-register: '' }
1277 - { id: 8, class: gpr32all, preferred-register: '' }
1278 - { id: 9, class: gpr64common, preferred-register: '' }
1279 - { id: 10, class: gpr64common, preferred-register: '' }
1280 - { id: 11, class: gpr64common, preferred-register: '' }
1281 - { id: 12, class: gpr32common, preferred-register: '' }
1282 - { id: 13, class: gpr32common, preferred-register: '' }
1283 - { id: 14, class: gpr32, preferred-register: '' }
1284 - { id: 15, class: gpr32, preferred-register: '' }
1285 - { id: 16, class: gpr32sp, preferred-register: '' }
1286 - { id: 17, class: gpr32, preferred-register: '' }
1287 - { id: 18, class: gpr32, preferred-register: '' }
1288 - { id: 19, class: gpr32sp, preferred-register: '' }
1290 - { reg: '$x0', virtual-reg: '%9' }
1291 - { reg: '$x1', virtual-reg: '%10' }
1292 - { reg: '$x2', virtual-reg: '%11' }
1293 - { reg: '$w3', virtual-reg: '%12' }
1295 isFrameAddressTaken: false
1296 isReturnAddressTaken: false
1298 hasPatchPoint: false
1306 cvBytesOfCalleeSavedRegisters: 0
1307 hasOpaqueSPAdjustment: false
1309 hasMustTailInVarArgFunc: false
1316 debugValueSubstitutions: []
1318 machineFunctionInfo: {}
1320 ; CHECK-LABEL: name: aliased_store_after_add
1321 ; CHECK: bb.0.entry:
1322 ; CHECK: successors: %bb.1(0x50000000), %bb.2(0x30000000)
1323 ; CHECK: liveins: $x0, $x1, $x2, $w3
1324 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w3
1325 ; CHECK: [[COPY1:%[0-9]+]]:gpr64common = COPY $x2
1326 ; CHECK: [[COPY2:%[0-9]+]]:gpr64common = COPY $x1
1327 ; CHECK: [[COPY3:%[0-9]+]]:gpr64common = COPY $x0
1328 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
1329 ; CHECK: Bcc 11, %bb.2, implicit $nzcv
1331 ; CHECK: bb.1.for.body.preheader:
1332 ; CHECK: successors: %bb.3(0x80000000)
1333 ; CHECK: [[LDRWui:%[0-9]+]]:gpr32common = LDRWui [[COPY3]], 0 :: (load (s32) from %ir.read, !tbaa !0)
1334 ; CHECK: [[ADDWri:%[0-9]+]]:gpr32sp = ADDWri [[LDRWui]], 42, 0
1335 ; CHECK: [[COPY4:%[0-9]+]]:gpr32all = COPY [[ADDWri]]
1336 ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 43
1337 ; CHECK: STRWui killed [[MOVi32imm]], [[COPY3]], 0 :: (store (s32) into %ir.read, !tbaa !0)
1339 ; CHECK: bb.2.for.cond.cleanup:
1340 ; CHECK: [[PHI:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.0, %6, %bb.3
1341 ; CHECK: STRWui [[PHI]], [[COPY2]], 0 :: (store (s32) into %ir.write, !tbaa !0)
1342 ; CHECK: RET_ReallyLR
1343 ; CHECK: bb.3.for.body:
1344 ; CHECK: successors: %bb.2(0x04000000), %bb.3(0x7c000000)
1345 ; CHECK: [[PHI1:%[0-9]+]]:gpr32common = PHI [[COPY4]], %bb.1, %8, %bb.3
1346 ; CHECK: [[PHI2:%[0-9]+]]:gpr32sp = PHI [[COPY]], %bb.1, %7, %bb.3
1347 ; CHECK: [[PHI3:%[0-9]+]]:gpr32 = PHI [[COPY]], %bb.1, %6, %bb.3
1348 ; CHECK: [[SDIVWr:%[0-9]+]]:gpr32 = SDIVWr [[PHI3]], [[PHI1]]
1349 ; CHECK: [[COPY5:%[0-9]+]]:gpr32all = COPY [[SDIVWr]]
1350 ; CHECK: [[SUBSWri1:%[0-9]+]]:gpr32 = SUBSWri [[PHI2]], 1, 0, implicit-def $nzcv
1351 ; CHECK: [[COPY6:%[0-9]+]]:gpr32all = COPY [[SUBSWri1]]
1352 ; CHECK: [[ADDWri1:%[0-9]+]]:gpr32sp = ADDWri [[PHI1]], 1, 0
1353 ; CHECK: [[COPY7:%[0-9]+]]:gpr32all = COPY [[ADDWri1]]
1354 ; CHECK: Bcc 0, %bb.2, implicit $nzcv
1357 successors: %bb.1(0x50000000), %bb.2(0x30000000)
1358 liveins: $x0, $x1, $x2, $w3
1360 %12:gpr32common = COPY $w3
1361 %11:gpr64common = COPY $x2
1362 %10:gpr64common = COPY $x1
1363 %9:gpr64common = COPY $x0
1364 %13:gpr32common = LDRWui %9, 0 :: (load (s32) from %ir.read, !tbaa !6)
1365 %15:gpr32 = SUBSWri %12, 1, 0, implicit-def $nzcv
1366 Bcc 11, %bb.2, implicit $nzcv
1369 bb.1.for.body.preheader:
1370 successors: %bb.3(0x80000000)
1372 %16:gpr32sp = ADDWri %13, 42, 0
1373 %1:gpr32all = COPY %16
1374 %14:gpr32 = MOVi32imm 43
1375 STRWui killed %14, %9, 0 :: (store (s32) into %ir.read, !tbaa !6)
1378 bb.2.for.cond.cleanup:
1379 %2:gpr32 = PHI %12, %bb.0, %6, %bb.3
1380 STRWui %2, %10, 0 :: (store (s32) into %ir.write, !tbaa !6)
1384 successors: %bb.2(0x04000000), %bb.3(0x7c000000)
1386 %3:gpr32common = PHI %1, %bb.1, %8, %bb.3
1387 %4:gpr32sp = PHI %12, %bb.1, %7, %bb.3
1388 %5:gpr32 = PHI %12, %bb.1, %6, %bb.3
1389 %17:gpr32 = SDIVWr %5, %3
1390 %6:gpr32all = COPY %17
1391 %18:gpr32 = SUBSWri %4, 1, 0, implicit-def $nzcv
1392 %7:gpr32all = COPY %18
1393 %19:gpr32sp = ADDWri %3, 1, 0
1394 %8:gpr32all = COPY %19
1395 Bcc 0, %bb.2, implicit $nzcv