Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
nir_handle_add_jump(instr->block);
}
+static bool
+src_is_valid(const nir_src *src)
+{
+ return src->is_ssa ? (src->ssa != NULL) : (src->reg.reg != NULL);
+}
+
static bool
remove_use_cb(nir_src *src, void *state)
{
- list_del(&src->use_link);
+ if (src_is_valid(src))
+ list_del(&src->use_link);
return true;
}
}
}
-static bool
-src_is_valid(const nir_src *src)
-{
- return src->is_ssa ? (src->ssa != NULL) : (src->reg.reg != NULL);
-}
-
static void
src_remove_all_uses(nir_src *src)
{