* needs to be predicated on the return flag variable.
*/
bool has_predicated_return;
+
+ bool removed_unreachable_code;
};
static bool lower_returns_in_cf_list(struct exec_list *cf_list,
*/
return false;
} else {
+ state->removed_unreachable_code = true;
nir_cf_delete(&list);
- return true;
+ return false;
}
}
state.loop = NULL;
state.return_flag = NULL;
state.has_predicated_return = false;
+ state.removed_unreachable_code = false;
nir_builder_init(&state.builder, impl);
bool progress = lower_returns_in_cf_list(&impl->body, &state);
+ progress = progress || state.removed_unreachable_code;
if (progress) {
nir_metadata_preserve(impl, nir_metadata_none);