if (function->impl == NULL)
continue;
+ bool impl_progress = false;
nir_foreach_block_safe(block, function->impl) {
nir_builder b;
nir_builder_init(&b, function->impl);
switch (intrin->intrinsic) {
case nir_intrinsic_image_deref_load:
if (lower_image_load_instr(&b, devinfo, intrin))
- progress = true;
+ impl_progress = true;
break;
case nir_intrinsic_image_deref_store:
if (lower_image_store_instr(&b, devinfo, intrin))
- progress = true;
+ impl_progress = true;
break;
case nir_intrinsic_image_deref_atomic_add:
if (uses_atomic_load_store)
*uses_atomic_load_store = true;
if (lower_image_atomic_instr(&b, devinfo, intrin))
- progress = true;
+ impl_progress = true;
break;
case nir_intrinsic_image_deref_size:
if (lower_image_size_instr(&b, devinfo, intrin))
- progress = true;
+ impl_progress = true;
break;
default:
}
}
- if (progress)
+ if (impl_progress) {
+ progress = true;
nir_metadata_preserve(function->impl, nir_metadata_none);
+ } else {
+ nir_metadata_preserve(function->impl, nir_metadata_all);
+ }
}
return progress;
progress |= brw_nir_opt_peephole_ffma_block(&builder, block);
}
- if (progress)
+ if (progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
+ } else {
+ nir_metadata_preserve(impl, nir_metadata_all);
+ }
return progress;
}