lima/ppir: rework store output
authorErico Nunes <nunes.erico@gmail.com>
Tue, 14 Apr 2020 00:45:38 +0000 (02:45 +0200)
committerErico Nunes <nunes.erico@gmail.com>
Sat, 9 May 2020 12:40:34 +0000 (14:40 +0200)
commit8c47640731303ed2607d28ce2cf19a7e8f0f4006
tree2916196c8686cd26a4c970b9df9c2164382d9d84
parent570f1420dbf361cf889c21c119816e063ecc3cea
lima/ppir: rework store output

In many cases, it is possible to avoid creating a mov for the store
output node.
Additionally, nodes other than alu, such as load varying, can be valid
store output nodes too.

This is another small optimization, but helps a vast majority of
programs by 1 instruction.
Shaders with discard easily become complicated to handle properly.
Some example issues: ppir has to rely on instruction ordering; or a
node with ssa output could be required both before a discard_if (as a
condition) and after it (as the instruction with the 'stop' bit set).
So don't try to handle them here.

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/liveness.c
src/gallium/drivers/lima/ir/pp/nir.c
src/gallium/drivers/lima/ir/pp/node.c
src/gallium/drivers/lima/ir/pp/node_to_instr.c
src/gallium/drivers/lima/ir/pp/ppir.h
src/gallium/drivers/lima/ir/pp/regalloc.c