summaryrefslogtreecommitdiffstats
path: root/src/freedreno/ir3
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2020-01-27 08:29:35 -0800
committerMarge Bot <[email protected]>2020-02-01 02:40:22 +0000
commit752aeb7b3fe75b3c6ce8d9dadaba9c4111fa7254 (patch)
tree5c612796e3ac981a391333cf0ba43058252d8cf0 /src/freedreno/ir3
parent8d0e7d9a4c1cfe28b3cd2356e94e287e82821e1a (diff)
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 <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3569>
Diffstat (limited to 'src/freedreno/ir3')
-rw-r--r--src/freedreno/ir3/ir3_context.c10
1 files changed, 10 insertions, 0 deletions
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++) {