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: ae4379d81e ("ac/nir: export some undef as zero")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19189>
(cherry picked from commit 434e74e658)
This commit is contained in:
Pierre-Eric Pelloux-Prayer
2022-10-20 10:12:42 +02:00
committed by Dylan Baker
parent b2e3963fd9
commit 5a11a0f99c
2 changed files with 2 additions and 2 deletions

View File

@@ -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"
},

View File

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