From 752aeb7b3fe75b3c6ce8d9dadaba9c4111fa7254 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 27 Jan 2020 08:29:35 -0800 Subject: [PATCH] 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: --- src/freedreno/ir3/ir3_context.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/freedreno/ir3/ir3_context.c b/src/freedreno/ir3/ir3_context.c index 33e73bc..b44dc4a 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++) { -- 2.7.4