nir/sink,nir/move: move/sink nir_op_mov
authorRhys Perry <pendingchaos02@gmail.com>
Mon, 14 Oct 2019 16:15:04 +0000 (17:15 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 14 Jan 2020 13:56:45 +0000 (13:56 +0000)
commitd8e05edbd93e544530ae616fd239c4731e8c68bc
tree0515c7323ac8fc41b368b5a52574693c3200c8ae
parent04fac72ec77f9a19e56ec95f7a0b857f85438ab3
nir/sink,nir/move: move/sink nir_op_mov

Can uncover opportunities to move other instructions. This can increase
register usage, but that doesn't seem to actually happen.

This optimizes a pattern of a load_per_vertex_input followed by several
moves and then a store_output in a different block.

v2: add nir_move_copies to make it optional

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net> (v1)
Acked-by: Rob Clark <robdclark@chromium.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2420>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2420>
src/compiler/nir/nir.h
src/compiler/nir/nir_opt_sink.c