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 <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3569>
This commit is contained in:
Rob Clark 2020-01-27 08:29:35 -08:00 committed by Marge Bot
parent 8d0e7d9a4c
commit 752aeb7b3f

View file

@ -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++) {