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>
This commit is contained in:
Rob Clark
2018-06-06 10:11:45 -04:00
parent c9d6e579ec
commit 7235c144a6
4 changed files with 144 additions and 0 deletions

View File

@@ -145,6 +145,7 @@ files_libnir = files(
'nir_lower_wpos_ytransform.c',
'nir_lower_bit_size.c',
'nir_metadata.c',
'nir_move_load_const.c',
'nir_move_vec_src_uses_to_dest.c',
'nir_normalize_cubemap_coords.c',
'nir_opt_conditional_discard.c',