1# RUN: llc -march=hexagon -run-pass if-converter -o - %s | FileCheck %s
2# Check that an implicit use is generated for a predicated instruction
3# when a subregister of the redefined register is live.
4
5# CHECK-LABEL: name: foo
6
7# Verify the predicated block:
8# CHECK-LABEL: bb.0:
9# CHECK: liveins: $r0, $r1, $p0, $d8
10# CHECK: $d8 = A2_combinew killed $r0, killed $r1
11# CHECK: $d8 = L2_ploadrdf_io $p0, $r29, 0, implicit killed $d8
12# CHECK: J2_jumprf killed $p0, $r31, implicit-def $pc, implicit-def $pc, implicit $d8
13
14--- |
15  define void @foo() {
16    ret void
17  }
18...
19
20
21---
22name:            foo
23alignment:       16
24tracksRegLiveness: true
25liveins:
26  - { reg: '$r0' }
27  - { reg: '$r1' }
28  - { reg: '$p0' }
29  - { reg: '$d8' }
30body:             |
31  bb.0:
32    successors: %bb.1, %bb.2
33    liveins: $r0, $r1, $p0, $d8
34    $d8 = A2_combinew killed $r0, killed $r1
35    J2_jumpf killed $p0, %bb.2, implicit-def $pc
36
37  bb.1:
38    liveins: $r17
39    $r0 = A2_tfrsi 0
40    $r1 = A2_tfrsi 0
41    A2_nop ; non-predicable
42    J2_jumpr killed $r31, implicit-def dead $pc, implicit killed $d0
43
44  bb.2:
45    ; Predicate this block.
46    $d8 = L2_loadrd_io $r29, 0
47    J2_jumpr killed $r31, implicit-def dead $pc, implicit killed $d8
48
49...
50
51