From: Marek Olšák Date: Tue, 16 Jul 2019 03:42:35 +0000 (-0400) Subject: ac: fix shader clock on LLVM 9 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=39d0c68321dfb592afc1f6f63d90d5508cdf7333;p=mesa.git ac: fix shader clock on LLVM 9 Probably relevant commit: commit dd32dc3f72ec99b1794d62c74d2beb3b60468d50 Author: Stanislav Mekhanoshin 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 --- 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, ""); }