agx: Use a transfer graph for parallel copies

Lifted from ir3. Algorithm is the same; the data structures and interface are
lightly modified to decouple from ir3's IR.

Sequentializing parallel copies after RA is tricky. ir3's implementation works
well enough, so I use that one.

Original implementation by Connor Abbott.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16268>
This commit is contained in:
Alyssa Rosenzweig
2022-04-17 16:47:37 -04:00
committed by Alyssa Rosenzweig
parent 330ec4260d
commit 4fc023ed42
4 changed files with 337 additions and 45 deletions

View File

@@ -674,6 +674,23 @@ void agx_pack_binary(agx_context *ctx, struct util_dynarray *emission);
unsigned agx_write_registers(agx_instr *I, unsigned d);
struct agx_copy {
/* Base register destination of the copy */
unsigned dest;
/* Base register source of the copy */
unsigned src;
/* Size of the copy */
enum agx_size size;
/* Whether the copy has been handled. Callers must leave to false. */
bool done;
};
void
agx_emit_parallel_copies(agx_builder *b, struct agx_copy *copies, unsigned n);
void agx_compute_liveness(agx_context *ctx);
void agx_liveness_ins_update(BITSET_WORD *live, agx_instr *I);