Module: Mesa Branch: main Commit: 434e74e658786446033c981d9de5627a4fbcdd23 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=434e74e658786446033c981d9de5627a4fbcdd23
Author: Pierre-Eric Pelloux-Prayer <[email protected]> Date: Thu Oct 20 10:12:42 2022 +0200 radeonsi: zero init using the correct components count 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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19189> --- src/amd/llvm/ac_nir_to_llvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/amd/llvm/ac_nir_to_llvm.c b/src/amd/llvm/ac_nir_to_llvm.c index 0bbdc617cfc..4a5a5dbc73f 100644 --- a/src/amd/llvm/ac_nir_to_llvm.c +++ b/src/amd/llvm/ac_nir_to_llvm.c @@ -5091,7 +5091,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; }
