diff options
author | Rob Clark <[email protected]> | 2018-01-29 14:53:13 -0500 |
---|---|---|
committer | Rob Clark <[email protected]> | 2018-02-10 14:54:58 -0500 |
commit | 268ab05484379a35a54c14de9c111a52d338b2fd (patch) | |
tree | a9295a4af7de41d2f5cc104dd893682c2232ed7f /src | |
parent | 4c15c53d91dff8ec0573421e234940c99f8a54cb (diff) |
freedreno/ir3: add experimental GCM pass
Generally seems to do worse on instruction count and register usage,
according to shader-db. But shader-db also doesn't do a very good job
of weighting loop bodies, so that might not be totally valid.
So add an env variable to enable GCM pass for easier experimentation.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_nir.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_nir.c b/src/gallium/drivers/freedreno/ir3/ir3_nir.c index 3706a023d3c..6edb0e45749 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_nir.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_nir.c @@ -97,6 +97,13 @@ ir3_optimize_loop(nir_shader *s) progress |= OPT(s, nir_copy_prop); progress |= OPT(s, nir_opt_dce); progress |= OPT(s, nir_opt_cse); + static int gcm = -1; + if (gcm == -1) + gcm = env2u("GCM"); + if (gcm == 1) + progress |= OPT(s, nir_opt_gcm, true); + else if (gcm == 2) + progress |= OPT(s, nir_opt_gcm, false); progress |= OPT(s, nir_opt_peephole_select, 16); progress |= OPT(s, nir_opt_intrinsics); progress |= OPT(s, nir_opt_algebraic); |