[PATCH] D50321: AMDGPU: Add builtin for s_dcache_wb
Matt Arsenault via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 5 23:48:28 PDT 2018
arsenm created this revision.
arsenm added reviewers: yaxunl, kzhuravl.
Herald added subscribers: t-tye, tpr, dstuttard, nhaehnle, wdng.
https://reviews.llvm.org/D50321
Files:
include/clang/Basic/BuiltinsAMDGPU.def
test/CodeGenOpenCL/builtins-amdgcn-vi.cl
test/SemaOpenCL/builtins-amdgcn-error-vi.cl
Index: test/SemaOpenCL/builtins-amdgcn-error-vi.cl
===================================================================
--- /dev/null
+++ test/SemaOpenCL/builtins-amdgcn-error-vi.cl
@@ -0,0 +1,8 @@
+// REQUIRES: amdgpu-registered-target
+// RUN: %clang_cc1 -triple amdgcn-- -target-cpu tahiti -verify -S -o - %s
+// RUN: %clang_cc1 -triple amdgcn-- -target-cpu hawaii -verify -S -o - %s
+
+void test_vi_s_dcache_wb()
+{
+ __builtin_amdgcn_s_dcache_wb(); // expected-error {{'__builtin_amdgcn_s_dcache_wb' needs target feature vi-insts}}
+}
Index: test/CodeGenOpenCL/builtins-amdgcn-vi.cl
===================================================================
--- test/CodeGenOpenCL/builtins-amdgcn-vi.cl
+++ test/CodeGenOpenCL/builtins-amdgcn-vi.cl
@@ -82,6 +82,13 @@
*out = __builtin_amdgcn_s_memrealtime();
}
+// CHECK-LABEL: @test_s_dcache_wb()
+// CHECK: call void @llvm.amdgcn.s.dcache.wb()
+void test_s_dcache_wb()
+{
+ __builtin_amdgcn_s_dcache_wb();
+}
+
// CHECK-LABEL: @test_mov_dpp
// CHECK: call i32 @llvm.amdgcn.mov.dpp.i32(i32 %src, i32 0, i32 0, i32 0, i1 false)
void test_mov_dpp(global int* out, int src)
Index: include/clang/Basic/BuiltinsAMDGPU.def
===================================================================
--- include/clang/Basic/BuiltinsAMDGPU.def
+++ include/clang/Basic/BuiltinsAMDGPU.def
@@ -121,6 +121,7 @@
TARGET_BUILTIN(__builtin_amdgcn_classh, "bhi", "nc", "16-bit-insts")
TARGET_BUILTIN(__builtin_amdgcn_s_memrealtime, "LUi", "n", "s-memrealtime")
TARGET_BUILTIN(__builtin_amdgcn_mov_dpp, "iiIiIiIiIb", "nc", "dpp")
+TARGET_BUILTIN(__builtin_amdgcn_s_dcache_wb, "v", "n", "vi-insts")
//===----------------------------------------------------------------------===//
// GFX9+ only builtins.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50321.159253.patch
Type: text/x-patch
Size: 1742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180806/73caeb95/attachment.bin>
More information about the cfe-commits
mailing list