summaryrefslogtreecommitdiff
path: root/src/compiler/nir/nir_opt_gcm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir/nir_opt_gcm.c')
-rw-r--r--src/compiler/nir/nir_opt_gcm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c
index 891da57fe35..d6fd35f84c2 100644
--- a/src/compiler/nir/nir_opt_gcm.c
+++ b/src/compiler/nir/nir_opt_gcm.c
@@ -604,6 +604,11 @@ opt_gcm_impl(nir_function_impl *impl, bool value_number)
nir_metadata_require(impl, nir_metadata_block_index |
nir_metadata_dominance);
+ /* A previous pass may have left pass_flags dirty, so clear it all out. */
+ nir_foreach_block(block, impl)
+ nir_foreach_instr(instr, block)
+ instr->pass_flags = 0;
+
struct gcm_state state;
state.impl = impl;