1 # RUN: llc -o - -mtriple=thumbv7--windows-gnu -run-pass=greedy -run-pass=virtregrewriter %s | FileCheck %s
3 target datalayout = "e-m:w-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
4 target triple = "thumbv7--windows-gnu"
6 define void @subregLiveThrough() { ret void }
7 define void @subregNotLiveThrough() { ret void }
8 define void @subregNotLiveThrough2() { ret void }
12 # Check that we properly recognize that r1 is live through
13 # the first subreg copy.
14 # That will materialize as an implicit use of the big register
18 # CHECK-LABEL: name: subregLiveThrough
19 name: subregLiveThrough
20 tracksRegLiveness: true
22 - { id: 0, class: gprpair }
27 ; That copy is being coalesced so we should use a KILL
28 ; placeholder. If that's not a kill that means we probably
29 ; not coalescing %0 and $r0_r1 and thus we are not testing
30 ; the problematic code anymore.
32 ; CHECK: $r0 = KILL $r0, implicit killed $r0_r1, implicit-def $r0_r1
33 ; CHECK-NEXT: $r1 = KILL $r1, implicit killed $r0_r1
34 undef %0.gsub_0 = COPY $r0
36 tBX_RET 14, $noreg, implicit %0
42 # Check that we properly recognize that r1 is *not* live through
43 # the first subreg copy.
44 # CHECK-LABEL: name: subregNotLiveThrough
45 name: subregNotLiveThrough
46 tracksRegLiveness: true
48 - { id: 0, class: gprpair }
53 ; r1 is not live through so check we are not implicitly using
55 ; CHECK: $r0 = KILL $r0, implicit-def $r0_r1
57 undef %0.gsub_0 = COPY $r0
58 tBX_RET 14, $noreg, implicit %0
64 # Check that we properly recognize that r1 is *not* live through
65 # the first subreg copy. It is defined by this copy, but is not
67 # CHECK-LABEL: name: subregNotLiveThrough2
68 name: subregNotLiveThrough2
69 tracksRegLiveness: true
71 - { id: 0, class: gprpair }
76 ; r1 is not live through so check we are not implicitly using
78 ; CHECK: $r0 = KILL $r0, implicit-def $r1, implicit-def $r0_r1
80 undef %0.gsub_0 = COPY $r0, implicit-def $r1
81 tBX_RET 14, $noreg, implicit %0