aboutsummaryrefslogtreecommitdiffstats
path: root/src/amd/common/ac_llvm_build.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2018-02-02 13:54:48 +1100
committerTimothy Arceri <[email protected]>2018-02-07 08:43:08 +1100
commitb7b89bbddb8e78bdc93cf7a64c191ed1be647f13 (patch)
tree7f56dd5768749fd54f8c6e18591eb0dd09bf05b6 /src/amd/common/ac_llvm_build.c
parentd116af383ffef775ccfc8f2f64b603aebb6b374a (diff)
ac/radeonsi: create ac_build_shader_clock() helper
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/amd/common/ac_llvm_build.c')
-rw-r--r--src/amd/common/ac_llvm_build.c8
1 files changed, 8 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)
{