From: Samuel Pitoiset Date: Wed, 20 May 2020 07:56:36 +0000 (+0200) Subject: ac/nir: fix shader clock with subgroup scope X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b034f6cf2a267d3f5cdc24271bc61e5c496f1744;hp=cecd4aad4605de47c056913ed430ad38f14625e5;p=mesa.git ac/nir: fix shader clock with subgroup scope The compiler should emit s_memtime instead of s_memrealtime for the subgroup scope. I don't know why this LLVM 9 checks was for but LLVM 8 also has this amdgcn intrinsic. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen Part-of: --- diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index edb6c9a06c7..db953019edd 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -459,9 +459,7 @@ ac_build_optimization_barrier(struct ac_llvm_context *ctx, LLVMValueRef ac_build_shader_clock(struct ac_llvm_context *ctx) { - const char *intr = LLVM_VERSION_MAJOR >= 9 && ctx->chip_class >= GFX8 ? - "llvm.amdgcn.s.memrealtime" : "llvm.readcyclecounter"; - LLVMValueRef tmp = ac_build_intrinsic(ctx, intr, ctx->i64, NULL, 0, 0); + LLVMValueRef tmp = ac_build_intrinsic(ctx, "llvm.amdgcn.s.memtime", ctx->i64, NULL, 0, 0); return LLVMBuildBitCast(ctx->builder, tmp, ctx->v2i32, ""); }