File: select-returnaddress-liveins.mir

package info (click to toggle)
llvm-toolchain-11 1%3A11.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 995,808 kB
  • sloc: cpp: 4,767,656; ansic: 760,916; asm: 477,436; python: 170,940; objc: 69,804; lisp: 29,914; sh: 23,855; f90: 18,173; pascal: 7,551; perl: 7,471; ml: 5,603; awk: 3,489; makefile: 2,573; xml: 915; cs: 573; fortran: 503; javascript: 452
file content (61 lines) | stat: -rw-r--r-- 1,726 bytes parent folder | download | duplicates (2)
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
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=aarch64 -global-isel -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s

--- |
  define void @lr_other_block() { ret void }
  define void @already_live_in() { ret void }
  declare i8* @llvm.returnaddress(i32 immarg)
...
---
name:            lr_other_block
alignment:       4
legalized:       true
regBankSelected: true
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: lr_other_block
  ; CHECK: bb.0:
  ; CHECK:   successors: %bb.1(0x80000000)
  ; CHECK:   liveins: $w0, $x0, $lr
  ; CHECK:   [[COPY:%[0-9]+]]:gpr64 = COPY $lr
  ; CHECK:   B %bb.1
  ; CHECK: bb.1:
  ; CHECK:   $x0 = COPY [[COPY]]
  ; CHECK:   RET_ReallyLR implicit $x0
  ; LR should be added as a livein to the entry block.

  bb.0:
    ; We should have lr as a livein to bb.0, and a copy from LR.
    liveins: $w0, $x0
    G_BR %bb.1
  bb.1:
    %4:gpr(p0) = G_INTRINSIC intrinsic(@llvm.returnaddress), 0
    $x0 = COPY %4
    RET_ReallyLR implicit $x0
...
---
name:            already_live_in
alignment:       4
legalized:       true
regBankSelected: true
tracksRegLiveness: true
body:             |
  ; CHECK-LABEL: name: already_live_in
  ; CHECK: bb.0:
  ; CHECK:   successors: %bb.1(0x80000000)
  ; CHECK:   liveins: $w0, $x0, $lr
  ; CHECK:   [[COPY:%[0-9]+]]:gpr64 = COPY $lr
  ; CHECK:   B %bb.1
  ; CHECK: bb.1:
  ; CHECK:   $x0 = COPY [[COPY]]
  ; CHECK:   RET_ReallyLR implicit $x0
  ; We should not have LR listed as a livein twice.

  bb.0:
    liveins: $w0, $x0, $lr
    G_BR %bb.1
  bb.1:
    %4:gpr(p0) = G_INTRINSIC intrinsic(@llvm.returnaddress), 0
    $x0 = COPY %4
    RET_ReallyLR implicit $x0
...