ir3: Prepare for instructions with multiple destinations
authorConnor Abbott <cwabbott0@gmail.com>
Thu, 18 Feb 2021 16:57:49 +0000 (17:57 +0100)
committerEmma Anholt <emma@anholt.net>
Thu, 10 Jun 2021 19:20:38 +0000 (12:20 -0700)
commitedf23e15eba18f59637e1fcc382024df31cf1594
tree2a4196309786c3d333fae8803cb54a811f3daf9e
parente1d724057683e2d624a82fe37f358d8250d73374
ir3: Prepare for instructions with multiple destinations

To simplify the pre-RA merge set code and express the result live-range
splitting in RA, we need to add support for parallel copy instructions,
and for the merge set code these parallel copies need to be in SSA form.
Parallel copies have multiple destinations by necessity, but there was
no way to express this in the existing IR. In particular there was no
support for marking a register as being a destination, and no support
for indicating which destination register out of several an SSA source
refers to. This replaces ir3_register::instr with ir3_register::def and
re-purposes ir3_register::instr. I haven't propagated this into common
helpers, like ssa(), because that would vastly increase the amount of
churn and the number of places that produce such instructions should be
limited -- only RA will create parallel copies and they will be
destroyed right after RA. In the future swz will have multiple
destinations too, but it will only be created after RA via parallel copy
lowering.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9842>
12 files changed:
src/freedreno/ir3/ir3.h
src/freedreno/ir3/ir3_compiler_nir.c
src/freedreno/ir3/ir3_context.c
src/freedreno/ir3/ir3_cp.c
src/freedreno/ir3/ir3_cp_postsched.c
src/freedreno/ir3/ir3_delay.c
src/freedreno/ir3/ir3_group.c
src/freedreno/ir3/ir3_postsched.c
src/freedreno/ir3/ir3_print.c
src/freedreno/ir3/ir3_ra.c
src/freedreno/ir3/ir3_ra.h
src/freedreno/ir3/tests/delay.c