IPA-CP: Access param_ipa_sra_max_replacements through opt_for_fn
authorMartin Jambor <mjambor@suse.cz>
Fri, 10 Jan 2020 10:01:33 +0000 (11:01 +0100)
committerMartin Jambor <jamborm@gcc.gnu.org>
Fri, 10 Jan 2020 10:01:33 +0000 (11:01 +0100)
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

gcc/ChangeLog
gcc/ipa-sra.c
gcc/params.opt

index 6e9bdd07b38b929f95baed3d6eb18b013441ec51..61e3ef54c9ac15e322954b387ec220b975d31afa 100644 (file)
@@ -1,3 +1,11 @@
+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.
index 79b543fa934be90e51e4cb4adef026b81297fa3c..31de527d11162d81b636df5ba674e8660e033b6c 100644 (file)
@@ -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)
index 25d045c7840b1c21acffbd7770d0dbd2dd744689..a669bbc1aa5fc78602146b1db79753350a65e8be 100644 (file)
@@ -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=