1 # RUN: llc -march=hexagon -run-pass branch-folder %s -o - -verify-machineinstrs | FileCheck %s
3 # Branch folding will perform tail merging of bb.1 and bb.2, and bb.2 will
4 # become the common tail. The use of R0 in bb.2 is <undef> while the
5 # corresponding use in bb.1 is not. The common tail will have the <undef>
6 # flag removed, which will cause R0 to become a live-in to bb.2. The problem
7 # is that R0 is not live-out from all predecessors of bb.2, namely is not
8 # live-out from bb.0. To remedy that, the branch folder should add an
9 # IMPLICIT_DEF to that block.
11 # CHECK-LABEL: name: func0
13 # CHECK: $r0 = IMPLICIT_DEF
17 # CHECK: PS_storerhabs 0, $r0
22 tracksRegLiveness: true
27 successors: %bb.1, %bb.2
28 J2_jumpt undef $p0, %bb.2, implicit-def $pc
29 J2_jump %bb.1, implicit-def $pc
34 $r0 = L2_loadruh_io undef $r1, 0
35 PS_storerhabs 0, killed $r0
36 J2_jump %bb.3, implicit-def $pc
41 PS_storerhabs 0, undef $r0
42 J2_jump %bb.3, implicit-def $pc
46 PS_jmpret killed $r31, implicit-def $pc
49 # CHECK-LABEL: name: func1
51 # CHECK: $r0 = IMPLICIT_DEF
55 # CHECK: PS_storerhabs 0, killed $r0
59 tracksRegLiveness: true
64 successors: %bb.1, %bb.2
65 J2_jumpt undef $p0, %bb.2, implicit-def $pc
66 J2_jump %bb.1, implicit-def $pc
72 PS_storerhabs 0, undef $r0
74 J2_jump %bb.3, implicit-def $pc
79 $r0 = L2_loadruh_io undef $r1, 0
80 PS_storerhabs 0, killed $r0
82 J2_jump %bb.3, implicit-def $pc
86 PS_jmpret killed $r31, implicit undef $r0, implicit-def $pc