From dbefe0c26da8ffae2f6ad45fa8f9ae3f33f27b1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 8 Aug 2025 22:34:00 -0400 Subject: [PATCH] ac/nir: inline ac_get_ptr_arg so that we can get rid of ac_get_ptr_args. RADV uses AC_ARG_CONST_PTR for num_work_groups, which maps to i8, which seems wrong. No functional change. Reviewed-by: Konstantin Seurer Part-of: --- src/amd/llvm/ac_nir_to_llvm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index a3a8f89de0d..8f2a90f4135 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -2761,8 +2761,11 @@ static bool visit_intrinsic(struct ac_nir_context *ctx, nir_intrinsic_instr *ins if (ctx->abi->load_grid_size_from_user_sgpr) { result = ac_get_arg(&ctx->ac, ctx->args->num_work_groups); } else { - result = ac_build_load_invariant(&ctx->ac, - ac_get_ptr_arg(&ctx->ac, ctx->args, ctx->args->num_work_groups), ctx->ac.i32_0); + struct ac_llvm_pointer ptr; + ptr.pointee_type = ctx->ac.v3i32; + ptr.value = ac_get_arg(&ctx->ac, ctx->args->num_work_groups); + + result = ac_build_load_invariant(&ctx->ac, ptr, ctx->ac.i32_0); } break; case nir_intrinsic_load_subgroup_id: