LLVMValueRef ac_build_shader_clock(struct ac_llvm_context *ctx, nir_scope scope)
{
+ if (ctx->gfx_level >= GFX11 && scope == NIR_SCOPE_DEVICE) {
+ const char *name = "llvm.amdgcn.s.sendmsg.rtn.i64";
+ LLVMValueRef arg = LLVMConstInt(ctx->i32, 0x83 /* realtime */, 0);
+ LLVMValueRef tmp = ac_build_intrinsic(ctx, name, ctx->i64, &arg, 1, 0);
+ return LLVMBuildBitCast(ctx->builder, tmp, ctx->v2i32, "");
+ }
+
const char *subgroup = "llvm.readcyclecounter";
const char *name = scope == NIR_SCOPE_DEVICE ? "llvm.amdgcn.s.memrealtime" : subgroup;