aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-12-17 11:57:14 -0800
committerMarge Bot <[email protected]>2020-02-01 02:40:22 +0000
commitc1194e10b2dc4d14ea21eb9bc8e607056ebaffcd (patch)
treef505971c3a7014f0b33672acaaaac14cacea5fa6 /src
parentf0b792ea0602dd344b8a2dce4ab582b167f6fd35 (diff)
freedreno/ir3: cleanup after lower_locals_to_regs
Signed-off-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3569>
Diffstat (limited to 'src')
-rw-r--r--src/freedreno/ir3/ir3_context.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/freedreno/ir3/ir3_context.c b/src/freedreno/ir3/ir3_context.c
index 334b0ae0bab..33e73bcb216 100644
--- a/src/freedreno/ir3/ir3_context.c
+++ b/src/freedreno/ir3/ir3_context.c
@@ -79,21 +79,30 @@ ir3_context_init(struct ir3_compiler *compiler,
* in ir3_optimize_nir():
*/
NIR_PASS_V(ctx->s, nir_lower_bool_to_int32);
- NIR_PASS_V(ctx->s, nir_lower_locals_to_regs);
+ bool progress = false;
+ NIR_PASS(progress, ctx->s, nir_lower_locals_to_regs);
+
+ /* we could need cleanup after lower_locals_to_regs */
+ while (progress) {
+ progress = false;
+ NIR_PASS(progress, ctx->s, nir_opt_algebraic);
+ NIR_PASS(progress, ctx->s, nir_opt_constant_folding);
+ }
/* We want to lower nir_op_imul as late as possible, to catch also
* those generated by earlier passes (e.g, nir_lower_locals_to_regs).
* However, we want a final swing of a few passes to have a chance
* at optimizing the result.
*/
- bool progress = false;
+ progress = false;
NIR_PASS(progress, ctx->s, ir3_nir_lower_imul);
- if (progress) {
- NIR_PASS_V(ctx->s, nir_opt_algebraic);
- NIR_PASS_V(ctx->s, nir_opt_copy_prop_vars);
- NIR_PASS_V(ctx->s, nir_opt_dead_write_vars);
- NIR_PASS_V(ctx->s, nir_opt_dce);
- NIR_PASS_V(ctx->s, nir_opt_constant_folding);
+ while (progress) {
+ progress = false;
+ NIR_PASS(progress, ctx->s, nir_opt_algebraic);
+ NIR_PASS(progress, ctx->s, nir_opt_copy_prop_vars);
+ NIR_PASS(progress, ctx->s, nir_opt_dead_write_vars);
+ NIR_PASS(progress, ctx->s, nir_opt_dce);
+ NIR_PASS(progress, ctx->s, nir_opt_constant_folding);
}
/* Enable the texture pre-fetch feature only a4xx onwards. But