From: Rob Clark Date: Mon, 27 Jan 2020 16:29:35 +0000 (-0800) Subject: freedreno/ir3: simplify split from collect X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=752aeb7b3fe75b3c6ce8d9dadaba9c4111fa7254;p=mesa.git freedreno/ir3: simplify split from collect In some cases we need to split components out from what was already a collect. That was making it hard to DCE unused components of the collect. (Ie. unused components of fragcoord, etc) So just detect this case and skip the chained collect+split. Signed-off-by: Rob Clark Part-of: --- diff --git a/src/freedreno/ir3/ir3_context.c b/src/freedreno/ir3/ir3_context.c index 33e73bcb216..b44dc4a67f3 100644 --- a/src/freedreno/ir3/ir3_context.c +++ b/src/freedreno/ir3/ir3_context.c @@ -323,6 +323,16 @@ ir3_split_dest(struct ir3_block *block, struct ir3_instruction **dst, return; } + if (src->opc == OPC_META_COLLECT) { + debug_assert((base + n) < src->regs_count); + + for (int i = 0; i < n; i++) { + dst[i] = ssa(src->regs[i + base + 1]); + } + + return; + } + unsigned flags = dest_flags(src); for (int i = 0, j = 0; i < n; i++) {