64 lines · plain
1# RUN: llc -mtriple=hexagon -run-pass hwloops %s -o - | FileCheck %s2 3# Normally, if the registers holding the induction variable's bounds4# are redefined inside of the loop's body, the loop cannot be converted5# to a hardware loop. However, if the redefining instruction is actually6# loading an immediate value into the register, this conversion is both7# possible and legal (since the immediate itself will be used in the8# loop setup in the preheader).9 10# CHECK: [[R0:%[0-9]+]]:intregs = A2_tfrsi 192011# CHECK: J2_loop0r %bb.1, [[R0]]12#13# CHECK: bb.1.b1 (machine-block-address-taken):14# CHECK: ENDLOOP0 %bb.115 16 17--- |18 define void @fred() {19 b0:20 br label %b121 b1:22 br label %b223 b2:24 ret void25 }26...27 28---29name: fred30tracksRegLiveness: true31registers:32 - { id: 0, class: intregs }33 - { id: 1, class: intregs }34 - { id: 2, class: intregs }35 - { id: 3, class: intregs }36 - { id: 4, class: intregs }37 - { id: 5, class: intregs }38 - { id: 6, class: intregs }39 - { id: 7, class: intregs }40 - { id: 8, class: predregs }41body: |42 bb.0.b0:43 liveins: $r044 successors: %bb.145 %0 = A2_tfrsi 046 %1 = A2_tfrsi 047 %2 = COPY $r048 49 bb.1.b1:50 successors: %bb.1, %bb.251 %3 = PHI %0, %bb.0, %6, %bb.152 %4 = PHI %1, %bb.0, %5, %bb.153 S4_storerh_rr %2, %4, 0, %354 %5 = A2_addi %4, 255 %6 = A2_addi %3, 156 ; This definition of %7 should not prevent conversion to hardware loop.57 %7 = A2_tfrsi 384058 %8 = C2_cmpeq %5, %759 J2_jumpf %8, %bb.1, implicit-def $pc60 J2_jump %bb.2, implicit-def $pc61 62 bb.2.b2:63...64