}
}
-void
+bool
substitute_and_fold_engine::propagate_into_phi_args (basic_block bb)
{
edge e;
edge_iterator ei;
+ bool propagated = false;
+
/* Visit BB successor PHI nodes and replace PHI args. */
FOR_EACH_EDGE (e, ei, bb->succs)
{
|| virtual_operand_p (arg))
continue;
tree val = get_value (arg, phi);
- if (val && is_gimple_min_invariant (val)
+ if (val
+ && is_gimple_min_invariant (val)
&& may_propagate_copy (arg, val))
- propagate_value (use_p, val);
+ {
+ propagate_value (use_p, val);
+ propagated = true;
+ }
}
}
+ return propagated;
}
edge
}
}
- substitute_and_fold_engine->propagate_into_phi_args (bb);
+ something_changed |= substitute_and_fold_engine->propagate_into_phi_args (bb);
return NULL;
}
virtual void pre_fold_stmt (gimple *) { }
virtual void post_new_stmt (gimple *) { }
- void propagate_into_phi_args (basic_block);
+ bool propagate_into_phi_args (basic_block);
/* Users like VRP can set this when they want to perform
folding for every propagation. */