File: virtregrewriter-subregliveness.mir

package info (click to toggle)
llvm-toolchain-14 1%3A14.0.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,496,180 kB
  • sloc: cpp: 5,593,972; ansic: 986,872; asm: 585,869; python: 184,223; objc: 72,530; lisp: 31,119; f90: 27,793; javascript: 9,780; pascal: 9,762; sh: 9,482; perl: 7,468; ml: 5,432; awk: 3,523; makefile: 2,538; xml: 953; cs: 573; fortran: 567
file content (84 lines) | stat: -rw-r--r-- 2,364 bytes parent folder | download | duplicates (26)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# RUN: llc  -o -  -mtriple=thumbv7--windows-gnu -run-pass=greedy -run-pass=virtregrewriter %s | FileCheck %s
--- |
  target datalayout = "e-m:w-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
  target triple = "thumbv7--windows-gnu"
  
  define void @subregLiveThrough() { ret void }
  define void @subregNotLiveThrough() { ret void }
  define void @subregNotLiveThrough2() { ret void }

...
---
# Check that we properly recognize that r1 is live through
# the first subreg copy.
# That will materialize as an implicit use of the big register
# on that copy.
# PR34107.
#
# CHECK-LABEL: name: subregLiveThrough
name:            subregLiveThrough
tracksRegLiveness: true
registers:
  - { id: 0, class: gprpair }
body:             |
  bb.0:
    liveins: $r0, $r1

    ; That copy is being coalesced so we should use a KILL
    ; placeholder. If that's not a kill that means we probably
    ; not coalescing %0 and $r0_r1 and thus we are not testing
    ; the problematic code anymore.
    ;
    ; CHECK: $r0 = KILL $r0, implicit killed $r0_r1, implicit-def $r0_r1
    ; CHECK-NEXT: $r1 = KILL $r1, implicit killed $r0_r1
    undef %0.gsub_0 = COPY $r0
    %0.gsub_1 = COPY $r1
    tBX_RET 14, $noreg, implicit %0
  

...

---
# Check that we properly recognize that r1 is *not* live through
# the first subreg copy.
# CHECK-LABEL: name: subregNotLiveThrough
name:            subregNotLiveThrough
tracksRegLiveness: true
registers:
  - { id: 0, class: gprpair }
body:             |
  bb.0:
    liveins: $r0, $r1

    ; r1 is not live through so check we are not implicitly using
    ; the big register.
    ; CHECK: $r0 = KILL $r0, implicit-def $r0_r1
    ; CHECK-NEXT: tBX_RET
    undef %0.gsub_0 = COPY $r0
    tBX_RET 14, $noreg, implicit %0
  

...

---
# Check that we properly recognize that r1 is *not* live through
# the first subreg copy. It is defined by this copy, but is not
# through.
# CHECK-LABEL: name: subregNotLiveThrough2
name:            subregNotLiveThrough2
tracksRegLiveness: true
registers:
  - { id: 0, class: gprpair }
body:             |
  bb.0:
    liveins: $r0, $r1

    ; r1 is not live through so check we are not implicitly using
    ; the big register.
    ; CHECK: $r0 = KILL $r0, implicit-def $r1, implicit-def $r0_r1
    ; CHECK-NEXT: tBX_RET
    undef %0.gsub_0 = COPY $r0, implicit-def $r1
    tBX_RET 14, $noreg, implicit %0
  

...