File: sibling-loops.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (96 lines) | stat: -rw-r--r-- 4,119 bytes parent folder | download | duplicates (2)
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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=thumbv8.1m.main -mattr=+lob --verify-machineinstrs %s -o - | FileCheck %s

define arm_aapcs_vfpcc void @test(ptr noalias nocapture readonly %off, ptr noalias nocapture %data, ptr noalias nocapture %dst, i32 %n) {
; CHECK-LABEL: test:
; CHECK:       @ %bb.0: @ %entry
; CHECK-NEXT:    push.w {r4, r5, r6, r7, r8, lr}
; CHECK-NEXT:    cmp r3, #1
; CHECK-NEXT:    blt .LBB0_7
; CHECK-NEXT:  @ %bb.1: @ %for.cond1.preheader.us.preheader
; CHECK-NEXT:    mov r8, r3
; CHECK-NEXT:    lsl.w r12, r3, #1
; CHECK-NEXT:    movs r3, #0
; CHECK-NEXT:    mov r4, r1
; CHECK-NEXT:  .LBB0_2: @ %for.cond1.preheader.us
; CHECK-NEXT:    @ =>This Loop Header: Depth=1
; CHECK-NEXT:    @ Child Loop BB0_3 Depth 2
; CHECK-NEXT:    @ Child Loop BB0_5 Depth 2
; CHECK-NEXT:    dls lr, r8
; CHECK-NEXT:    movs r6, #0
; CHECK-NEXT:  .LBB0_3: @ %for.body4.us
; CHECK-NEXT:    @ Parent Loop BB0_2 Depth=1
; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2
; CHECK-NEXT:    ldrh.w r5, [r0, r6, lsl #1]
; CHECK-NEXT:    ldrh.w r7, [r1, r6, lsl #1]
; CHECK-NEXT:    add r5, r7
; CHECK-NEXT:    strh.w r5, [r4, r6, lsl #1]
; CHECK-NEXT:    adds r6, #1
; CHECK-NEXT:    le lr, .LBB0_3
; CHECK-NEXT:  @ %bb.4: @ %for.body15.us.preheader
; CHECK-NEXT:    @ in Loop: Header=BB0_2 Depth=1
; CHECK-NEXT:    dls lr, r8
; CHECK-NEXT:    movs r6, #0
; CHECK-NEXT:  .LBB0_5: @ %for.body15.us
; CHECK-NEXT:    @ Parent Loop BB0_2 Depth=1
; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2
; CHECK-NEXT:    ldrh.w r7, [r0, r6, lsl #1]
; CHECK-NEXT:    ldrh.w r5, [r1, r6, lsl #1]
; CHECK-NEXT:    add r5, r7
; CHECK-NEXT:    strh.w r5, [r2, r6, lsl #1]
; CHECK-NEXT:    adds r6, #1
; CHECK-NEXT:    le lr, .LBB0_5
; CHECK-NEXT:  @ %bb.6: @ %for.cond.cleanup14.us
; CHECK-NEXT:    @ in Loop: Header=BB0_2 Depth=1
; CHECK-NEXT:    adds r3, #1
; CHECK-NEXT:    add r2, r12
; CHECK-NEXT:    add r4, r12
; CHECK-NEXT:    cmp r3, r8
; CHECK-NEXT:    bne .LBB0_2
; CHECK-NEXT:  .LBB0_7: @ %for.cond.cleanup
; CHECK-NEXT:    pop.w {r4, r5, r6, r7, r8, pc}
entry:
  %cmp252 = icmp sgt i32 %n, 0
  br i1 %cmp252, label %for.cond1.preheader.us, label %for.cond.cleanup

for.cond1.preheader.us: ; preds = %entry, %for.cond.cleanup14.us
  %i.057.us = phi i32 [ %inc29.us, %for.cond.cleanup14.us ], [ 0, %entry ]
  %mul.us = mul i32 %i.057.us, %n
  br label %for.body4.us

for.cond.cleanup14.us: ; preds = %for.body15.us
  %inc29.us = add nuw i32 %i.057.us, 1
  %exitcond94 = icmp eq i32 %inc29.us, %n
  br i1 %exitcond94, label %for.cond.cleanup, label %for.cond1.preheader.us

for.body15.us: ; preds = %for.body4.us, %for.body15.us
  %j10.055.us = phi i32 [ %inc26.us, %for.body15.us ], [ 0, %for.body4.us ]
  %arrayidx16.us = getelementptr inbounds i16, ptr %off, i32 %j10.055.us
  %0 = load i16, ptr %arrayidx16.us, align 2
  %arrayidx18.us = getelementptr inbounds i16, ptr %data, i32 %j10.055.us
  %1 = load i16, ptr %arrayidx18.us, align 2
  %add20.us = add i16 %1, %0
  %add23.us = add i32 %j10.055.us, %mul.us
  %arrayidx24.us = getelementptr inbounds i16, ptr %dst, i32 %add23.us
  store i16 %add20.us, ptr %arrayidx24.us, align 2
  %inc26.us = add nuw nsw i32 %j10.055.us, 1
  %exitcond93 = icmp eq i32 %inc26.us, %n
  br i1 %exitcond93, label %for.cond.cleanup14.us, label %for.body15.us

for.body4.us: ; preds = %for.body4.us, %for.cond1.preheader.us
  %j.053.us = phi i32 [ 0, %for.cond1.preheader.us ], [ %inc.us, %for.body4.us ]
  %arrayidx.us = getelementptr inbounds i16, ptr %off, i32 %j.053.us
  %2 = load i16, ptr %arrayidx.us, align 2
  %arrayidx5.us = getelementptr inbounds i16, ptr %data, i32 %j.053.us
  %3 = load i16, ptr %arrayidx5.us, align 2
  %add.us = add i16 %3, %2
  %add8.us = add i32 %j.053.us, %mul.us
  %arrayidx9.us = getelementptr inbounds i16, ptr %data, i32 %add8.us
  store i16 %add.us, ptr %arrayidx9.us, align 2
  %inc.us = add nuw nsw i32 %j.053.us, 1
  %exitcond = icmp eq i32 %inc.us, %n
  br i1 %exitcond, label %for.body15.us, label %for.body4.us

for.cond.cleanup: ; preds = %for.cond.cleanup14.us, %entry
  ret void
}