summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-07-15 23:42:35 -0400
committerMarek Olšák <[email protected]>2019-07-19 20:16:19 -0400
commit39d0c68321dfb592afc1f6f63d90d5508cdf7333 (patch)
treebe7b6e407a08d6ebda4797db5fc9e1cb46371a95 /src
parent26099bc35de2a45c1434047c00ca0e1f02ef7acf (diff)
ac: fix shader clock on LLVM 9
Probably relevant commit: commit dd32dc3f72ec99b1794d62c74d2beb3b60468d50 Author: Stanislav Mekhanoshin <[email protected]> Date: Tue Jul 9 03:10:18 2019 +0000 [AMDGPU] Always use s_memtime for readcyclecounter Differential Revision: https://reviews.llvm.org/D64369 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365431 91177308-0d34-0410-b5e6-96231b3b80d8 Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/common/ac_llvm_build.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
index f024d1b4d57..221850139b1 100644
--- a/src/amd/common/ac_llvm_build.c
+++ b/src/amd/common/ac_llvm_build.c
@@ -432,8 +432,9 @@ 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);
+ const char *intr = HAVE_LLVM >= 0x0900 && ctx->chip_class >= GFX8 ?
+ "llvm.amdgcn.s.memrealtime" : "llvm.readcyclecounter";
+ LLVMValueRef tmp = ac_build_intrinsic(ctx, intr, ctx->i64, NULL, 0, 0);
return LLVMBuildBitCast(ctx->builder, tmp, ctx->v2i32, "");
}