lima/ppir: duplicate consts in nir

Move the duplicate consts step to a nir pass.
This makes the nir representation closer to what ppir will have in the
result.
Additionally, it handles the case where a const is used multiple times
by a single node (which can happen in instructions like fcsel). The new
implementation will only emit a single load const for that case.

Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4535>
This commit is contained in:
Erico Nunes
2020-04-13 15:32:01 +02:00
committed by Marge Bot
parent 5e6c386118
commit 8c4157138f
6 changed files with 130 additions and 4 deletions

View File

@@ -250,6 +250,7 @@ lima_program_optimize_fs_nir(struct nir_shader *s,
NIR_PASS_V(s, lima_nir_duplicate_load_uniforms);
NIR_PASS_V(s, lima_nir_duplicate_load_inputs);
NIR_PASS_V(s, lima_nir_duplicate_load_consts);
nir_sweep(s);
}