File: global-value64.mir

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (128 lines) | stat: -rw-r--r-- 5,113 bytes parent folder | download | duplicates (8)
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
# RUN: llc -mtriple=riscv64 -run-pass=instruction-select -relocation-model=pic \
# RUN:   %s -o - | FileCheck --check-prefix=RV64-PIE %s
# RUN: llc -mtriple=riscv64 -run-pass=instruction-select \
# RUN:   -mattr=+tagged-globals %s -o - | FileCheck  \
# RUN:   --check-prefix=RV64-NOPIE-TAG %s
# RUN: llc -mtriple=riscv64 -run-pass=instruction-select -code-model=small \
# RUN:   %s -o - | FileCheck --check-prefix=RV64-SMALL-NOPIE-NOTAG %s
# RUN: llc -mtriple=riscv64 -run-pass=instruction-select -code-model=medium \
# RUN:   %s -o - | FileCheck --check-prefix=RV64-MED %s

--- |
  @x = global i32 0, align 4
  define ptr @global_addr() {
  entry:
    ret ptr @x
  }
  @y = extern_weak global i32, align 4
  define ptr @extern_weak_global_addr() {
  entry:
    ret ptr @y
  }
  @z = dso_local global i32 0, align 4
  define ptr @local_global_addr() {
  entry:
    ret ptr @z
  }
...
---
name:            global_addr
legalized:       true
regBankSelected: true
tracksRegLiveness: true
registers:
  - { id: 0, class: gprb, preferred-register: '' }
body:             |
  bb.1.entry:
    ; RV64-PIE-LABEL: name: global_addr
    ; RV64-PIE: [[PseudoLGA:%[0-9]+]]:gpr = PseudoLGA @x :: (dereferenceable invariant load (p0) from got)
    ; RV64-PIE-NEXT: $x10 = COPY [[PseudoLGA]]
    ; RV64-PIE-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-NOPIE-TAG-LABEL: name: global_addr
    ; RV64-NOPIE-TAG: [[PseudoLGA:%[0-9]+]]:gpr = PseudoLGA @x :: (dereferenceable invariant load (p0) from got)
    ; RV64-NOPIE-TAG-NEXT: $x10 = COPY [[PseudoLGA]]
    ; RV64-NOPIE-TAG-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-SMALL-NOPIE-NOTAG-LABEL: name: global_addr
    ; RV64-SMALL-NOPIE-NOTAG: [[LUI:%[0-9]+]]:gpr = LUI target-flags(riscv-hi) @x
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI [[LUI]], target-flags(riscv-lo) @x
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: $x10 = COPY [[ADDI]]
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-MED-LABEL: name: global_addr
    ; RV64-MED: [[PseudoLLA:%[0-9]+]]:gpr = PseudoLLA @x
    ; RV64-MED-NEXT: $x10 = COPY [[PseudoLLA]]
    ; RV64-MED-NEXT: PseudoRET implicit $x10
    %0:gprb(p0) = G_GLOBAL_VALUE @x
    $x10 = COPY %0(p0)
    PseudoRET implicit $x10
...
---
name:            extern_weak_global_addr
legalized:       true
regBankSelected: true
tracksRegLiveness: true
registers:
  - { id: 0, class: gprb, preferred-register: '' }
body:             |
  bb.1.entry:
    ; RV64-PIE-LABEL: name: extern_weak_global_addr
    ; RV64-PIE: [[PseudoLGA:%[0-9]+]]:gpr = PseudoLGA @y :: (dereferenceable invariant load (p0) from got)
    ; RV64-PIE-NEXT: $x10 = COPY [[PseudoLGA]]
    ; RV64-PIE-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-NOPIE-TAG-LABEL: name: extern_weak_global_addr
    ; RV64-NOPIE-TAG: [[PseudoLGA:%[0-9]+]]:gpr = PseudoLGA @y :: (dereferenceable invariant load (p0) from got)
    ; RV64-NOPIE-TAG-NEXT: $x10 = COPY [[PseudoLGA]]
    ; RV64-NOPIE-TAG-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-SMALL-NOPIE-NOTAG-LABEL: name: extern_weak_global_addr
    ; RV64-SMALL-NOPIE-NOTAG: [[LUI:%[0-9]+]]:gpr = LUI target-flags(riscv-hi) @y
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI [[LUI]], target-flags(riscv-lo) @y
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: $x10 = COPY [[ADDI]]
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-MED-LABEL: name: extern_weak_global_addr
    ; RV64-MED: [[PseudoLGA:%[0-9]+]]:gpr = PseudoLGA @y :: (dereferenceable invariant load (p0) from got)
    ; RV64-MED-NEXT: $x10 = COPY [[PseudoLGA]]
    ; RV64-MED-NEXT: PseudoRET implicit $x10
    %0:gprb(p0) = G_GLOBAL_VALUE @y
    $x10 = COPY %0(p0)
    PseudoRET implicit $x10
...
---
name:            local_global_addr
legalized:       true
regBankSelected: true
tracksRegLiveness: true
registers:
  - { id: 0, class: gprb, preferred-register: '' }
body:             |
  bb.1.entry:
    ; RV64-PIE-LABEL: name: local_global_addr
    ; RV64-PIE: [[PseudoLLA:%[0-9]+]]:gpr = PseudoLLA @z
    ; RV64-PIE-NEXT: $x10 = COPY [[PseudoLLA]]
    ; RV64-PIE-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-NOPIE-TAG-LABEL: name: local_global_addr
    ; RV64-NOPIE-TAG: [[PseudoLGA:%[0-9]+]]:gpr = PseudoLGA @z :: (dereferenceable invariant load (p0) from got)
    ; RV64-NOPIE-TAG-NEXT: $x10 = COPY [[PseudoLGA]]
    ; RV64-NOPIE-TAG-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-SMALL-NOPIE-NOTAG-LABEL: name: local_global_addr
    ; RV64-SMALL-NOPIE-NOTAG: [[LUI:%[0-9]+]]:gpr = LUI target-flags(riscv-hi) @z
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: [[ADDI:%[0-9]+]]:gpr = ADDI [[LUI]], target-flags(riscv-lo) @z
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: $x10 = COPY [[ADDI]]
    ; RV64-SMALL-NOPIE-NOTAG-NEXT: PseudoRET implicit $x10
    ;
    ; RV64-MED-LABEL: name: local_global_addr
    ; RV64-MED: [[PseudoLLA:%[0-9]+]]:gpr = PseudoLLA @z
    ; RV64-MED-NEXT: $x10 = COPY [[PseudoLLA]]
    ; RV64-MED-NEXT: PseudoRET implicit $x10
    %0:gprb(p0) = G_GLOBAL_VALUE @z
    $x10 = COPY %0(p0)
    PseudoRET implicit $x10
...