File: constantpool.ll

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 (122 lines) | stat: -rw-r--r-- 4,393 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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
; RUN: llc < %s -mtriple=riscv32 -global-isel -code-model=small \
; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=RV32-SMALL
; RUN: llc < %s -mtriple=riscv32 -global-isel -code-model=medium \
; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=RV32-MEDIUM
; RUN: llc < %s -mtriple=riscv32 -global-isel -relocation-model=pic \
; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=RV32-PIC
; RUN: llc < %s -mtriple=riscv64 -global-isel -code-model=small \
; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=RV64-SMALL
; RUN: llc < %s -mtriple=riscv64 -global-isel -code-model=medium \
; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=RV64-MEDIUM
; RUN: llc < %s -mtriple=riscv64 -global-isel -relocation-model=pic \
; RUN:   -verify-machineinstrs | FileCheck %s --check-prefix=RV64-PIC

define void @constpool_f32(ptr %p) {
; RV32-SMALL-LABEL: constpool_f32:
; RV32-SMALL:       # %bb.0:
; RV32-SMALL-NEXT:    lui a1, %hi(.LCPI0_0)
; RV32-SMALL-NEXT:    lw a1, %lo(.LCPI0_0)(a1)
; RV32-SMALL-NEXT:    sw a1, 0(a0)
; RV32-SMALL-NEXT:    ret
;
; RV32-MEDIUM-LABEL: constpool_f32:
; RV32-MEDIUM:       # %bb.0:
; RV32-MEDIUM-NEXT:  .Lpcrel_hi0:
; RV32-MEDIUM-NEXT:    auipc a1, %pcrel_hi(.LCPI0_0)
; RV32-MEDIUM-NEXT:    lw a1, %pcrel_lo(.Lpcrel_hi0)(a1)
; RV32-MEDIUM-NEXT:    sw a1, 0(a0)
; RV32-MEDIUM-NEXT:    ret
;
; RV32-PIC-LABEL: constpool_f32:
; RV32-PIC:       # %bb.0:
; RV32-PIC-NEXT:  .Lpcrel_hi0:
; RV32-PIC-NEXT:    auipc a1, %pcrel_hi(.LCPI0_0)
; RV32-PIC-NEXT:    lw a1, %pcrel_lo(.Lpcrel_hi0)(a1)
; RV32-PIC-NEXT:    sw a1, 0(a0)
; RV32-PIC-NEXT:    ret
;
; RV64-SMALL-LABEL: constpool_f32:
; RV64-SMALL:       # %bb.0:
; RV64-SMALL-NEXT:    lui a1, %hi(.LCPI0_0)
; RV64-SMALL-NEXT:    lw a1, %lo(.LCPI0_0)(a1)
; RV64-SMALL-NEXT:    sw a1, 0(a0)
; RV64-SMALL-NEXT:    ret
;
; RV64-MEDIUM-LABEL: constpool_f32:
; RV64-MEDIUM:       # %bb.0:
; RV64-MEDIUM-NEXT:  .Lpcrel_hi0:
; RV64-MEDIUM-NEXT:    auipc a1, %pcrel_hi(.LCPI0_0)
; RV64-MEDIUM-NEXT:    lw a1, %pcrel_lo(.Lpcrel_hi0)(a1)
; RV64-MEDIUM-NEXT:    sw a1, 0(a0)
; RV64-MEDIUM-NEXT:    ret
;
; RV64-PIC-LABEL: constpool_f32:
; RV64-PIC:       # %bb.0:
; RV64-PIC-NEXT:  .Lpcrel_hi0:
; RV64-PIC-NEXT:    auipc a1, %pcrel_hi(.LCPI0_0)
; RV64-PIC-NEXT:    lw a1, %pcrel_lo(.Lpcrel_hi0)(a1)
; RV64-PIC-NEXT:    sw a1, 0(a0)
; RV64-PIC-NEXT:    ret
  store float 1.0, ptr %p
  ret void
}

define void @constpool_f64(ptr %p) {
; RV32-SMALL-LABEL: constpool_f64:
; RV32-SMALL:       # %bb.0:
; RV32-SMALL-NEXT:    lui a1, %hi(.LCPI1_0)
; RV32-SMALL-NEXT:    addi a1, a1, %lo(.LCPI1_0)
; RV32-SMALL-NEXT:    lw a2, 0(a1)
; RV32-SMALL-NEXT:    lw a1, 4(a1)
; RV32-SMALL-NEXT:    sw a2, 0(a0)
; RV32-SMALL-NEXT:    sw a1, 4(a0)
; RV32-SMALL-NEXT:    ret
;
; RV32-MEDIUM-LABEL: constpool_f64:
; RV32-MEDIUM:       # %bb.0:
; RV32-MEDIUM-NEXT:  .Lpcrel_hi1:
; RV32-MEDIUM-NEXT:    auipc a1, %pcrel_hi(.LCPI1_0)
; RV32-MEDIUM-NEXT:    addi a1, a1, %pcrel_lo(.Lpcrel_hi1)
; RV32-MEDIUM-NEXT:    lw a2, 0(a1)
; RV32-MEDIUM-NEXT:    lw a1, 4(a1)
; RV32-MEDIUM-NEXT:    sw a2, 0(a0)
; RV32-MEDIUM-NEXT:    sw a1, 4(a0)
; RV32-MEDIUM-NEXT:    ret
;
; RV32-PIC-LABEL: constpool_f64:
; RV32-PIC:       # %bb.0:
; RV32-PIC-NEXT:  .Lpcrel_hi1:
; RV32-PIC-NEXT:    auipc a1, %pcrel_hi(.LCPI1_0)
; RV32-PIC-NEXT:    addi a1, a1, %pcrel_lo(.Lpcrel_hi1)
; RV32-PIC-NEXT:    lw a2, 0(a1)
; RV32-PIC-NEXT:    lw a1, 4(a1)
; RV32-PIC-NEXT:    sw a2, 0(a0)
; RV32-PIC-NEXT:    sw a1, 4(a0)
; RV32-PIC-NEXT:    ret
;
; RV64-SMALL-LABEL: constpool_f64:
; RV64-SMALL:       # %bb.0:
; RV64-SMALL-NEXT:    lui a1, %hi(.LCPI1_0)
; RV64-SMALL-NEXT:    ld a1, %lo(.LCPI1_0)(a1)
; RV64-SMALL-NEXT:    sd a1, 0(a0)
; RV64-SMALL-NEXT:    ret
;
; RV64-MEDIUM-LABEL: constpool_f64:
; RV64-MEDIUM:       # %bb.0:
; RV64-MEDIUM-NEXT:  .Lpcrel_hi1:
; RV64-MEDIUM-NEXT:    auipc a1, %pcrel_hi(.LCPI1_0)
; RV64-MEDIUM-NEXT:    ld a1, %pcrel_lo(.Lpcrel_hi1)(a1)
; RV64-MEDIUM-NEXT:    sd a1, 0(a0)
; RV64-MEDIUM-NEXT:    ret
;
; RV64-PIC-LABEL: constpool_f64:
; RV64-PIC:       # %bb.0:
; RV64-PIC-NEXT:  .Lpcrel_hi1:
; RV64-PIC-NEXT:    auipc a1, %pcrel_hi(.LCPI1_0)
; RV64-PIC-NEXT:    ld a1, %pcrel_lo(.Lpcrel_hi1)(a1)
; RV64-PIC-NEXT:    sd a1, 0(a0)
; RV64-PIC-NEXT:    ret
  store double 1.0, ptr %p
  ret void
}