File: ld-addrspace.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 (163 lines) | stat: -rw-r--r-- 4,818 bytes parent folder | download | duplicates (3)
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s --check-prefixes=ALL,G32,LS32
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s --check-prefixes=ALL,G64,LS64
; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 --nvptx-short-ptr | FileCheck %s --check-prefixes=G64,LS32
; RUN: %if ptxas && !ptxas-12.0 %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify %}
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 --nvptx-short-ptr | %ptxas-verify %}


;; i8
define i8 @ld_global_i8(ptr addrspace(1) %ptr) {
; ALL-LABEL: ld_global_i8
; G32: ld.global.u8 %{{.*}}, [%r{{[0-9]+}}]
; G64: ld.global.u8 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i8, ptr addrspace(1) %ptr
  ret i8 %a
}
define i8 @ld_shared_i8(ptr addrspace(3) %ptr) {
; ALL-LABEL: ld_shared_i8
; LS32: ld.shared.u8 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.shared.u8 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i8, ptr addrspace(3) %ptr
  ret i8 %a
}
define i8 @ld_local_i8(ptr addrspace(5) %ptr) {
; ALL-LABEL: ld_local_i8
; LS32: ld.local.u8 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.local.u8 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i8, ptr addrspace(5) %ptr
  ret i8 %a
}

;; i16
define i16 @ld_global_i16(ptr addrspace(1) %ptr) {
; ALL-LABEL: ld_global_i16
; G32: ld.global.u16 %{{.*}}, [%r{{[0-9]+}}]
; G64: ld.global.u16 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i16, ptr addrspace(1) %ptr
  ret i16 %a
}
define i16 @ld_shared_i16(ptr addrspace(3) %ptr) {
; ALL-LABEL: ld_shared_i16
; LS32: ld.shared.u16 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.shared.u16 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i16, ptr addrspace(3) %ptr
  ret i16 %a
}
define i16 @ld_local_i16(ptr addrspace(5) %ptr) {
; ALL-LABEL: ld_local_i16
; LS32: ld.local.u16 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.local.u16 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i16, ptr addrspace(5) %ptr
  ret i16 %a
}

;; i32
define i32 @ld_global_i32(ptr addrspace(1) %ptr) {
; ALL-LABEL: ld_global_i32
; G32: ld.global.u32 %{{.*}}, [%r{{[0-9]+}}]
; G64: ld.global.u32 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i32, ptr addrspace(1) %ptr
  ret i32 %a
}
define i32 @ld_shared_i32(ptr addrspace(3) %ptr) {
; ALL-LABEL: ld_shared_i32
; LS32: ld.shared.u32 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.shared.u32 %{{.*}}, [%rd{{[0-9]+}}]
; PTX64: ret
  %a = load i32, ptr addrspace(3) %ptr
  ret i32 %a
}
define i32 @ld_local_i32(ptr addrspace(5) %ptr) {
; ALL-LABEL: ld_local_i32
; LS32: ld.local.u32 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.local.u32 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i32, ptr addrspace(5) %ptr
  ret i32 %a
}

;; i64
define i64 @ld_global_i64(ptr addrspace(1) %ptr) {
; ALL-LABEL: ld_global_i64
; G32: ld.global.u64 %{{.*}}, [%r{{[0-9]+}}]
; G64: ld.global.u64 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i64, ptr addrspace(1) %ptr
  ret i64 %a
}
define i64 @ld_shared_i64(ptr addrspace(3) %ptr) {
; ALL-LABEL: ld_shared_i64
; LS32: ld.shared.u64 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.shared.u64 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i64, ptr addrspace(3) %ptr
  ret i64 %a
}
define i64 @ld_local_i64(ptr addrspace(5) %ptr) {
; ALL-LABEL: ld_local_i64
; LS32: ld.local.u64 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.local.u64 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load i64, ptr addrspace(5) %ptr
  ret i64 %a
}

;; f32
define float @ld_global_f32(ptr addrspace(1) %ptr) {
; ALL-LABEL: ld_global_f32
; G32: ld.global.f32 %{{.*}}, [%r{{[0-9]+}}]
; G64: ld.global.f32 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load float, ptr addrspace(1) %ptr
  ret float %a
}
define float @ld_shared_f32(ptr addrspace(3) %ptr) {
; ALL-LABEL: ld_shared_f32
; LS32: ld.shared.f32 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.shared.f32 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load float, ptr addrspace(3) %ptr
  ret float %a
}
define float @ld_local_f32(ptr addrspace(5) %ptr) {
; ALL-LABEL: ld_local_f32
; LS32: ld.local.f32 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.local.f32 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load float, ptr addrspace(5) %ptr
  ret float %a
}

;; f64
define double @ld_global_f64(ptr addrspace(1) %ptr) {
; ALL-LABEL: ld_global_f64
; G32: ld.global.f64 %{{.*}}, [%r{{[0-9]+}}]
; G64: ld.global.f64 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load double, ptr addrspace(1) %ptr
  ret double %a
}
define double @ld_shared_f64(ptr addrspace(3) %ptr) {
; ALL-LABEL: ld_shared_f64
; LS32: ld.shared.f64 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.shared.f64 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load double, ptr addrspace(3) %ptr
  ret double %a
}
define double @ld_local_f64(ptr addrspace(5) %ptr) {
; ALL-LABEL: ld_local_f64
; LS32: ld.local.f64 %{{.*}}, [%r{{[0-9]+}}]
; LS64: ld.local.f64 %{{.*}}, [%rd{{[0-9]+}}]
; ALL: ret
  %a = load double, ptr addrspace(5) %ptr
  ret double %a
}