v3d: Use the new lower_to_scratch implementation for indirects on temps.
authorEric Anholt <eric@anholt.net>
Thu, 11 Apr 2019 18:12:01 +0000 (11:12 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 12 Apr 2019 23:16:58 +0000 (16:16 -0700)
commitdc402be73e4bbb9b43213a4266b98a46092e3038
tree2ceedd9ccee93e28f7e661f0e0155b651e15608f
parent18ed82b084c79bf63666f2da22e5d675fb01aa26
v3d: Use the new lower_to_scratch implementation for indirects on temps.

We can use the same register spilling infrastructure for our loads/stores
of indirect access of temp variables, instead of doing an if ladder.

Cuts 50% of instructions and max-temps from 2 KSP shaders in shader-db.
Also causes several other KSP shaders with large bodies and large loop
counts to not be force-unrolled.

The change was originally motivated by NOLTIS slightly modifying register
pressure in piglit temp mat4 array read/write tests, triggering register
allocation failures.
src/broadcom/Makefile.sources
src/broadcom/compiler/meson.build
src/broadcom/compiler/nir_to_vir.c
src/broadcom/compiler/v3d_compiler.h
src/broadcom/compiler/v3d_nir_lower_scratch.c [new file with mode: 0644]
src/broadcom/compiler/vir.c
src/broadcom/compiler/vir_register_allocate.c
src/gallium/drivers/v3d/v3d_screen.c