121
|
1 # RUN: llc -o - -mtriple=thumbv7--windows-gnu -run-pass=greedy -run-pass=virtregrewriter %s | FileCheck %s
|
|
2 --- |
|
|
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"
|
|
5
|
|
6 define void @subregLiveThrough() { ret void }
|
|
7 define void @subregNotLiveThrough() { ret void }
|
|
8 define void @subregNotLiveThrough2() { ret void }
|
|
9
|
|
10 ...
|
|
11 ---
|
|
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
|
|
15 # on that copy.
|
|
16 # PR34107.
|
|
17 #
|
|
18 # CHECK-LABEL: name: subregLiveThrough
|
|
19 name: subregLiveThrough
|
|
20 tracksRegLiveness: true
|
|
21 registers:
|
|
22 - { id: 0, class: gprpair }
|
|
23 body: |
|
|
24 bb.0:
|
|
25 liveins: %r0, %r1
|
|
26
|
|
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.
|
|
31 ;
|
|
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
|
|
35 %0.gsub_1 = COPY %r1
|
|
36 tBX_RET 14, _, implicit %0
|
|
37
|
|
38
|
|
39 ...
|
|
40
|
|
41 ---
|
|
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
|
|
47 registers:
|
|
48 - { id: 0, class: gprpair }
|
|
49 body: |
|
|
50 bb.0:
|
|
51 liveins: %r0, %r1
|
|
52
|
|
53 ; r1 is not live through so check we are not implicitly using
|
|
54 ; the big register.
|
|
55 ; CHECK: %r0 = KILL %r0, implicit-def %r0_r1
|
|
56 ; CHECK-NEXT: tBX_RET
|
|
57 undef %0.gsub_0 = COPY %r0
|
|
58 tBX_RET 14, _, implicit %0
|
|
59
|
|
60
|
|
61 ...
|
|
62
|
|
63 ---
|
|
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
|
|
66 # through.
|
|
67 # CHECK-LABEL: name: subregNotLiveThrough2
|
|
68 name: subregNotLiveThrough2
|
|
69 tracksRegLiveness: true
|
|
70 registers:
|
|
71 - { id: 0, class: gprpair }
|
|
72 body: |
|
|
73 bb.0:
|
|
74 liveins: %r0, %r1
|
|
75
|
|
76 ; r1 is not live through so check we are not implicitly using
|
|
77 ; the big register.
|
|
78 ; CHECK: %r0 = KILL %r0, implicit-def %r1, implicit-def %r0_r1
|
|
79 ; CHECK-NEXT: tBX_RET
|
|
80 undef %0.gsub_0 = COPY %r0, implicit-def %r1
|
|
81 tBX_RET 14, _, implicit %0
|
|
82
|
|
83
|
|
84 ...
|