Skip to content

lima: rewrite gpir scheduling algorithm

Connor Abbott requested to merge cwabbott0/mesa:review/lima-gpir-sched into master

The current gpir scheduling algorithm wasn't working so great because it wasn't aggressive enough with spilling values to registers, enough that it apparently couldn't schedule the jellyfish shader within the 512 instruction limit. This series changes the overall compilation strategy, completely rewriting the scheduler and getting rid of the physreg alloc step as spilling to physical registers now happens during scheduling. I also adopted a system of reserving instruction slots for required moves, rather than carefully ordering how we schedule nodes, which seemed more robust and made implementing the spilling easier. For more details on the algorithm, see the new comment at the beginning of sched.c. To best review this, you should read through the new sched.c, as it's been almost completely rewritten so the diff is going to be useless.

I included an earlier version of !698 (merged) as well as one extra patch of my own to implement log2/exp2 in order to get the jellyfish shader to compile. It compiles using 117 instructions with this branch, vs. 108 with the blob. Obviously I'll remove the patches from !698 (merged) if this lands first, but I wanted to make it easier to try jellyfish with this.

I haven't tried this on actual hardware myself, only using the offline compiler, so this needs testing before it can land. However, it does generate plausible assembly, and most issues should be caught by the assertions in codegen.

Edited by Connor Abbott

Merge request reports