1 # RUN: llc -march=hexagon -O3 -run-pass hexagon-loop-align -o - %s\
2 # RUN: -debug-only=hexagon-loop-align -verify-machineinstrs 2>&1 | FileCheck %s
5 # Test that we only count til endloop instruction and we align this
7 # CHECK: Loop Align Pass:
8 # CHECK: Instruction Count : 16
9 # CHECK: bb.5 (align 32)
12 tracksRegLiveness: true
16 successors: %bb.1(0x50000000), %bb.8(0x30000000)
17 liveins: $r0, $r1, $r2, $r3, $r4, $r5
19 renamable $p0 = C2_cmpgti renamable $r2, 0
20 J2_jumpf killed renamable $p0, %bb.8, implicit-def dead $pc
21 J2_jump %bb.1, implicit-def dead $pc
24 successors: %bb.2(0x80000000)
25 liveins: $r0, $r1, $r2, $r3, $r4, $r5
27 renamable $r7 = A2_addi killed renamable $r2, 1
28 renamable $r8 = S2_asr_i_r renamable $r1, 31
29 renamable $p0 = C2_cmpgti renamable $r1, 63
30 renamable $r2 = S2_asr_i_r renamable $r3, 2
31 renamable $r6 = S2_asr_i_r renamable $r3, 1
32 renamable $r9 = S2_lsr_i_r killed renamable $r7, 1
33 renamable $r1 = S2_lsr_i_r_acc killed renamable $r1, killed renamable $r8, 26
34 renamable $r7 = A2_tfrsi 0
35 renamable $r1 = S2_asr_i_r killed renamable $r1, 6
36 J2_loop1r %bb.2, killed renamable $r9, implicit-def $lc1, implicit-def $sa1
37 renamable $r8 = nsw A2_add renamable $r6, renamable $r2
40 successors: %bb.3(0x40000000), %bb.7(0x40000000)
41 liveins: $p0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8
43 J2_jumpf renamable $p0, %bb.7, implicit-def dead $pc
44 J2_jump %bb.3, implicit-def dead $pc
47 successors: %bb.4(0x80000000)
48 liveins: $p0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8
50 renamable $r13 = exact S2_asr_i_r renamable $r7, 1
51 renamable $r12 = COPY renamable $r4
52 renamable $r9 = COPY renamable $r4
53 renamable $r14 = nsw A2_addi renamable $r7, 1
54 renamable $r15 = nsw M2_mpyi killed renamable $r13, renamable $r3
55 renamable $r9 = M2_maci killed renamable $r9, killed renamable $r14, renamable $r5
56 renamable $r13 = A2_add renamable $r8, renamable $r15
57 renamable $r28 = A2_add renamable $r15, renamable $r2
58 renamable $r10 = A2_add renamable $r15, renamable $r6
59 renamable $r12 = M2_maci killed renamable $r12, renamable $r7, renamable $r5
60 renamable $r13 = S2_addasl_rrri renamable $r0, killed renamable $r13, 1
61 renamable $r14 = S2_addasl_rrri renamable $r0, killed renamable $r15, 1
62 renamable $r15 = S2_addasl_rrri renamable $r0, killed renamable $r28, 1
63 renamable $r28 = S2_addasl_rrri renamable $r0, killed renamable $r10, 1
66 successors: %bb.5(0x40000000), %bb.6(0x40000000)
67 liveins: $p0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r12, $r13, $r14, $r15, $r28
69 renamable $v0, renamable $r14 = V6_vL32b_pi killed renamable $r14, 64
70 renamable $p1 = C2_cmpgtui renamable $r1, 1
71 renamable $r10 = A2_addi renamable $r1, -1
72 renamable $v2, renamable $r28 = V6_vL32b_pi killed renamable $r28, 64
73 renamable $v1 = V6_vaddh renamable $v0, renamable $v2
74 renamable $v3, renamable $r15 = V6_vL32b_pi killed renamable $r15, 64
75 renamable $v0 = V6_vsubh killed renamable $v0, killed renamable $v2
76 J2_loop0r %bb.5, killed renamable $r10, implicit-def $lc0, implicit-def $sa0, implicit-def $usr
77 renamable $v4, renamable $r13 = V6_vL32b_pi killed renamable $r13, 64
78 renamable $v2 = V6_vaddh renamable $v3, renamable $v4
79 J2_jumpf killed renamable $p1, %bb.6, implicit-def $pc
80 J2_jump %bb.5, implicit-def $pc
83 successors: %bb.5(0x7c000000), %bb.6(0x04000000)
84 liveins: $p0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r12, $r13, $r14, $r15, $r28, $v0, $v1, $v2, $v3, $v4
86 renamable $v3 = V6_vsubh killed renamable $v3, killed renamable $v4
87 renamable $v4, renamable $r14 = V6_vL32b_pi killed renamable $r14, 64
88 renamable $v5 = V6_vnavgh renamable $v1, renamable $v2
89 renamable $v1 = V6_vavgh killed renamable $v1, killed renamable $v2
90 renamable $v2, renamable $r28 = V6_vL32b_pi killed renamable $r28, 64
91 renamable $v1 = V6_vsathub killed renamable $v5, killed renamable $v1
92 renamable $v5 = V6_vnavgh renamable $v0, renamable $v3
93 renamable $v6 = V6_vavgh killed renamable $v0, killed renamable $v3
94 renamable $r12 = V6_vS32b_pi killed renamable $r12, 64, killed renamable $v1
95 renamable $v1 = V6_vaddh renamable $v4, renamable $v2
96 renamable $v3, renamable $r15 = V6_vL32b_pi killed renamable $r15, 64
97 renamable $v0 = V6_vsubh killed renamable $v4, killed renamable $v2
98 renamable $v4, renamable $r13 = V6_vL32b_pi killed renamable $r13, 64
99 renamable $v2 = V6_vaddh renamable $v3, renamable $v4
100 renamable $v5 = V6_vsathub killed renamable $v5, killed renamable $v6
101 renamable $r9 = V6_vS32b_pi killed renamable $r9, 64, killed renamable $v5
102 ENDLOOP0 %bb.5, implicit-def $pc, implicit-def $lc0, implicit $sa0, implicit $lc0
103 J2_jump %bb.6, implicit-def $pc
106 successors: %bb.7(0x80000000)
107 liveins: $p0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r12, $v0, $v1, $v2, $v3, $v4
109 renamable $v3 = V6_vsubh killed renamable $v3, killed renamable $v4
110 renamable $v4 = V6_vavgh renamable $v1, renamable $v2
111 renamable $v1 = V6_vnavgh killed renamable $v1, killed renamable $v2
112 renamable $v2 = V6_vavgh renamable $v0, renamable $v3
113 renamable $v0 = V6_vnavgh killed renamable $v0, killed renamable $v3
114 renamable $v1 = V6_vsathub killed renamable $v1, killed renamable $v4
115 dead renamable $r12 = V6_vS32b_pi killed renamable $r12, 64, killed renamable $v1
116 renamable $v0 = V6_vsathub killed renamable $v0, killed renamable $v2
117 dead renamable $r9 = V6_vS32b_pi killed renamable $r9, 64, killed renamable $v0
118 J2_jump %bb.7, implicit-def $pc
121 successors: %bb.2(0x7c000000), %bb.8(0x04000000)
122 liveins: $p0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8
124 renamable $r7 = nsw A2_addi killed renamable $r7, 2
125 ENDLOOP1 %bb.2, implicit-def $pc, implicit-def $lc1, implicit $sa1, implicit $lc1
126 J2_jump %bb.8, implicit-def dead $pc
129 PS_jmpret $r31, implicit-def dead $pc