summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir')
-rw-r--r--src/compiler/nir/nir_algebraic.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py
index a30652f2afd..77ad35eda2a 100644
--- a/src/compiler/nir/nir_algebraic.py
+++ b/src/compiler/nir/nir_algebraic.py
@@ -216,7 +216,7 @@ ${pass_name}_block(nir_block *block, void *void_state)
{
struct opt_state *state = void_state;
- nir_foreach_instr_safe(block, instr) {
+ nir_foreach_instr_reverse_safe(block, instr) {
if (instr->type != nir_instr_type_alu)
continue;
@@ -255,7 +255,7 @@ ${pass_name}_impl(nir_function_impl *impl, const bool *condition_flags)
state.progress = false;
state.condition_flags = condition_flags;
- nir_foreach_block(impl, ${pass_name}_block, &state);
+ nir_foreach_block_reverse(impl, ${pass_name}_block, &state);
if (state.progress)
nir_metadata_preserve(impl, nir_metadata_block_index |