Mesa (main): amd: fix ac_build_mbcnt_add in wave32 mode

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 12 08:07:13 UTC 2022


Module: Mesa
Branch: main
Commit: db2fd0ca83f4f2000eae87f4e7915d775833393a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=db2fd0ca83f4f2000eae87f4e7915d775833393a

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Wed May 11 14:57:13 2022 +0200

amd: fix ac_build_mbcnt_add in wave32 mode

add_src was ignored and i32_0 was always used.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Fixes: 1e49018cedf ("amd: Add extra source to the mbcnt_amd NIR intrinsic.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16427>

---

 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;
    }



More information about the mesa-commit mailing list