gcc/ChangeLog:
* config/riscv/riscv-vsetvl.cc (pass_vsetvl::forward_demand_fusion):
Add pre-check for redundant flow.
if (!prop.valid_or_dirty_p ())
continue;
+ if (cfg_bb == ENTRY_BLOCK_PTR_FOR_FN (cfun))
+ continue;
+
edge e;
edge_iterator ei;
/* Forward propagate to each successor. */
/* It's quite obvious, we don't need to propagate itself. */
if (e->dest->index == cfg_bb->index)
continue;
+ /* We don't propagate through critical edges. */
+ if (e->flags & EDGE_COMPLEX)
+ continue;
+ if (e->dest->index == EXIT_BLOCK_PTR_FOR_FN (cfun)->index)
+ continue;
/* If there is nothing to propagate, just skip it. */
if (!local_dem.valid_or_dirty_p ())