Skip to content

Commit a9ff844

Browse files
committed
[Clang][AMDGPU] Restrict __builtin_amdgcn_raw_ptr_buffer_load_lds intrinsic to gpus with "lds-buffer-load-insts"
1 parent 62d8847 commit a9ff844

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

clang/include/clang/Basic/BuiltinsAMDGPU.def

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ BUILTIN(__builtin_amdgcn_raw_buffer_load_b64, "V2UiQbiiIi", "n")
162162
BUILTIN(__builtin_amdgcn_raw_buffer_load_b96, "V3UiQbiiIi", "n")
163163
BUILTIN(__builtin_amdgcn_raw_buffer_load_b128, "V4UiQbiiIi", "n")
164164

165-
BUILTIN(__builtin_amdgcn_raw_ptr_buffer_load_lds, "vQbv*3IUiiiIiIi", "t")
165+
TARGET_BUILTIN(__builtin_amdgcn_raw_ptr_buffer_load_lds, "vQbv*3IUiiiIiIi", "t", "lds-buffer-load-insts")
166166

167167
//===----------------------------------------------------------------------===//
168168
// Ballot builtins.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1100 -S -verify -o - %s
2+
// REQUIRES: amdgpu-registered-target
3+
4+
void test_amdgcn_raw_ptr_buffer_load_lds(__amdgpu_buffer_rsrc_t rsrc, __local void* lds, int offset, int soffset, int x) {
5+
__builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, lds, 4, offset, soffset, 0, 0); //expected-error{{needs target feature lds-buffer-load-insts}}
6+
}

0 commit comments

Comments
 (0)