mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 08:20:12 +01:00
freedreno/ir3: cleanup after lower_locals_to_regs
Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3569>
This commit is contained in:
parent
f0b792ea06
commit
c1194e10b2
1 changed files with 17 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue