nir: add pass to move load_const
authorRob Clark <robdclark@gmail.com>
Wed, 6 Jun 2018 14:11:45 +0000 (10:11 -0400)
committerRob Clark <robdclark@gmail.com>
Tue, 19 Jun 2018 17:02:28 +0000 (13:02 -0400)
commit7235c144a64a444a4c7619a6f539676f7a2d16d9
tree2e22bc48c21a6b63a817f3ff5c8b417f5f0250ae
parentc9d6e579ecaa72c50cc2ef108a7ead5e24ae2512
nir: add pass to move load_const

Run this pass late (after opt loop) to move load_const instructions back
into the basic blocks which use the result, in cases where a load_const
is only consumed in a single block.

This helps reduce register usage in cases where the backend driver
cannot lower the load_const to a uniform.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/compiler/Makefile.sources
src/compiler/nir/meson.build
src/compiler/nir/nir.h
src/compiler/nir/nir_move_load_const.c [new file with mode: 0644]