Skip to content

Commit 4b5d9d1

Browse files
committedAug 19, 2016
[AMDGPU] add s_incperflevel/s_decperflevel builtins
Differential revision: https://reviews.llvm.org/D23668 llvm-svn: 279235
1 parent d909f95 commit 4b5d9d1

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed
 

‎clang/include/clang/Basic/BuiltinsAMDGPU.def

+2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ BUILTIN(__builtin_amdgcn_cubetc, "ffff", "nc")
7070
BUILTIN(__builtin_amdgcn_cubema, "ffff", "nc")
7171
BUILTIN(__builtin_amdgcn_s_memtime, "LUi", "n")
7272
BUILTIN(__builtin_amdgcn_s_sleep, "vIi", "n")
73+
BUILTIN(__builtin_amdgcn_s_incperflevel, "vIi", "n")
74+
BUILTIN(__builtin_amdgcn_s_decperflevel, "vIi", "n")
7375
BUILTIN(__builtin_amdgcn_uicmp, "LUiUiUiIi", "nc")
7476
BUILTIN(__builtin_amdgcn_uicmpl, "LUiLUiLUiIi", "nc")
7577
BUILTIN(__builtin_amdgcn_sicmp, "LUiiiIi", "nc")

‎clang/test/CodeGenOpenCL/builtins-amdgcn-error.cl

+10
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ void test_s_sleep(int x)
1818
__builtin_amdgcn_s_sleep(x); // expected-error {{argument to '__builtin_amdgcn_s_sleep' must be a constant integer}}
1919
}
2020

21+
void test_s_incperflevel(int x)
22+
{
23+
__builtin_amdgcn_s_incperflevel(x); // expected-error {{argument to '__builtin_amdgcn_s_incperflevel' must be a constant integer}}
24+
}
25+
26+
void test_s_decperflevel(int x)
27+
{
28+
__builtin_amdgcn_s_decperflevel(x); // expected-error {{argument to '__builtin_amdgcn_s_decperflevel' must be a constant integer}}
29+
}
30+
2131
void test_sicmp_i32(global ulong* out, int a, int b, uint c)
2232
{
2333
*out = __builtin_amdgcn_sicmp(a, b, c); // expected-error {{argument to '__builtin_amdgcn_sicmp' must be a constant integer}}

‎clang/test/CodeGenOpenCL/builtins-amdgcn.cl

+18
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,24 @@ void test_s_sleep()
286286
__builtin_amdgcn_s_sleep(15);
287287
}
288288

289+
// CHECK-LABEL: @test_s_incperflevel
290+
// CHECK: call void @llvm.amdgcn.s.incperflevel(i32 1)
291+
// CHECK: call void @llvm.amdgcn.s.incperflevel(i32 15)
292+
void test_s_incperflevel()
293+
{
294+
__builtin_amdgcn_s_incperflevel(1);
295+
__builtin_amdgcn_s_incperflevel(15);
296+
}
297+
298+
// CHECK-LABEL: @test_s_decperflevel
299+
// CHECK: call void @llvm.amdgcn.s.decperflevel(i32 1)
300+
// CHECK: call void @llvm.amdgcn.s.decperflevel(i32 15)
301+
void test_s_decperflevel()
302+
{
303+
__builtin_amdgcn_s_decperflevel(1);
304+
__builtin_amdgcn_s_decperflevel(15);
305+
}
306+
289307
// CHECK-LABEL: @test_cubeid(
290308
// CHECK: call float @llvm.amdgcn.cubeid(float %a, float %b, float %c)
291309
void test_cubeid(global float* out, float a, float b, float c) {

0 commit comments

Comments
 (0)
Please sign in to comment.