freedreno/ir3: enable nir_opt_loop_unroll on a6xx
authorHyunjun Ko <zzoon@igalia.com>
Tue, 19 Nov 2019 07:20:10 +0000 (07:20 +0000)
committerMarge Bot <eric+marge@anholt.net>
Tue, 24 Mar 2020 23:21:21 +0000 (23:21 +0000)
If precision lowering happens at GLSL IR, loop_analysis at IR doesn't
work as expected since it can't handle things like:

"(expression bool < (expression float16_t f2fmp (var_ref ndx) ) (constant float16_t (1.000000)) )"

So we'd rather do this optimization at the NIR stage.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3885>

src/freedreno/ir3/ir3_nir.c

index b6b37d052061a4bd77af794864892332ac9d54fb..284d634884d0d40dc3ee57833d778028edd560d4 100644 (file)
@@ -116,6 +116,7 @@ static const nir_shader_compiler_options options_a6xx = {
                .vectorize_io = true,
                .lower_to_scalar = true,
                .has_imul24 = true,
+               .max_unroll_iterations = 32,
 };
 
 const nir_shader_compiler_options *
@@ -207,7 +208,6 @@ ir3_optimize_loop(nir_shader *s)
                progress |= OPT(s, nir_opt_if, false);
                progress |= OPT(s, nir_opt_remove_phis);
                progress |= OPT(s, nir_opt_undef);
-
        } while (progress);
 }