ir3: Split out variant-specific lowering and optimizations
authorConnor Abbott <cwabbott0@gmail.com>
Wed, 10 Jun 2020 09:11:27 +0000 (11:11 +0200)
committerMarge Bot <eric+marge@anholt.net>
Fri, 19 Jun 2020 13:16:57 +0000 (13:16 +0000)
commit65660622a1f7284c457388e553867b239343d314
treeac7e476a8f9dbdaa38f0c748ace0709869655e2f
parentf4654c458f81d47b59f3562f6f92ebf20321a3a2
ir3: Split out variant-specific lowering and optimizations

It seems a lot of the lowerings being run the second time were
unnecessary. In addition, when const_state is moved to the variant,
then it will become impossible to know ahead of time whether a variant
needs additional optimizing, which means that ir3_key_lowers_nir() needs
to go away. The new approach should have the same effect, since it skips
running lowerings that are unnecessary and then skips the opt loop if no
optimizations made progress, but it will work better when we move
ir3_nir_analyze_ubo_ranges() to be after variant creation.

The one maybe controversial thing I did is to make
nir_opt_algebraic_late() always happen during variant lowering. I wanted
to avoid code duplication, and it seems to me that we should push the
_late variants as far back as possible so that later opt_algebraic runs
don't miss out on optimization opportunities.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5508>
src/freedreno/ir3/ir3_context.c
src/freedreno/ir3/ir3_nir.c
src/freedreno/ir3/ir3_nir.h
src/freedreno/ir3/ir3_shader.c
src/gallium/drivers/freedreno/ir3/ir3_cmdline.c