2017-09-07 04:45:24 +08:00
|
|
|
# RUN: llc -march=hexagon -run-pass branch-folder %s -o - -verify-machineinstrs | FileCheck %s
|
|
|
|
|
|
|
|
# Branch folding will perform tail merging of bb.1 and bb.2, and bb.2 will
|
|
|
|
# become the common tail. The use of R0 in bb.2 is <undef> while the
|
|
|
|
# corresponding use in bb.1 is not. The common tail will have the <undef>
|
|
|
|
# flag removed, which will cause R0 to become a live-in to bb.2. The problem
|
|
|
|
# is that R0 is not live-out from all predecessors of bb.2, namely is not
|
|
|
|
# live-out from bb.0. To remedy that, the branch folder should add an
|
|
|
|
# IMPLICIT_DEF to that block.
|
|
|
|
|
|
|
|
# CHECK-LABEL: name: func0
|
|
|
|
# CHECK-LABEL: bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
# CHECK: $r0 = IMPLICIT_DEF
|
2017-09-07 04:45:24 +08:00
|
|
|
# CHECK-LABEL: bb.1:
|
|
|
|
# CHECK-LABEL: bb.2:
|
2018-02-01 06:04:26 +08:00
|
|
|
# CHECK: liveins: $r0
|
|
|
|
# CHECK: PS_storerhabs 0, $r0
|
2017-09-07 04:45:24 +08:00
|
|
|
# CHECK: PS_jmpret
|
|
|
|
|
|
|
|
---
|
|
|
|
name: func0
|
|
|
|
tracksRegLiveness: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r31
|
2017-09-07 04:45:24 +08:00
|
|
|
successors: %bb.1, %bb.2
|
2018-02-01 06:04:26 +08:00
|
|
|
J2_jumpt undef $p0, %bb.2, implicit-def $pc
|
|
|
|
J2_jump %bb.1, implicit-def $pc
|
2017-09-07 04:45:24 +08:00
|
|
|
|
|
|
|
bb.1:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r31
|
2017-09-07 04:45:24 +08:00
|
|
|
successors: %bb.3
|
2018-02-01 06:04:26 +08:00
|
|
|
$r0 = L2_loadruh_io undef $r1, 0
|
|
|
|
PS_storerhabs 0, killed $r0
|
|
|
|
J2_jump %bb.3, implicit-def $pc
|
2017-09-07 04:45:24 +08:00
|
|
|
|
|
|
|
bb.2:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r31
|
2017-09-07 04:45:24 +08:00
|
|
|
successors: %bb.3
|
2018-02-01 06:04:26 +08:00
|
|
|
PS_storerhabs 0, undef $r0
|
|
|
|
J2_jump %bb.3, implicit-def $pc
|
2017-09-07 04:45:24 +08:00
|
|
|
|
|
|
|
bb.3:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r31
|
|
|
|
PS_jmpret killed $r31, implicit-def $pc
|
2017-09-07 04:45:24 +08:00
|
|
|
...
|
|
|
|
---
|
|
|
|
# CHECK-LABEL: name: func1
|
|
|
|
# CHECK-LABEL: bb.1:
|
2018-02-01 06:04:26 +08:00
|
|
|
# CHECK: $r0 = IMPLICIT_DEF
|
2017-09-07 04:45:24 +08:00
|
|
|
# CHECK-LABEL: bb.2:
|
|
|
|
# CHECK-LABEL: bb.3:
|
2018-02-01 06:04:26 +08:00
|
|
|
# CHECK: liveins: $r0
|
|
|
|
# CHECK: PS_storerhabs 0, killed $r0
|
2017-09-07 04:45:24 +08:00
|
|
|
# CHECK: PS_jmpret
|
|
|
|
|
|
|
|
name: func1
|
|
|
|
tracksRegLiveness: true
|
|
|
|
|
|
|
|
body: |
|
|
|
|
bb.0:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r31
|
2017-09-07 04:45:24 +08:00
|
|
|
successors: %bb.1, %bb.2
|
2018-02-01 06:04:26 +08:00
|
|
|
J2_jumpt undef $p0, %bb.2, implicit-def $pc
|
|
|
|
J2_jump %bb.1, implicit-def $pc
|
2017-09-07 04:45:24 +08:00
|
|
|
|
|
|
|
bb.1:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r31
|
2017-09-07 04:45:24 +08:00
|
|
|
successors: %bb.3
|
2018-02-01 06:04:26 +08:00
|
|
|
$r1 = A2_tfrsi 1
|
|
|
|
PS_storerhabs 0, undef $r0
|
|
|
|
$r0 = A2_tfrsi 1
|
|
|
|
J2_jump %bb.3, implicit-def $pc
|
2017-09-07 04:45:24 +08:00
|
|
|
|
|
|
|
bb.2:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r31
|
2017-09-07 04:45:24 +08:00
|
|
|
successors: %bb.3
|
2018-02-01 06:04:26 +08:00
|
|
|
$r0 = L2_loadruh_io undef $r1, 0
|
|
|
|
PS_storerhabs 0, killed $r0
|
|
|
|
$r0 = A2_tfrsi 1
|
|
|
|
J2_jump %bb.3, implicit-def $pc
|
2017-09-07 04:45:24 +08:00
|
|
|
|
|
|
|
bb.3:
|
2018-02-01 06:04:26 +08:00
|
|
|
liveins: $r31
|
|
|
|
PS_jmpret killed $r31, implicit undef $r0, implicit-def $pc
|
2017-09-07 04:45:24 +08:00
|
|
|
...
|