1 # RUN: llc -march=amdgcn -verify-machineinstrs -run-pass simple-register-coalescing,rename-independent-subregs -o - %s | FileCheck %s
3 define amdgpu_kernel void @test0() { ret void }
4 define amdgpu_kernel void @test1() { ret void }
7 # In the test below we have two independent def+use pairs of subregister1 which
8 # can be moved to a new virtual register. The third def of sub1 however is used
9 # in combination with sub0 and needs to stay with the original vreg.
10 # CHECK-LABEL: name: test0
11 # CHECK: S_NOP 0, implicit-def undef %0.sub0
12 # CHECK: S_NOP 0, implicit-def undef %2.sub1
13 # CHECK: S_NOP 0, implicit %2.sub1
14 # CHECK: S_NOP 0, implicit-def undef %1.sub1
15 # CHECK: S_NOP 0, implicit %1.sub1
16 # CHECK: S_NOP 0, implicit-def %0.sub1
17 # CHECK: S_NOP 0, implicit %0
20 - { id: 0, class: sreg_128 }
23 S_NOP 0, implicit-def undef %0.sub0
24 S_NOP 0, implicit-def %0.sub1
25 S_NOP 0, implicit %0.sub1
26 S_NOP 0, implicit-def %0.sub1
27 S_NOP 0, implicit %0.sub1
28 S_NOP 0, implicit-def %0.sub1
32 # Test for a bug where we would incorrectly query liveness at the instruction
33 # index in rewriteOperands(). This should pass the verifier afterwards.
36 # CHECK: S_NOP 0, implicit-def undef %2.sub2
38 # CHECK: S_NOP 0, implicit-def %2.sub1
39 # CHECK-NEXT: S_NOP 0, implicit-def %2.sub3
40 # CHECK-NEXT: S_NOP 0, implicit %2
41 # CHECK-NEXT: S_NOP 0, implicit-def undef %0.sub0
42 # CHECK-NEXT: S_NOP 0, implicit %2.sub1
43 # CHECK-NEXT: S_NOP 0, implicit %0.sub0
45 # CHECK: S_NOP 0, implicit %2.sub
48 - { id: 0, class: sreg_128 }
49 - { id: 1, class: sreg_128 }
52 S_NOP 0, implicit-def undef %0.sub2
53 S_CBRANCH_VCCNZ %bb.1, implicit undef %vcc
57 S_NOP 0, implicit-def %0.sub1
58 S_NOP 0, implicit-def %0.sub3
62 S_NOP 0, implicit-def %1.sub0
63 S_NOP 0, implicit %1.sub1
64 S_NOP 0, implicit %1.sub0
67 S_NOP 0, implicit %0.sub2