lima/ppir: duplicate consts in nir
authorErico Nunes <nunes.erico@gmail.com>
Mon, 13 Apr 2020 13:32:01 +0000 (15:32 +0200)
committerMarge Bot <eric+marge@anholt.net>
Sat, 9 May 2020 11:30:07 +0000 (11:30 +0000)
commit8c4157138f331d5053036f756aefa7006bbb6fac
tree22af1a9d309add9095cc464648711ffdeb633301
parent5e6c3861182cbf481ce3d25d0bbbcad4916c92dd
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>
src/gallium/drivers/lima/Android.mk
src/gallium/drivers/lima/ir/lima_ir.h
src/gallium/drivers/lima/ir/lima_nir_duplicate_consts.c [new file with mode: 0644]
src/gallium/drivers/lima/ir/pp/nir.c
src/gallium/drivers/lima/lima_program.c
src/gallium/drivers/lima/meson.build