2019-12-17 20:20:32 +08:00
|
|
|
# RUN: llc -march=amdgcn -mcpu=gfx908 -run-pass=postra-machine-sink -verify-machineinstrs -o - %s | FileCheck %s
|
|
|
|
|
|
|
|
# Don't sink copy that writes sub-register of another copy source register
|
|
|
|
# CHECK-LABEL: name: donotsinkcopy
|
|
|
|
# CHECK-LABEL: bb.0:
|
|
|
|
# CHECK: renamable $sgpr1 = COPY renamable $sgpr2
|
|
|
|
# CHECK-LABEL: bb.1:
|
2020-02-29 04:28:45 +08:00
|
|
|
# CHECK: liveins: $sgpr0_sgpr1:0x0000000000000003
|
2019-12-17 20:20:32 +08:00
|
|
|
# CHECK: renamable $vgpr1_vgpr2 = COPY renamable $sgpr0_sgpr1
|
|
|
|
|
|
|
|
---
|
|
|
|
name: donotsinkcopy
|
|
|
|
tracksRegLiveness: true
|
|
|
|
body: |
|
|
|
|
bb.0:
|
|
|
|
liveins: $sgpr0, $sgpr2, $vgpr3
|
|
|
|
S_CMP_LT_U32 renamable $sgpr2, target-flags(amdgpu-gotprel32-lo) 2, implicit-def $scc
|
|
|
|
renamable $sgpr1 = COPY renamable $sgpr2
|
|
|
|
renamable $vgpr1_vgpr2 = COPY renamable $sgpr0_sgpr1
|
|
|
|
S_CBRANCH_SCC0 %bb.2, implicit $scc
|
|
|
|
|
|
|
|
bb.1:
|
|
|
|
liveins: $vgpr2, $sgpr0_sgpr1:0x00000001
|
|
|
|
S_BRANCH %bb.4
|
|
|
|
|
|
|
|
bb.2:
|
|
|
|
liveins: $sgpr1
|
|
|
|
|
|
|
|
bb.4:
|
|
|
|
S_ENDPGM 0
|
|
|
|
...
|