diff options
Diffstat (limited to 'src/amd/common')
-rw-r--r-- | src/amd/common/ac_llvm_build.c | 8 | ||||
-rw-r--r-- | src/amd/common/ac_llvm_build.h | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c index 3efcaa12b18..a86ba962fab 100644 --- a/src/amd/common/ac_llvm_build.c +++ b/src/amd/common/ac_llvm_build.c @@ -344,6 +344,14 @@ ac_build_optimization_barrier(struct ac_llvm_context *ctx, } LLVMValueRef +ac_build_shader_clock(struct ac_llvm_context *ctx) +{ + LLVMValueRef tmp = ac_build_intrinsic(ctx, "llvm.readcyclecounter", + ctx->i64, NULL, 0, 0); + return LLVMBuildBitCast(ctx->builder, tmp, ctx->v2i32, ""); +} + +LLVMValueRef ac_build_ballot(struct ac_llvm_context *ctx, LLVMValueRef value) { diff --git a/src/amd/common/ac_llvm_build.h b/src/amd/common/ac_llvm_build.h index 35f849a9869..47c843fb4b4 100644 --- a/src/amd/common/ac_llvm_build.h +++ b/src/amd/common/ac_llvm_build.h @@ -119,6 +119,8 @@ ac_build_phi(struct ac_llvm_context *ctx, LLVMTypeRef type, void ac_build_optimization_barrier(struct ac_llvm_context *ctx, LLVMValueRef *pvgpr); +LLVMValueRef ac_build_shader_clock(struct ac_llvm_context *ctx); + LLVMValueRef ac_build_ballot(struct ac_llvm_context *ctx, LLVMValueRef value); LLVMValueRef ac_build_vote_all(struct ac_llvm_context *ctx, LLVMValueRef value); |