summaryrefslogtreecommitdiff
path: root/src/freedreno
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2021-03-11 15:00:15 +0100
committerEmma Anholt <emma@anholt.net>2021-06-10 12:24:06 -0700
commit8b15c2f30c40155a56a211c2e1c1b6c5fc0368b9 (patch)
tree2f8ef2decf6f24e466a37a8bbeb9e2e04dcd8d3c /src/freedreno
parent27593cb241c1f571ef172f8db6e91a35028117e3 (diff)
ir3/sched: Don't schedule collect early
I don't think there was ever a good reason to do this, but when we start folding constants/immediates into collect, this can become actively harmful. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9842>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/ir3/ir3_sched.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/freedreno/ir3/ir3_sched.c b/src/freedreno/ir3/ir3_sched.c
index 22d1f887e3e..2e1cabfcd41 100644
--- a/src/freedreno/ir3/ir3_sched.c
+++ b/src/freedreno/ir3/ir3_sched.c
@@ -746,7 +746,16 @@ choose_instr_prio(struct ir3_sched_ctx *ctx, struct ir3_sched_notes *notes)
struct ir3_sched_node *chosen = NULL;
foreach_sched_node (n, &ctx->dag->heads) {
- if (!is_meta(n->instr))
+ /*
+ * - phi nodes and inputs must be scheduled first
+ * - split should be scheduled first, so that the vector value is
+ * killed as soon as possible. RA cannot split up the vector and
+ * reuse components that have been killed until it's been killed.
+ * - collect, on the other hand, should be treated as a "normal"
+ * instruction, and may add to register pressure if its sources are
+ * part of another vector or immediates.
+ */
+ if (!is_meta(n->instr) || n->instr->opc == OPC_META_COLLECT)
continue;
if (!chosen || (chosen->max_delay < n->max_delay))