lima/ppir: rework select conditions
authorErico Nunes <nunes.erico@gmail.com>
Tue, 14 Apr 2020 00:54:56 +0000 (02:54 +0200)
committerErico Nunes <nunes.erico@gmail.com>
Sat, 9 May 2020 12:40:40 +0000 (14:40 +0200)
commite622e010fd838eb30eab46800015516703b76f4d
tree7b15fd93592c73373ccdcb513953c253cc82dd47
parenta0c58867cddcf199cf85d270b42965678ad8af10
lima/ppir: rework select conditions

This is yet another simple optimization that attemts to save the
insertion of an unnecessary mov for a large number of cases.
If the node outputting the condition for select satisfies a few
requirements (which are common in the case of comparison conditions),
it can just be changed to pipeline output and used directly.
In case of difficult corner cases, just fall back to the mov as before.

The sel_cond op is removed as the scheduler can be smart enough to place
nodes that output to ^fmul in the ALU_SCL_MUL slot, and as there can be
alu ops other than just mov.

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/4632>
src/gallium/drivers/lima/ir/pp/codegen.c
src/gallium/drivers/lima/ir/pp/instr.c
src/gallium/drivers/lima/ir/pp/lower.c
src/gallium/drivers/lima/ir/pp/node.c
src/gallium/drivers/lima/ir/pp/ppir.h