1 # RUN: llc -march=hexagon -run-pass hwloops %s -o - | FileCheck %s
3 # Normally, if the registers holding the induction variable's bounds
4 # are redefined inside of the loop's body, the loop cannot be converted
5 # to a hardware loop. However, if the redefining instruction is actually
6 # loading an immediate value into the register, this conversion is both
7 # possible and legal (since the immediate itself will be used in the
8 # loop setup in the preheader).
10 # CHECK: [[R0:%[0-9]+]]:intregs = A2_tfrsi 1920
11 # CHECK: J2_loop0r %bb.1, [[R0]]
13 # CHECK: bb.1.b1 (machine-block-address-taken):
14 # CHECK: ENDLOOP0 %bb.1
30 tracksRegLiveness: true
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 }
50 successors: %bb.1, %bb.2
51 %3 = PHI %0, %bb.0, %6, %bb.1
52 %4 = PHI %1, %bb.0, %5, %bb.1
53 S4_storerh_rr %2, %4, 0, %3
56 ; This definition of %7 should not prevent conversion to hardware loop.
59 J2_jumpf %8, %bb.1, implicit-def $pc
60 J2_jump %bb.2, implicit-def $pc