From db2fd0ca83f4f2000eae87f4e7915d775833393a Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Wed, 11 May 2022 14:57:13 +0200 Subject: [PATCH] amd: fix ac_build_mbcnt_add in wave32 mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit add_src was ignored and i32_0 was always used. Reviewed-by: Marek Olšák Reviewed-by: Timur Kristóf Fixes: 1e49018cedf ("amd: Add extra source to the mbcnt_amd NIR intrinsic.") Part-of: --- src/amd/llvm/ac_llvm_build.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/llvm/ac_llvm_build.c b/src/amd/llvm/ac_llvm_build.c index 2c767df58d7..13c75d2307b 100644 --- a/src/amd/llvm/ac_llvm_build.c +++ b/src/amd/llvm/ac_llvm_build.c @@ -3207,7 +3207,7 @@ LLVMValueRef ac_build_mbcnt_add(struct ac_llvm_context *ctx, LLVMValueRef mask, { if (ctx->wave_size == 32) { LLVMValueRef val = ac_build_intrinsic(ctx, "llvm.amdgcn.mbcnt.lo", ctx->i32, - (LLVMValueRef[]){mask, ctx->i32_0}, 2, AC_FUNC_ATTR_READNONE); + (LLVMValueRef[]){mask, add_src}, 2, AC_FUNC_ATTR_READNONE); ac_set_range_metadata(ctx, val, 0, ctx->wave_size); return val; }