]> granicus.if.org Git - clang/commitdiff
AMDGPU: Fix missing declaration for __builtin_amdgcn_dispatch_ptr
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 9 Oct 2017 17:44:18 +0000 (17:44 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Mon, 9 Oct 2017 17:44:18 +0000 (17:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315219 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/BuiltinsAMDGPU.def
test/CodeGenOpenCL/builtins-amdgcn.cl

index 6542acafe48a557cfd814534efdbd16d69fab98b..3e5b0d13aec73d602ec41ba600f716db1874ca28 100644 (file)
@@ -21,6 +21,7 @@
 // SI+ only builtins.
 //===----------------------------------------------------------------------===//
 
+BUILTIN(__builtin_amdgcn_dispatch_ptr, "Uc*2", "nc")
 BUILTIN(__builtin_amdgcn_kernarg_segment_ptr, "Uc*2", "nc")
 BUILTIN(__builtin_amdgcn_implicitarg_ptr, "Uc*2", "nc")
 
index f75620ba603a972b98d5be1e354b8a9ecc17ff79..65b0666ad1f74f02f96336bfca1d817fa56492a6 100644 (file)
@@ -421,6 +421,13 @@ void test_read_exec(global ulong* out) {
 
 // CHECK: declare i64 @llvm.read_register.i64(metadata) #[[NOUNWIND_READONLY:[0-9]+]]
 
+// CHECK-LABEL: @test_dispatch_ptr
+// CHECK: call i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr()
+void test_dispatch_ptr(__attribute__((address_space(2))) unsigned char ** out)
+{
+  *out = __builtin_amdgcn_dispatch_ptr();
+}
+
 // CHECK-LABEL: @test_kernarg_segment_ptr
 // CHECK: call i8 addrspace(2)* @llvm.amdgcn.kernarg.segment.ptr()
 void test_kernarg_segment_ptr(__attribute__((address_space(2))) unsigned char ** out)