return max_new_size;
}
+/* Return true if NODE should be cloned just for a parameter removal, possibly
+ dumping a reason if not. */
+
+static bool
+clone_for_param_removal_p (cgraph_node *node)
+{
+ if (!node->can_change_signature)
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " Not considering cloning to remove parameters, "
+ "function cannot change signature.\n");
+ return false;
+ }
+ if (node->can_be_local_p ())
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, " Not considering cloning to remove parameters, "
+ "IPA-SRA can do it potentially better.\n");
+ return false;
+ }
+ return true;
+}
+
/* Iterate over known values of parameters of NODE and estimate the local
effects in terms of time and size they have. */
&removable_params_cost);
int devirt_bonus = devirtualization_time_bonus (node, &avals);
if (always_const || devirt_bonus
- || (removable_params_cost && node->can_change_signature))
+ || (removable_params_cost && clone_for_param_removal_p (node)))
{
struct caller_statistics stats;
ipa_call_estimates estimates;