nir: replace nir_move_load_const() with nir_opt_sink()
authorRhys Perry <pendingchaos02@gmail.com>
Wed, 22 May 2019 19:23:03 +0000 (20:23 +0100)
committerRhys Perry <pendingchaos02+freedesktop@gmail.com>
Mon, 12 Aug 2019 22:01:30 +0000 (22:01 +0000)
commitda8ed68aca1b077fcbb8da429d8bcea785eeec10
tree7dad83058b603b780f1016c0f43ea1b1326fecdf
parentc2fe7a0fb818578d87f12300523d796205edffd5
nir: replace nir_move_load_const() with nir_opt_sink()

This is mostly the same as nir_move_load_const() but can also move
undef instructions, comparisons and some intrinsics (being careful with
loops).

v2: actually delete nir_move_load_const.c
v3: fix nir_opt_sink() usage in freedreno
v3: update Makefile.sources
v4: replace get_move_def with nir_can_move_instr and nir_instr_ssa_def
v4: handle if uses
v4: fix handling of nested loops
v5: re-write adjust_block_for_loops
v5: re-write setting of use_block for if uses

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Co-authored-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_move_load_const.c [deleted file]
src/compiler/nir/nir_opt_sink.c [new file with mode: 0644]
src/freedreno/ir3/ir3_nir.c
src/gallium/drivers/freedreno/a2xx/ir2_nir.c