mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-07 12:30:44 +00:00
31a5f885bf
The register allocator can split a live interval of a register into a set of smaller intervals. After the allocation of registers is complete, the rewriter will modify the IR to replace virtual registers with the corres- ponding physical registers. At this stage, if a register corresponding to a subregister of a virtual register is used, the rewriter will check if that subregister is undefined, and if so, it will add the <undef> flag to the machine operand. The function verifying liveness of the subregis- ter would assume that it is undefined, unless any of the subranges of the live interval proves otherwise. The problem is that the live intervals created during splitting do not have any subranges, even if the original parent interval did. This could result in the <undef> flag placed on a register that is actually defined. Differential Revision: http://reviews.llvm.org/D21189 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@279625 91177308-0d34-0410-b5e6-96231b3b80d8
52 lines
959 B
YAML
52 lines
959 B
YAML
# RUN: llc -march=amdgcn -run-pass liveintervals -debug-only=regalloc -o /dev/null %s 2>&1 | FileCheck %s
|
|
# REQUIRES: asserts
|
|
|
|
# CHECK: INTERVALS
|
|
# CHECK: vreg0
|
|
# CHECK-LABEL: Machine code for function test0:
|
|
|
|
# CHECK: INTERVALS
|
|
# CHECK: vreg0
|
|
# CHECK-LABEL: Machine code for function test1:
|
|
|
|
--- |
|
|
define void @test0() { ret void }
|
|
define void @test1() { ret void }
|
|
...
|
|
---
|
|
name: test0
|
|
registers:
|
|
- { id: 0, class: sreg_64 }
|
|
body: |
|
|
bb.0:
|
|
S_NOP 0, implicit-def %0
|
|
S_NOP 0, implicit %0
|
|
|
|
S_NOP 0, implicit-def undef %0.sub0
|
|
S_NOP 0, implicit %0
|
|
...
|
|
---
|
|
name: test1
|
|
registers:
|
|
- { id: 0, class: sreg_64 }
|
|
body: |
|
|
bb.0:
|
|
successors: %bb.1, %bb.2
|
|
S_CBRANCH_VCCNZ %bb.1, implicit undef %vcc
|
|
S_BRANCH %bb.2
|
|
|
|
bb.1:
|
|
successors: %bb.3
|
|
S_NOP 0, implicit-def undef %0.sub0
|
|
S_BRANCH %bb.3
|
|
|
|
bb.2:
|
|
successors: %bb.3
|
|
S_NOP 0, implicit-def %0
|
|
S_BRANCH %bb.3
|
|
|
|
bb.3:
|
|
S_NOP 0
|
|
S_NOP 0, implicit %0
|
|
...
|