aboutsummaryrefslogtreecommitdiffstats
path: root/src/broadcom/compiler/vir.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-04-11 11:12:01 -0700
committerEric Anholt <[email protected]>2019-04-12 16:16:58 -0700
commitdc402be73e4bbb9b43213a4266b98a46092e3038 (patch)
tree2ceedd9ccee93e28f7e661f0e0155b651e15608f /src/broadcom/compiler/vir.c
parent18ed82b084c79bf63666f2da22e5d675fb01aa26 (diff)
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.
Diffstat (limited to 'src/broadcom/compiler/vir.c')
-rw-r--r--src/broadcom/compiler/vir.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c
index 6655e5e73bc..5d4e5dd103a 100644
--- a/src/broadcom/compiler/vir.c
+++ b/src/broadcom/compiler/vir.c
@@ -579,6 +579,12 @@ v3d_lower_nir(struct v3d_compile *c)
NIR_PASS_V(c->s, nir_lower_tex, &tex_options);
NIR_PASS_V(c->s, nir_lower_system_values);
+
+ NIR_PASS_V(c->s, nir_lower_vars_to_scratch,
+ nir_var_function_temp,
+ 0,
+ glsl_get_natural_size_align_bytes);
+ NIR_PASS_V(c->s, v3d_nir_lower_scratch);
}
static void