From 5a11a0f99c67556f61786762ac1e0a56d1379a21 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 20 Oct 2022 10:12:42 +0200 Subject: [PATCH] radeonsi: zero init using the correct components count MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes the replay of the trace attached to https://gitlab.freedesktop.org/mesa/mesa/-/issues/7530 which would otherwise fail with an LLVM error: "All operands to PHI node must be the same type as the PHI node!" Fixes: ae4379d81e4 ("ac/nir: export some undef as zero") Reviewed-by: Marek Olšák Part-of: (cherry picked from commit 434e74e658786446033c981d9de5627a4fbcdd23) --- .pick_status.json | 2 +- src/amd/llvm/ac_nir_to_llvm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 1bdca6ad41e..2fa46c7936b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1957,7 +1957,7 @@ "description": "radeonsi: zero init using the correct components count", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ae4379d81e42dec4f93983dfa9f31cf30384789f" }, diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index b7a12929d82..8d208f51396 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -5070,7 +5070,7 @@ static void visit_ssa_undef(struct ac_nir_context *ctx, const nir_ssa_undef_inst } else { LLVMValueRef zero = LLVMConstInt(type, 0, false); if (num_components > 1) { - zero = ac_build_gather_values_extended(&ctx->ac, &zero, 4, 0, false); + zero = ac_build_gather_values_extended(&ctx->ac, &zero, num_components, 0, false); } ctx->ssa_defs[instr->def.index] = zero; }