]> granicus.if.org Git - clang/commitdiff
[AMDGPU] add __builtin_amdgcn_s_getpc
authorTim Corringham <tcorring@amd.com>
Thu, 25 May 2017 14:16:11 +0000 (14:16 +0000)
committerTim Corringham <tcorring@amd.com>
Thu, 25 May 2017 14:16:11 +0000 (14:16 +0000)
Summary: Added the builtin corresponding to the s_getpc intrinsic added in llvm D32862

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye

Differential Revision: https://reviews.llvm.org/D33276

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303861 91177308-0d34-0410-b5e6-96231b3b80d8

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

index a8ab657c379e42a61306828a310ff75516c6ef7a..6542acafe48a557cfd814534efdbd16d69fab98b 100644 (file)
@@ -36,6 +36,7 @@ BUILTIN(__builtin_amdgcn_workitem_id_z, "Ui", "nc")
 // Instruction builtins.
 //===----------------------------------------------------------------------===//
 BUILTIN(__builtin_amdgcn_s_getreg, "UiIi", "n")
+BUILTIN(__builtin_amdgcn_s_getpc, "LUi", "n")
 BUILTIN(__builtin_amdgcn_s_waitcnt, "vIi", "n")
 BUILTIN(__builtin_amdgcn_s_sendmsg, "vIiUi", "n")
 BUILTIN(__builtin_amdgcn_s_sendmsghalt, "vIiUi", "n")
index 748fe5e7120ff2af199708a51b8b34a019cd2660..f75620ba603a972b98d5be1e354b8a9ecc17ff79 100644 (file)
@@ -481,6 +481,13 @@ void test_fmed3_f32(global float* out, float a, float b, float c)
   *out = __builtin_amdgcn_fmed3f(a, b, c);
 }
 
+// CHECK-LABEL: @test_s_getpc
+// CHECK: call i64 @llvm.amdgcn.s.getpc()
+void test_s_getpc(global ulong* out)
+{
+  *out = __builtin_amdgcn_s_getpc();
+}
+
 // CHECK-DAG: [[WI_RANGE]] = !{i32 0, i32 1024}
 // CHECK-DAG: attributes #[[NOUNWIND_READONLY:[0-9]+]] = { nounwind readonly }
 // CHECK-DAG: attributes #[[READ_EXEC_ATTRS]] = { convergent }