freedreno/ir3: more clever legalize algorithm
authorRob Clark <robdclark@gmail.com>
Thu, 1 Feb 2018 14:08:39 +0000 (09:08 -0500)
committerRob Clark <robdclark@gmail.com>
Sat, 10 Feb 2018 19:54:58 +0000 (14:54 -0500)
commitf54d2b4f10481913528b4ef3d68a99b59104f053
treecb8265ead089233b569a68befed9fe527c5c9dcf
parent015afb6a3840af279e12e47833d7acb66fe71143
freedreno/ir3: more clever legalize algorithm

Previously we didn't handle flow control in legalize, and instead just
set (ss)(sy) on the first instruction in every block.  Which isn't very
clever.

Instead, consider output state of all predecessor blocks, so we only
set a sync bit if needed for any possible path leading into a block.
Because of loops, we can't require that all successor blocks are
legalized before a given block, so instead run in a loop until results
converge.

Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/ir3/ir3_legalize.c