File: llvm.amdgcn.struct.buffer.load.lds.ll

package info (click to toggle)
llvm-toolchain-17 1%3A17.0.6-22
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,799,624 kB
  • sloc: cpp: 6,428,607; ansic: 1,383,196; asm: 793,408; python: 223,504; objc: 75,364; f90: 60,502; lisp: 33,869; pascal: 15,282; sh: 9,684; perl: 7,453; ml: 4,937; awk: 3,523; makefile: 2,889; javascript: 2,149; xml: 888; fortran: 619; cs: 573
file content (125 lines) | stat: -rw-r--r-- 5,885 bytes parent folder | download | duplicates (4)
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
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,SDAG
; RUN: llc -global-isel -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck %s --check-prefixes=GCN,GISEL

declare void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) nocapture, i32 %size, i32 %vindex, i32 %voffset, i32 %soffset, i32 %offset, i32 %aux)

define amdgpu_ps float @buffer_load_lds_dword(<4 x i32> inreg %rsrc, ptr addrspace(3) inreg %lds) {
; SDAG-LABEL: buffer_load_lds_dword:
; SDAG:       ; %bb.0: ; %main_body
; SDAG-NEXT:    v_mov_b32_e32 v0, 8
; SDAG-NEXT:    s_mov_b32 m0, s4
; SDAG-NEXT:    s_nop 0
; SDAG-NEXT:    buffer_load_dword v0, s[0:3], 0 idxen lds
; SDAG-NEXT:    buffer_load_dword v0, s[0:3], 0 idxen offset:4 glc lds
; SDAG-NEXT:    buffer_load_dword v0, s[0:3], 0 idxen offset:8 slc lds
; SDAG-NEXT:    v_mov_b32_e32 v0, s4
; SDAG-NEXT:    s_waitcnt vmcnt(0)
; SDAG-NEXT:    ds_read_b32 v0, v0
; SDAG-NEXT:    s_waitcnt lgkmcnt(0)
; SDAG-NEXT:    ; return to shader part epilog
;
; GISEL-LABEL: buffer_load_lds_dword:
; GISEL:       ; %bb.0: ; %main_body
; GISEL-NEXT:    s_mov_b32 m0, s4
; GISEL-NEXT:    v_mov_b32_e32 v0, 8
; GISEL-NEXT:    buffer_load_dword v0, s[0:3], 0 idxen lds
; GISEL-NEXT:    buffer_load_dword v0, s[0:3], 0 idxen offset:4 glc lds
; GISEL-NEXT:    buffer_load_dword v0, s[0:3], 0 idxen offset:8 slc lds
; GISEL-NEXT:    v_mov_b32_e32 v0, s4
; GISEL-NEXT:    s_waitcnt vmcnt(0)
; GISEL-NEXT:    ds_read_b32 v0, v0
; GISEL-NEXT:    s_waitcnt lgkmcnt(0)
; GISEL-NEXT:    ; return to shader part epilog
main_body:
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 4, i32 8, i32 0, i32 0, i32 0, i32 0)
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 4, i32 8, i32 0, i32 0, i32 4, i32 1)
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 4, i32 8, i32 0, i32 0, i32 8, i32 2)
  %res = load float, ptr addrspace(3) %lds
  ret float %res
}

define amdgpu_ps void @buffer_load_lds_dword_imm_offset(<4 x i32> inreg %rsrc, ptr addrspace(3) inreg %lds, i32 %vindex) {
; GCN-LABEL: buffer_load_lds_dword_imm_offset:
; GCN:       ; %bb.0: ; %main_body
; GCN-NEXT:    s_mov_b32 m0, s4
; GCN-NEXT:    s_nop 0
; GCN-NEXT:    buffer_load_dword v0, s[0:3], 0 idxen offset:2048 lds
; GCN-NEXT:    s_endpgm
main_body:
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 4, i32 %vindex, i32 0, i32 0, i32 2048, i32 0)
  ret void
}

define amdgpu_ps void @buffer_load_lds_dword_v_offset(<4 x i32> inreg %rsrc, ptr addrspace(3) inreg %lds, i32 %vindex, i32 %voffset) {
; GCN-LABEL: buffer_load_lds_dword_v_offset:
; GCN:       ; %bb.0: ; %main_body
; GCN-NEXT:    s_mov_b32 m0, s4
; GCN-NEXT:    s_nop 0
; GCN-NEXT:    buffer_load_dword v[0:1], s[0:3], 0 idxen offen lds
; GCN-NEXT:    s_endpgm
main_body:
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 4, i32 %vindex, i32 %voffset, i32 0, i32 0, i32 0)
  ret void
}

define amdgpu_ps void @buffer_load_lds_dword_s_offset(<4 x i32> inreg %rsrc, ptr addrspace(3) inreg %lds, i32 %vindex, i32 inreg %soffset) {
; GCN-LABEL: buffer_load_lds_dword_s_offset:
; GCN:       ; %bb.0: ; %main_body
; GCN-NEXT:    s_mov_b32 m0, s4
; GCN-NEXT:    s_nop 0
; GCN-NEXT:    buffer_load_dword v0, s[0:3], s5 idxen lds
; GCN-NEXT:    s_endpgm
main_body:
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 4, i32 %vindex, i32 0, i32 %soffset, i32 0, i32 0)
  ret void
}

define amdgpu_ps void @buffer_load_lds_dword_vs_offset(<4 x i32> inreg %rsrc, ptr addrspace(3) inreg %lds, i32 %vindex, i32 %voffset, i32 inreg %soffset) {
; GCN-LABEL: buffer_load_lds_dword_vs_offset:
; GCN:       ; %bb.0: ; %main_body
; GCN-NEXT:    s_mov_b32 m0, s4
; GCN-NEXT:    s_nop 0
; GCN-NEXT:    buffer_load_dword v[0:1], s[0:3], s5 idxen offen lds
; GCN-NEXT:    s_endpgm
main_body:
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 4, i32 %vindex, i32 %voffset, i32 %soffset, i32 0, i32 0)
  ret void
}

define amdgpu_ps void @buffer_load_lds_dword_vs_imm_offset(<4 x i32> inreg %rsrc, ptr addrspace(3) inreg %lds, i32 %vindex, i32 %voffset, i32 inreg %soffset) {
; GCN-LABEL: buffer_load_lds_dword_vs_imm_offset:
; GCN:       ; %bb.0: ; %main_body
; GCN-NEXT:    s_mov_b32 m0, s4
; GCN-NEXT:    s_nop 0
; GCN-NEXT:    buffer_load_dword v[0:1], s[0:3], s5 idxen offen offset:2048 lds
; GCN-NEXT:    s_endpgm
main_body:
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 4, i32 %vindex, i32 %voffset, i32 %soffset, i32 2048, i32 0)
  ret void
}

define amdgpu_ps void @buffer_load_lds_ushort(<4 x i32> inreg %rsrc, ptr addrspace(3) inreg %lds, i32 %vindex) {
; GCN-LABEL: buffer_load_lds_ushort:
; GCN:       ; %bb.0: ; %main_body
; GCN-NEXT:    v_mov_b32_e32 v1, 0x800
; GCN-NEXT:    s_mov_b32 m0, s4
; GCN-NEXT:    s_nop 0
; GCN-NEXT:    buffer_load_ushort v[0:1], s[0:3], 0 idxen offen lds
; GCN-NEXT:    s_endpgm
main_body:
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 2, i32 %vindex, i32 2048, i32 0, i32 0, i32 0)
  ret void
}

define amdgpu_ps void @buffer_load_lds_ubyte(<4 x i32> inreg %rsrc, ptr addrspace(3) inreg %lds, i32 %vindex) {
; GCN-LABEL: buffer_load_lds_ubyte:
; GCN:       ; %bb.0: ; %main_body
; GCN-NEXT:    s_mov_b32 m0, s4
; GCN-NEXT:    s_nop 0
; GCN-NEXT:    buffer_load_ubyte v0, s[0:3], 0 idxen offset:2048 lds
; GCN-NEXT:    s_endpgm
main_body:
  call void @llvm.amdgcn.struct.buffer.load.lds(<4 x i32> %rsrc, ptr addrspace(3) %lds, i32 1, i32 %vindex, i32 0, i32 0, i32 2048, i32 0)
  ret void
}