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 <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5117>
This commit is contained in:
Samuel Pitoiset 2020-05-20 09:56:36 +02:00
parent cecd4aad46
commit b034f6cf2a
1 changed files with 1 additions and 3 deletions

View File

@ -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, "");
}