Module: Mesa Branch: master Commit: 54434fe67068d9abdf73bfc3482337cc4315d2d3 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=54434fe67068d9abdf73bfc3482337cc4315d2d3
Author: Connor Abbott <[email protected]> Date: Thu Jan 11 18:35:58 2018 -0500 lima/gpir: Rework the scheduler Now, we do scheduling at the same time as value register allocation. The ready list now acts similarly to the array of registers in value_regalloc, keeping us from running out of slots. Before this, the value register allocator wasn't aware of the scheduling constraints of the actual machine, which meant that it sometimes chose the wrong false dependencies to insert. Now, we assign value registers at the same time as we actually schedule instructions, making its choices reflect reality much better. It was also conservative in some cases where the new scheme doesn't have to be. For example, in something like: 1 = ld_att 2 = ld_uni 3 = add 1, 2 It's possible that one of 1 and 2 can't be scheduled in the same instruction as 3, meaning that a move needs to be inserted, so the value register allocator needs to assume that this sequence requires two registers. But when actually scheduling, we could discover that 1, 2, and 3 can all be scheduled together, so that they only require one register. The new scheduler speculatively inserts the instruction under consideration, as well as all of its child load instructions, and then counts the number of live value registers after all is said and done. This lets us be more aggressive with scheduling when we're close to the limit. With the new scheduler, the kmscube vertex shader is now scheduled in 40 instructions, versus 66 before. Acked-by: Qiang Yu <[email protected]> --- src/gallium/drivers/lima/ir/gp/codegen.c | 8 +- src/gallium/drivers/lima/ir/gp/gpir.h | 50 +- src/gallium/drivers/lima/ir/gp/instr.c | 80 +- src/gallium/drivers/lima/ir/gp/nir.c | 5 +- src/gallium/drivers/lima/ir/gp/node.c | 2 - src/gallium/drivers/lima/ir/gp/physical_regalloc.c | 135 -- .../lima/ir/gp/{value_regalloc.c => regalloc.c} | 85 +- src/gallium/drivers/lima/ir/gp/scheduler.c | 1379 +++++++++++++++----- src/gallium/drivers/lima/meson.build | 3 +- 9 files changed, 1187 insertions(+), 560 deletions(-) Diff: http://cgit.freedesktop.org/mesa/mesa/diff/?id=54434fe67068d9abdf73bfc3482337cc4315d2d3 _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
