panfrost/midgard: Refactor schedule/emit pipeline
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Wed, 22 May 2019 04:33:21 +0000 (04:33 +0000)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tue, 4 Jun 2019 20:14:50 +0000 (20:14 +0000)
commit3c7abbfbe8d031bd8f3248636e94af3c9dbe1a7d
treea7d56dd8b9883cced264670f84e6c00c56197df7
parent0524ab9c37f97b096ca971cd7eaf2861e537268d
panfrost/midgard: Refactor schedule/emit pipeline

First, this moves the scheduler and emitter out of midgard_compile.c
into their own dedicated files.

More interestingly, this slims down midgard_bundle to be essentially an
array of _pointers_ to midgard_instructions (plus some bundling
metadata), rather than the instructions and packing themselves. The
difference is critical, as it means that (within reason, i.e. as long as
it doesn't affect the schedule) midgard_instrucitons can now be modified
_after_ scheduling while having changes updated in the final binary.

On a more philosophical level, this removes an IR. Previously, the IR
before scheduling (MIR) was separate from the IR after scheduling
(post-schedule MIR), requiring a separate set of utilities to traverse,
using different idioms. There was no good reason for this, and it
restricts our flexibility with the RA. So unify all the things!

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Ryan Houdek <Sonicadvance1@gmail.com>
src/gallium/drivers/panfrost/meson.build
src/gallium/drivers/panfrost/midgard/compiler.h
src/gallium/drivers/panfrost/midgard/helpers.h
src/gallium/drivers/panfrost/midgard/midgard_compile.c
src/gallium/drivers/panfrost/midgard/midgard_emit.c [new file with mode: 0644]
src/gallium/drivers/panfrost/midgard/midgard_schedule.c [new file with mode: 0644]