aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2020-01-10 11:01:33 +0100
committerMartin Jambor <jamborm@gcc.gnu.org>2020-01-10 11:01:33 +0100
commit1a315435dbebed25a316906caf9fa80f4214a5dc (patch)
tree21ea88f2ef5b7d06a7d67dfc171ab02658558f6c
parentf7725a488382e7ed47a808cecaed692e0ed78edb (diff)
downloadgcc-1a315435dbebed25a316906caf9fa80f4214a5dc.zip
gcc-1a315435dbebed25a316906caf9fa80f4214a5dc.tar.gz
gcc-1a315435dbebed25a316906caf9fa80f4214a5dc.tar.bz2
IPA-CP: Access param_ipa_sra_max_replacements through opt_for_fn
2020-01-10 Martin Jambor <mjambor@suse.cz> * params.opt (param_ipa_sra_max_replacements): Mark as Optimization. * ipa-sra.c (pull_accesses_from_callee): New parameter caller, use it to get param_ipa_sra_max_replacements. (param_splitting_across_edge): Pass the caller to pull_accesses_from_callee. From-SVN: r280100
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/ipa-sra.c24
-rw-r--r--gcc/params.opt2
3 files changed, 22 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6e9bdd0..61e3ef5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
2020-01-10 Martin Jambor <mjambor@suse.cz>
+ * params.opt (param_ipa_sra_max_replacements): Mark as Optimization.
+ * ipa-sra.c (pull_accesses_from_callee): New parameter caller, use it
+ to get param_ipa_sra_max_replacements.
+ (param_splitting_across_edge): Pass the caller to
+ pull_accesses_from_callee.
+
+2020-01-10 Martin Jambor <mjambor@suse.cz>
+
* params.opt (param_ipcp_unit_growth): Mark as Optimization.
* ipa-cp.c (max_new_size): Removed.
(orig_overall_size): New variable.
diff --git a/gcc/ipa-sra.c b/gcc/ipa-sra.c
index 79b543f..31de527 100644
--- a/gcc/ipa-sra.c
+++ b/gcc/ipa-sra.c
@@ -3248,16 +3248,17 @@ all_callee_accesses_present_p (isra_param_desc *param_desc,
enum acc_prop_kind {ACC_PROP_DONT, ACC_PROP_COPY, ACC_PROP_CERTAIN};
-/* Attempt to propagate all definite accesses from ARG_DESC to PARAM_DESC, if
- they would not violate some constraint there. If successful, return NULL,
- otherwise return the string reason for failure (which can be written to the
- dump file). DELTA_OFFSET is the known offset of the actual argument withing
- the formal parameter (so of ARG_DESCS within PARAM_DESCS), ARG_SIZE is the
- size of the actual argument or zero, if not known. In case of success, set
- *CHANGE_P to true if propagation actually changed anything. */
+/* Attempt to propagate all definite accesses from ARG_DESC to PARAM_DESC,
+ (which belongs to CALLER) if they would not violate some constraint there.
+ If successful, return NULL, otherwise return the string reason for failure
+ (which can be written to the dump file). DELTA_OFFSET is the known offset
+ of the actual argument withing the formal parameter (so of ARG_DESCS within
+ PARAM_DESCS), ARG_SIZE is the size of the actual argument or zero, if not
+ known. In case of success, set *CHANGE_P to true if propagation actually
+ changed anything. */
static const char *
-pull_accesses_from_callee (isra_param_desc *param_desc,
+pull_accesses_from_callee (cgraph_node *caller, isra_param_desc *param_desc,
isra_param_desc *arg_desc,
unsigned delta_offset, unsigned arg_size,
bool *change_p)
@@ -3337,7 +3338,7 @@ pull_accesses_from_callee (isra_param_desc *param_desc,
return NULL;
if ((prop_count + pclen
- > (unsigned) param_ipa_sra_max_replacements)
+ > (unsigned) opt_for_fn (caller->decl, param_ipa_sra_max_replacements))
|| size_would_violate_limit_p (param_desc,
param_desc->size_reached + prop_size))
return "propagating accesses would violate the count or size limit";
@@ -3457,7 +3458,8 @@ param_splitting_across_edge (cgraph_edge *cs)
else
{
const char *pull_failure
- = pull_accesses_from_callee (param_desc, arg_desc, 0, 0, &res);
+ = pull_accesses_from_callee (cs->caller, param_desc, arg_desc,
+ 0, 0, &res);
if (pull_failure)
{
if (dump_file && (dump_flags & TDF_DETAILS))
@@ -3518,7 +3520,7 @@ param_splitting_across_edge (cgraph_edge *cs)
else
{
const char *pull_failure
- = pull_accesses_from_callee (param_desc, arg_desc,
+ = pull_accesses_from_callee (cs->caller, param_desc, arg_desc,
ipf->unit_offset,
ipf->unit_size, &res);
if (pull_failure)
diff --git a/gcc/params.opt b/gcc/params.opt
index 25d045c..a669bbc1 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -239,7 +239,7 @@ Common Joined UInteger Var(param_ipa_max_switch_predicate_bounds) Init(5) Param
Maximal number of boundary endpoints of case ranges of switch statement used during IPA functoin summary generation.
-param=ipa-sra-max-replacements=
-Common Joined UInteger Var(param_ipa_sra_max_replacements) Init(8) IntegerRange(0, 16) Param
+Common Joined UInteger Var(param_ipa_sra_max_replacements) Optimization Init(8) IntegerRange(0, 16) Param
Maximum pieces that IPA-SRA tracks per formal parameter, as a consequence, also the maximum number of replacements of a formal parameter.
-param=ipa-sra-ptr-growth-factor=