]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ipa: Convert lattices from pure array to vector (PR 113476)
authorMartin Jambor <mjambor@suse.cz>
Wed, 21 Feb 2024 14:43:13 +0000 (15:43 +0100)
committerMartin Jambor <mjambor@suse.cz>
Wed, 21 Feb 2024 14:43:17 +0000 (15:43 +0100)
In PR 113476 we have discovered that ipcp_param_lattices is no longer
a POD and should be destructed.  In a follow-up discussion it
transpired that their initialization done by memsetting their backing
memory to zero is also invalid because now any write there before
construction can be considered dead.  Plus that having them in an
array is a little bit old-school and does not get the extra checking
offered by vector along with automatic construction and destruction
when necessary.

So this patch converts the array to a vector.  That however means that
ipcp_param_lattices cannot be just a forward declared type but must be
known to all code that deals with ipa_node_params and thus to all code
that includes ipa-prop.h.  Therefore I have moved ipcp_param_lattices
and the type it depends on to a new header ipa-cp.h which now
ipa-prop.h depends on.  Because we have the (IMHO not a very wise)
rule that headers don't include what they need themselves, I had to
add inclusions of ipa-cp.h and sreal.h (on which it depends) to very
many files, which made the patch rather ugly.

gcc/lto/ChangeLog:

2024-02-16  Martin Jambor  <mjambor@suse.cz>

PR ipa/113476
* lto-common.cc: Include sreal.h and ipa-cp.h.
* lto-partition.cc: Include ipa-cp.h, move inclusion of sreal higher.
* lto.cc: Include sreal.h and ipa-cp.h.

gcc/ChangeLog:

2024-02-16  Martin Jambor  <mjambor@suse.cz>

PR ipa/113476
* ipa-prop.h (ipa_node_params): Convert lattices to a vector, adjust
initializers in the contructor.
(ipa_node_params::~ipa_node_params): Release lattices as a vector.
* ipa-cp.h: New file.
* ipa-cp.cc: Include sreal.h and ipa-cp.h.
(ipcp_value_source): Move to ipa-cp.h.
(ipcp_value_base): Likewise.
(ipcp_value): Likewise.
(ipcp_lattice): Likewise.
(ipcp_agg_lattice): Likewise.
(ipcp_bits_lattice): Likewise.
(ipcp_vr_lattice): Likewise.
(ipcp_param_lattices): Likewise.
(ipa_get_parm_lattices): Remove assert latticess is non-NULL.
(ipa_value_from_jfunc): Adjust a check for empty lattices.
(ipa_context_from_jfunc): Likewise.
(ipa_agg_value_from_jfunc): Likewise.
(merge_agg_lats_step): Do not memset new aggregate lattices to zero.
(ipcp_propagate_stage): Allocate lattices in a vector as opposed to
just in contiguous memory.
(ipcp_store_vr_results): Adjust a check for empty lattices.
* auto-profile.cc: Include sreal.h and ipa-cp.h.
* cgraph.cc: Likewise.
* cgraphclones.cc: Likewise.
* cgraphunit.cc: Likewise.
* config/aarch64/aarch64.cc: Likewise.
* config/i386/i386-builtins.cc: Likewise.
* config/i386/i386-expand.cc: Likewise.
* config/i386/i386-features.cc: Likewise.
* config/i386/i386-options.cc: Likewise.
* config/i386/i386.cc: Likewise.
* config/rs6000/rs6000.cc: Likewise.
* config/s390/s390.cc: Likewise.
* gengtype.cc (open_base_files): Added sreal.h and ipa-cp.h to the
files to be included in gtype-desc.cc.
* gimple-range-fold.cc: Include sreal.h and ipa-cp.h.
* ipa-devirt.cc: Likewise.
* ipa-fnsummary.cc: Likewise.
* ipa-icf.cc: Likewise.
* ipa-inline-analysis.cc: Likewise.
* ipa-inline-transform.cc: Likewise.
* ipa-inline.cc: Include ipa-cp.h, move inclusion of sreal.h higher.
* ipa-modref.cc: Include sreal.h and ipa-cp.h.
* ipa-param-manipulation.cc: Likewise.
* ipa-predicate.cc: Likewise.
* ipa-profile.cc: Likewise.
* ipa-prop.cc: Likewise.
(ipa_node_params_t::duplicate): Assert new lattices remain empty
instead of setting them to NULL.
* ipa-pure-const.cc: Include sreal.h and ipa-cp.h.
* ipa-split.cc: Likewise.
* ipa-sra.cc: Likewise.
* ipa-strub.cc: Likewise.
* ipa-utils.cc: Likewise.
* ipa.cc: Likewise.
* toplev.cc: Likewise.
* tree-ssa-ccp.cc: Likewise.
* tree-ssa-sccvn.cc: Likewise.
* tree-vrp.cc: Likewise.

41 files changed:
gcc/auto-profile.cc
gcc/cgraph.cc
gcc/cgraphclones.cc
gcc/cgraphunit.cc
gcc/config/aarch64/aarch64.cc
gcc/config/i386/i386-builtins.cc
gcc/config/i386/i386-expand.cc
gcc/config/i386/i386-features.cc
gcc/config/i386/i386-options.cc
gcc/config/i386/i386.cc
gcc/config/rs6000/rs6000.cc
gcc/config/s390/s390.cc
gcc/gengtype.cc
gcc/gimple-range-fold.cc
gcc/ipa-cp.cc
gcc/ipa-cp.h [new file with mode: 0644]
gcc/ipa-devirt.cc
gcc/ipa-fnsummary.cc
gcc/ipa-icf.cc
gcc/ipa-inline-analysis.cc
gcc/ipa-inline-transform.cc
gcc/ipa-inline.cc
gcc/ipa-modref.cc
gcc/ipa-param-manipulation.cc
gcc/ipa-predicate.cc
gcc/ipa-profile.cc
gcc/ipa-prop.cc
gcc/ipa-prop.h
gcc/ipa-pure-const.cc
gcc/ipa-split.cc
gcc/ipa-sra.cc
gcc/ipa-strub.cc
gcc/ipa-utils.cc
gcc/ipa.cc
gcc/lto/lto-common.cc
gcc/lto/lto-partition.cc
gcc/lto/lto.cc
gcc/toplev.cc
gcc/tree-ssa-ccp.cc
gcc/tree-ssa-sccvn.cc
gcc/tree-vrp.cc

index 63d0c3dc36dfb283338e544cf93de03659c4cd07..e5407d32fbbfb8c8d56b17936cd090d9183f757e 100644 (file)
@@ -42,6 +42,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-iterator.h"
 #include "value-prof.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "ipa-inline.h"
index 0ac8f73204b2418ffab9d2c3d25d0976a5e53037..473d8410bc976b647914996a56534b2febe69eae 100644 (file)
@@ -51,6 +51,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-utils.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "cfgloop.h"
index 6d7bc402a29161f473aaa34fb11b24264a7e8b7c..4fff6873a369f29af5ac4fcf9df5bf63f89ff6dc 100644 (file)
@@ -84,6 +84,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "alloc-pool.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "symtab-thunks.h"
index 5c405258ec3080eb79353f9f6dad25480f8005b3..d200166f7e93a53aaeab652fdb77195caf6bb23e 100644 (file)
@@ -191,6 +191,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "debug.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "gimple-pretty-print.h"
 #include "plugin.h"
index 28d1555dada90282c0f8a5921b05306a10012182..16318bf925883ecedf9345e53fc0824a553b2747 100644 (file)
@@ -91,6 +91,8 @@
 #include "tree-pass.h"
 #include "cfgbuild.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "hash-map.h"
index d5b83e9d90fcca6ea6ce2142f15543e96ba9e65b..8b79d335c8829930edfc7c80f84e0175632c9f11 100644 (file)
@@ -82,6 +82,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "intl.h"
 #include "ifcvt.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "wide-int-bitmask.h"
index 50f9fe2c0d73908d88b754131ff8e3f1d636061f..a4d3369f01b03d8be6cf2681106a81e44f9135ea 100644 (file)
@@ -82,6 +82,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "intl.h"
 #include "ifcvt.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "wide-int-bitmask.h"
index f1b1cf2423372fd6f77123195ccd8822d716a52b..d3b9ae8102566beb27bc884e0ca4780b2c9d0f13 100644 (file)
@@ -82,6 +82,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "intl.h"
 #include "ifcvt.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "wide-int-bitmask.h"
index 8f5ce817630cc4885751bc55f44702199c68b6eb..93a01146db7be9d4b37b6137b07228d756de87f9 100644 (file)
@@ -82,6 +82,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "intl.h"
 #include "ifcvt.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "wide-int-bitmask.h"
index 46f238651a6ba3c9293acc060c072cb14e3664e4..4fdab34c91cdb72e02089137dc66e3fa946f82f2 100644 (file)
@@ -86,6 +86,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "intl.h"
 #include "ifcvt.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "wide-int-bitmask.h"
index 5d975dab9216b55ce5b6a2d6aff1ae3f2bf0a1e0..a2a679d8eedabdedbd4be84d4810675f643768c6 100644 (file)
@@ -72,6 +72,8 @@
 #include "context.h"
 #include "tree-pass.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "except.h"
index f182c26e78bcf17d82946e87ece6824aea8b018f..c857b2028f2e4ba22897c8b9fa572413c903e2af 100644 (file)
@@ -83,6 +83,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm-constrs.h"
 #include "tree-vrp.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "sched-int.h"
index 87f8090544c1ee7bc0275af827eeb24ce36b1544..c0ecbe8558b1f255dd80048756916c14d0fe0b00 100644 (file)
@@ -1715,9 +1715,9 @@ open_base_files (void)
       "tree-dfa.h", "tree-ssa.h", "reload.h", "cpplib.h", "tree-chrec.h",
       "except.h", "output.h",  "cfgloop.h", "target.h", "lto-streamer.h",
       "target-globals.h", "ipa-ref.h", "cgraph.h", "symbol-summary.h",
-      "ipa-prop.h", "ipa-fnsummary.h", "dwarf2out.h", "omp-general.h",
-      "omp-offload.h", "ipa-modref-tree.h", "ipa-modref.h", "symtab-thunks.h",
-      "symtab-clones.h", "diagnostic-spec.h", "ctfc.h",
+      "sreal.h", "ipa-cp.h", "ipa-prop.h", "ipa-fnsummary.h", "dwarf2out.h",
+      "omp-general.h", "omp-offload.h", "ipa-modref-tree.h", "ipa-modref.h",
+      "symtab-thunks.h", "symtab-clones.h", "diagnostic-spec.h", "ctfc.h",
       NULL
     };
     const char *const *ifp;
index 0cc531999631645528b79675455a41e59db9b17c..9c4ad1ee7b910153f36b6b765e9f8e1435ffc952 100644 (file)
@@ -48,6 +48,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "alloc-pool.h"
 #include "symbol-summary.h"
 #include "ipa-utils.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 // Construct a fur_source, and set the m_query field.
 
index e85477df32d0ba2a124f1f4ca2cb85c4a1c5d6e9..2a1da631e9cad81aafa4a1ff2e3019991669eaaf 100644 (file)
@@ -109,6 +109,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-expr.h"
 #include "gimple.h"
 #include "predict.h"
+#include "sreal.h"
 #include "alloc-pool.h"
 #include "tree-pass.h"
 #include "cgraph.h"
@@ -118,6 +119,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-fold.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "tree-pretty-print.h"
 #include "tree-inline.h"
@@ -130,274 +132,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "symtab-clones.h"
 #include "gimple-range.h"
 
-template <typename valtype> class ipcp_value;
-
-/* Describes a particular source for an IPA-CP value.  */
-
-template <typename valtype>
-struct ipcp_value_source
-{
-public:
-  /* Aggregate offset of the source, negative if the source is scalar value of
-     the argument itself.  */
-  HOST_WIDE_INT offset;
-  /* The incoming edge that brought the value.  */
-  cgraph_edge *cs;
-  /* If the jump function that resulted into his value was a pass-through or an
-     ancestor, this is the ipcp_value of the caller from which the described
-     value has been derived.  Otherwise it is NULL.  */
-  ipcp_value<valtype> *val;
-  /* Next pointer in a linked list of sources of a value.  */
-  ipcp_value_source *next;
-  /* If the jump function that resulted into his value was a pass-through or an
-     ancestor, this is the index of the parameter of the caller the jump
-     function references.  */
-  int index;
-};
-
-/* Common ancestor for all ipcp_value instantiations.  */
-
-class ipcp_value_base
-{
-public:
-  /* Time benefit and that specializing the function for this value would bring
-     about in this function alone.  */
-  sreal local_time_benefit;
-  /* Time benefit that specializing the function for this value can bring about
-     in it's callees.  */
-  sreal prop_time_benefit;
-  /* Size cost that specializing the function for this value would bring about
-     in this function alone.  */
-  int local_size_cost;
-  /* Size cost that specializing the function for this value can bring about in
-     it's callees.  */
-  int prop_size_cost;
-
-  ipcp_value_base ()
-    : local_time_benefit (0), prop_time_benefit (0),
-      local_size_cost (0), prop_size_cost (0) {}
-};
-
-/* Describes one particular value stored in struct ipcp_lattice.  */
-
-template <typename valtype>
-class ipcp_value : public ipcp_value_base
-{
-public:
-  /* The actual value for the given parameter.  */
-  valtype value;
-  /* The list of sources from which this value originates.  */
-  ipcp_value_source <valtype> *sources = nullptr;
-  /* Next pointers in a linked list of all values in a lattice.  */
-  ipcp_value *next = nullptr;
-  /* Next pointers in a linked list of values in a strongly connected component
-     of values. */
-  ipcp_value *scc_next = nullptr;
-  /* Next pointers in a linked list of SCCs of values sorted topologically
-     according their sources.  */
-  ipcp_value  *topo_next = nullptr;
-  /* A specialized node created for this value, NULL if none has been (so far)
-     created.  */
-  cgraph_node *spec_node = nullptr;
-  /* Depth first search number and low link for topological sorting of
-     values.  */
-  int dfs = 0;
-  int low_link = 0;
-  /* SCC number to identify values which recursively feed into each other.
-     Values in the same SCC have the same SCC number.  */
-  int scc_no = 0;
-  /* Non zero if the value is generated from another value in the same lattice
-     for a self-recursive call, the actual number is how many times the
-     operation has been performed.  In the unlikely event of the value being
-     present in two chains fo self-recursive value generation chains, it is the
-     maximum.  */
-  unsigned self_recursion_generated_level = 0;
-  /* True if this value is currently on the topo-sort stack.  */
-  bool on_stack = false;
-
-  void add_source (cgraph_edge *cs, ipcp_value *src_val, int src_idx,
-                  HOST_WIDE_INT offset);
-
-  /* Return true if both THIS value and O feed into each other.  */
-
-  bool same_scc (const ipcp_value<valtype> *o)
-  {
-    return o->scc_no == scc_no;
-  }
-
-/* Return true, if a this value has been generated for a self-recursive call as
-   a result of an arithmetic pass-through jump-function acting on a value in
-   the same lattice function.  */
-
-  bool self_recursion_generated_p ()
-  {
-    return self_recursion_generated_level > 0;
-  }
-};
-
-/* Lattice describing potential values of a formal parameter of a function, or
-   a part of an aggregate.  TOP is represented by a lattice with zero values
-   and with contains_variable and bottom flags cleared.  BOTTOM is represented
-   by a lattice with the bottom flag set.  In that case, values and
-   contains_variable flag should be disregarded.  */
-
-template <typename valtype>
-struct ipcp_lattice
-{
-public:
-  /* The list of known values and types in this lattice.  Note that values are
-     not deallocated if a lattice is set to bottom because there may be value
-     sources referencing them.  */
-  ipcp_value<valtype> *values;
-  /* Number of known values and types in this lattice.  */
-  int values_count;
-  /* The lattice contains a variable component (in addition to values).  */
-  bool contains_variable;
-  /* The value of the lattice is bottom (i.e. variable and unusable for any
-     propagation).  */
-  bool bottom;
-
-  inline bool is_single_const ();
-  inline bool set_to_bottom ();
-  inline bool set_contains_variable ();
-  bool add_value (valtype newval, cgraph_edge *cs,
-                 ipcp_value<valtype> *src_val = NULL,
-                 int src_idx = 0, HOST_WIDE_INT offset = -1,
-                 ipcp_value<valtype> **val_p = NULL,
-                 unsigned same_lat_gen_level = 0);
-  void print (FILE * f, bool dump_sources, bool dump_benefits);
-};
-
-/* Lattice of tree values with an offset to describe a part of an
-   aggregate.  */
-
-struct ipcp_agg_lattice : public ipcp_lattice<tree>
-{
-public:
-  /* Offset that is being described by this lattice. */
-  HOST_WIDE_INT offset;
-  /* Size so that we don't have to re-compute it every time we traverse the
-     list.  Must correspond to TYPE_SIZE of all lat values.  */
-  HOST_WIDE_INT size;
-  /* Next element of the linked list.  */
-  struct ipcp_agg_lattice *next;
-};
-
-/* Lattice of known bits, only capable of holding one value.
-   Bitwise constant propagation propagates which bits of a
-   value are constant.
-   For eg:
-   int f(int x)
-   {
-     return some_op (x);
-   }
-
-   int f1(int y)
-   {
-     if (cond)
-      return f (y & 0xff);
-     else
-      return f (y & 0xf);
-   }
-
-   In the above case, the param 'x' will always have all
-   the bits (except the bits in lsb) set to 0.
-   Hence the mask of 'x' would be 0xff. The mask
-   reflects that the bits in lsb are unknown.
-   The actual propagated value is given by m_value & ~m_mask.  */
-
-class ipcp_bits_lattice
-{
-public:
-  bool bottom_p () const { return m_lattice_val == IPA_BITS_VARYING; }
-  bool top_p () const { return m_lattice_val == IPA_BITS_UNDEFINED; }
-  bool constant_p () const { return m_lattice_val == IPA_BITS_CONSTANT; }
-  bool set_to_bottom ();
-  bool set_to_constant (widest_int, widest_int);
-  bool known_nonzero_p () const;
-
-  widest_int get_value () const { return m_value; }
-  widest_int get_mask () const { return m_mask; }
-
-  bool meet_with (ipcp_bits_lattice& other, unsigned, signop,
-                 enum tree_code, tree, bool);
-
-  bool meet_with (widest_int, widest_int, unsigned);
-
-  void print (FILE *);
-
-private:
-  enum { IPA_BITS_UNDEFINED, IPA_BITS_CONSTANT, IPA_BITS_VARYING } m_lattice_val;
-
-  /* Similar to ccp_lattice_t, mask represents which bits of value are constant.
-     If a bit in mask is set to 0, then the corresponding bit in
-     value is known to be constant.  */
-  widest_int m_value, m_mask;
-
-  bool meet_with_1 (widest_int, widest_int, unsigned, bool);
-  void get_value_and_mask (tree, widest_int *, widest_int *);
-};
-
-/* Lattice of value ranges.  */
-
-class ipcp_vr_lattice
-{
-public:
-  Value_Range m_vr;
-
-  inline bool bottom_p () const;
-  inline bool top_p () const;
-  inline bool set_to_bottom ();
-  bool meet_with (const vrange &p_vr);
-  bool meet_with (const ipcp_vr_lattice &other);
-  void init (tree type);
-  void print (FILE * f);
-
-private:
-  bool meet_with_1 (const vrange &other_vr);
-};
-
-inline void
-ipcp_vr_lattice::init (tree type)
-{
-  if (type)
-    m_vr.set_type (type);
-
-  // Otherwise m_vr will default to unsupported_range.
-}
-
-/* Structure containing lattices for a parameter itself and for pieces of
-   aggregates that are passed in the parameter or by a reference in a parameter
-   plus some other useful flags.  */
-
-class ipcp_param_lattices
-{
-public:
-  /* Lattice describing the value of the parameter itself.  */
-  ipcp_lattice<tree> itself;
-  /* Lattice describing the polymorphic contexts of a parameter.  */
-  ipcp_lattice<ipa_polymorphic_call_context> ctxlat;
-  /* Lattices describing aggregate parts.  */
-  ipcp_agg_lattice *aggs;
-  /* Lattice describing known bits.  */
-  ipcp_bits_lattice bits_lattice;
-  /* Lattice describing value range.  */
-  ipcp_vr_lattice m_value_range;
-  /* Number of aggregate lattices */
-  int aggs_count;
-  /* True if aggregate data were passed by reference (as opposed to by
-     value).  */
-  bool aggs_by_ref;
-  /* All aggregate lattices contain a variable component (in addition to
-     values).  */
-  bool aggs_contain_variable;
-  /* The value of all aggregate lattices is bottom (i.e. variable and unusable
-     for any propagation).  */
-  bool aggs_bottom;
-
-  /* There is a virtual call based on this parameter.  */
-  bool virt_call;
-};
 
 /* Allocation pools for values and their sources in ipa-cp.  */
 
@@ -431,7 +165,6 @@ ipa_get_parm_lattices (class ipa_node_params *info, int i)
 {
   gcc_assert (i >= 0 && i < ipa_get_param_count (info));
   gcc_checking_assert (!info->ipcp_orig_node);
-  gcc_checking_assert (info->lattices);
   return &(info->lattices[i]);
 }
 
@@ -1821,7 +1554,7 @@ ipa_value_from_jfunc (class ipa_node_params *info, struct ipa_jump_func *jfunc,
        {
          ipcp_lattice<tree> *lat;
 
-         if (!info->lattices
+         if (info->lattices.is_empty ()
              || idx >= ipa_get_param_count (info))
            return NULL_TREE;
          lat = ipa_get_scalar_lat (info, idx);
@@ -1884,7 +1617,7 @@ ipa_context_from_jfunc (ipa_node_params *info, cgraph_edge *cs, int csidx,
        }
       else
        {
-         if (!info->lattices
+         if (info->lattices.is_empty ()
              || srcidx >= ipa_get_param_count (info))
            return ctx;
          ipcp_lattice<ipa_polymorphic_call_context> *lat;
@@ -2056,7 +1789,7 @@ ipa_agg_value_from_jfunc (ipa_node_params *info, cgraph_node *node,
                                 item->value.load_agg.by_ref);
        }
     }
-  else if (info->lattices)
+  else if (!info->lattices.is_empty ())
     {
       class ipcp_param_lattices *src_plats
        = ipa_get_parm_lattices (info, src_idx);
@@ -2937,7 +2670,6 @@ merge_agg_lats_step (class ipcp_param_lattices *dest_plats,
        return false;
       dest_plats->aggs_count++;
       new_al = ipcp_agg_lattice_pool.allocate ();
-      memset (new_al, 0, sizeof (*new_al));
 
       new_al->offset = offset;
       new_al->size = val_size;
@@ -4295,8 +4027,7 @@ ipcp_propagate_stage (class ipa_topo_info *topo)
         determine_versionability (node, info);
 
        unsigned nlattices = ipa_get_param_count (info);
-       void *chunk = XCNEWVEC (class ipcp_param_lattices, nlattices);
-       info->lattices = new (chunk) ipcp_param_lattices[nlattices];
+       info->lattices.safe_grow_cleared (nlattices, true);
        initialize_node_lattices (node);
       }
     ipa_size_summary *s = ipa_size_summaries->get (node);
@@ -6568,7 +6299,7 @@ ipcp_store_vr_results (void)
 
       if (info->ipcp_orig_node)
        info = ipa_node_params_sum->get (info->ipcp_orig_node);
-      if (!info->lattices)
+      if (info->lattices.is_empty ())
        /* Newly expanded artificial thunks do not have lattices.  */
        continue;
 
diff --git a/gcc/ipa-cp.h b/gcc/ipa-cp.h
new file mode 100644 (file)
index 0000000..0b3cfe4
--- /dev/null
@@ -0,0 +1,292 @@
+/* Interprocedural constant propagation
+   Copyright (C) 2024 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 3, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING3.  If not see
+<http://www.gnu.org/licenses/>.  */
+
+#ifndef IPA_CP_H
+#define IPA_CP_H
+
+template <typename valtype> class ipcp_value;
+
+/* Describes a particular source for an IPA-CP value.  */
+
+template <typename valtype>
+struct ipcp_value_source
+{
+public:
+  /* Aggregate offset of the source, negative if the source is scalar value of
+     the argument itself.  */
+  HOST_WIDE_INT offset;
+  /* The incoming edge that brought the value.  */
+  cgraph_edge *cs;
+  /* If the jump function that resulted into his value was a pass-through or an
+     ancestor, this is the ipcp_value of the caller from which the described
+     value has been derived.  Otherwise it is NULL.  */
+  ipcp_value<valtype> *val;
+  /* Next pointer in a linked list of sources of a value.  */
+  ipcp_value_source *next;
+  /* If the jump function that resulted into his value was a pass-through or an
+     ancestor, this is the index of the parameter of the caller the jump
+     function references.  */
+  int index;
+};
+
+/* Common ancestor for all ipcp_value instantiations.  */
+
+class ipcp_value_base
+{
+public:
+  /* Time benefit and that specializing the function for this value would bring
+     about in this function alone.  */
+  sreal local_time_benefit = 0;
+  /* Time benefit that specializing the function for this value can bring about
+     in it's callees.  */
+  sreal prop_time_benefit = 0;
+  /* Size cost that specializing the function for this value would bring about
+     in this function alone.  */
+  int local_size_cost = 0;
+  /* Size cost that specializing the function for this value can bring about in
+     it's callees.  */
+  int prop_size_cost = 0;
+};
+
+/* Describes one particular value stored in struct ipcp_lattice.  */
+
+template <typename valtype>
+class ipcp_value : public ipcp_value_base
+{
+public:
+  /* The actual value for the given parameter.  */
+  valtype value;
+  /* The list of sources from which this value originates.  */
+  ipcp_value_source <valtype> *sources = nullptr;
+  /* Next pointers in a linked list of all values in a lattice.  */
+  ipcp_value *next = nullptr;
+  /* Next pointers in a linked list of values in a strongly connected component
+     of values. */
+  ipcp_value *scc_next = nullptr;
+  /* Next pointers in a linked list of SCCs of values sorted topologically
+     according their sources.  */
+  ipcp_value  *topo_next = nullptr;
+  /* A specialized node created for this value, NULL if none has been (so far)
+     created.  */
+  cgraph_node *spec_node = nullptr;
+  /* Depth first search number and low link for topological sorting of
+     values.  */
+  int dfs = 0;
+  int low_link = 0;
+  /* SCC number to identify values which recursively feed into each other.
+     Values in the same SCC have the same SCC number.  */
+  int scc_no = 0;
+  /* Non zero if the value is generated from another value in the same lattice
+     for a self-recursive call, the actual number is how many times the
+     operation has been performed.  In the unlikely event of the value being
+     present in two chains fo self-recursive value generation chains, it is the
+     maximum.  */
+  unsigned self_recursion_generated_level = 0;
+  /* True if this value is currently on the topo-sort stack.  */
+  bool on_stack = false;
+
+  void add_source (cgraph_edge *cs, ipcp_value *src_val, int src_idx,
+                  HOST_WIDE_INT offset);
+
+  /* Return true if both THIS value and O feed into each other.  */
+
+  bool same_scc (const ipcp_value<valtype> *o)
+  {
+    return o->scc_no == scc_no;
+  }
+
+/* Return true, if a this value has been generated for a self-recursive call as
+   a result of an arithmetic pass-through jump-function acting on a value in
+   the same lattice function.  */
+
+  bool self_recursion_generated_p ()
+  {
+    return self_recursion_generated_level > 0;
+  }
+};
+
+/* Lattice describing potential values of a formal parameter of a function, or
+   a part of an aggregate.  TOP is represented by a lattice with zero values
+   and with contains_variable and bottom flags cleared.  BOTTOM is represented
+   by a lattice with the bottom flag set.  In that case, values and
+   contains_variable flag should be disregarded.  */
+
+template <typename valtype>
+struct ipcp_lattice
+{
+public:
+  /* The list of known values and types in this lattice.  Note that values are
+     not deallocated if a lattice is set to bottom because there may be value
+     sources referencing them.  */
+  ipcp_value<valtype> *values = nullptr;
+  /* Number of known values and types in this lattice.  */
+  int values_count = 0;
+  /* The lattice contains a variable component (in addition to values).  */
+  bool contains_variable = false;
+  /* The value of the lattice is bottom (i.e. variable and unusable for any
+     propagation).  */
+  bool bottom = false;
+
+  inline bool is_single_const ();
+  inline bool set_to_bottom ();
+  inline bool set_contains_variable ();
+  bool add_value (valtype newval, cgraph_edge *cs,
+                 ipcp_value<valtype> *src_val = NULL,
+                 int src_idx = 0, HOST_WIDE_INT offset = -1,
+                 ipcp_value<valtype> **val_p = NULL,
+                 unsigned same_lat_gen_level = 0);
+  void print (FILE * f, bool dump_sources, bool dump_benefits);
+};
+
+/* Lattice of tree values with an offset to describe a part of an
+   aggregate.  */
+
+struct ipcp_agg_lattice : public ipcp_lattice<tree>
+{
+public:
+  /* Offset that is being described by this lattice. */
+  HOST_WIDE_INT offset = 0;
+  /* Size so that we don't have to re-compute it every time we traverse the
+     list.  Must correspond to TYPE_SIZE of all lat values.  */
+  HOST_WIDE_INT size = 0;
+  /* Next element of the linked list.  */
+  struct ipcp_agg_lattice *next = nullptr;
+};
+
+/* Lattice of known bits, only capable of holding one value.
+   Bitwise constant propagation propagates which bits of a
+   value are constant.
+   For eg:
+   int f(int x)
+   {
+     return some_op (x);
+   }
+
+   int f1(int y)
+   {
+     if (cond)
+      return f (y & 0xff);
+     else
+      return f (y & 0xf);
+   }
+
+   In the above case, the param 'x' will always have all
+   the bits (except the bits in lsb) set to 0.
+   Hence the mask of 'x' would be 0xff. The mask
+   reflects that the bits in lsb are unknown.
+   The actual propagated value is given by m_value & ~m_mask.  */
+
+class ipcp_bits_lattice
+{
+public:
+  bool bottom_p () const { return m_lattice_val == IPA_BITS_VARYING; }
+  bool top_p () const { return m_lattice_val == IPA_BITS_UNDEFINED; }
+  bool constant_p () const { return m_lattice_val == IPA_BITS_CONSTANT; }
+  bool set_to_bottom ();
+  bool set_to_constant (widest_int, widest_int);
+  bool known_nonzero_p () const;
+
+  widest_int get_value () const { return m_value; }
+  widest_int get_mask () const { return m_mask; }
+
+  bool meet_with (ipcp_bits_lattice& other, unsigned, signop,
+                 enum tree_code, tree, bool);
+
+  bool meet_with (widest_int, widest_int, unsigned);
+
+  void print (FILE *);
+
+private:
+  enum { IPA_BITS_UNDEFINED, IPA_BITS_CONSTANT, IPA_BITS_VARYING }
+    m_lattice_val = IPA_BITS_UNDEFINED;
+
+  /* Similar to ccp_lattice_t, mask represents which bits of value are constant.
+     If a bit in mask is set to 0, then the corresponding bit in
+     value is known to be constant.  */
+  widest_int m_value, m_mask;
+
+  bool meet_with_1 (widest_int, widest_int, unsigned, bool);
+  void get_value_and_mask (tree, widest_int *, widest_int *);
+};
+
+/* Lattice of value ranges.  */
+
+class ipcp_vr_lattice
+{
+public:
+  Value_Range m_vr;
+
+  inline bool bottom_p () const;
+  inline bool top_p () const;
+  inline bool set_to_bottom ();
+  bool meet_with (const vrange &p_vr);
+  bool meet_with (const ipcp_vr_lattice &other);
+  void init (tree type);
+  void print (FILE * f);
+
+private:
+  bool meet_with_1 (const vrange &other_vr);
+};
+
+inline void
+ipcp_vr_lattice::init (tree type)
+{
+  if (type)
+    m_vr.set_type (type);
+
+  // Otherwise m_vr will default to unsupported_range.
+}
+
+/* Structure containing lattices for a parameter itself and for pieces of
+   aggregates that are passed in the parameter or by a reference in a parameter
+   plus some other useful flags.
+
+   Even after construction, m_value_range parts still need to be initialized
+   with the type they represent with the init method.  */
+
+class ipcp_param_lattices
+{
+public:
+  /* Lattice describing the value of the parameter itself.  */
+  ipcp_lattice<tree> itself;
+  /* Lattice describing the polymorphic contexts of a parameter.  */
+  ipcp_lattice<ipa_polymorphic_call_context> ctxlat;
+  /* Lattices describing aggregate parts.  */
+  ipcp_agg_lattice *aggs = nullptr;
+  /* Lattice describing known bits.  */
+  ipcp_bits_lattice bits_lattice;
+  /* Lattice describing value range.  */
+  ipcp_vr_lattice m_value_range;
+  /* Number of aggregate lattices */
+  int aggs_count = 0;
+  /* True if aggregate data were passed by reference (as opposed to by
+     value).  */
+  bool aggs_by_ref = false;
+  /* All aggregate lattices contain a variable component (in addition to
+     values).  */
+  bool aggs_contain_variable = false;
+  /* The value of all aggregate lattices is bottom (i.e. variable and unusable
+     for any propagation).  */
+  bool aggs_bottom = false;
+
+  /* There is a virtual call based on this parameter.  */
+  bool virt_call = false;
+};
+
+#endif /* IPA_CP_H */
index caf8548fbc9e293b9f510213f6fba028c835736e..a7ce434bffb475e9b31e4be1c8d55a5c6476cdfb 100644 (file)
@@ -124,6 +124,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-fold.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "demangle.h"
index 74c9b4e1d1e5676f33162dee373a104fc11b5887..dff40cd8aa518808b14391a003f64b0fb4cdc60f 100644 (file)
@@ -75,6 +75,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-loop-niter.h"
 #include "tree-ssa-loop.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "cfgloop.h"
index f56891325f3df4242f5f371a7c53efb52eefc82a..5d5a42f9c6c9f7308f8bc8eaf8bfb98630b88d36 100644 (file)
@@ -73,6 +73,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimple-iterator.h"
 #include "tree-cfg.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "except.h"
index 24ac4cbafc02b82d0b7aa917208558ae5e0cc334..a190cb6501b8be650fe6b694add4b040de10f879 100644 (file)
@@ -40,6 +40,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-loop-niter.h"
 #include "tree-ssa-loop.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "ipa-inline.h"
index a05631a085ddd8109d51a53006661196564be1af..73ae4e68ef3bdb3491f7b9d53545f9def2352e2d 100644 (file)
@@ -40,6 +40,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-cfg.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "ipa-inline.h"
index be2ca58c7dd14c96809c543df44a8e72fbd8e232..cc509b0c4a4ea9c37620b39fa23b7d305a76a3cf 100644 (file)
@@ -108,11 +108,12 @@ along with GCC; see the file COPYING3.  If not see
 #include "profile.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "ipa-inline.h"
 #include "ipa-utils.h"
-#include "sreal.h"
 #include "auto-profile.h"
 #include "builtins.h"
 #include "fibonacci_heap.h"
index cec730dfa4b2903fd5e061d75efe5f46a72f3b9d..a5adce8ea396ac6313e35a5cc918eaa4ed252af0 100644 (file)
@@ -75,6 +75,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-modref-tree.h"
 #include "ipa-modref.h"
 #include "value-range.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "attr-fnspec.h"
index 02f71a42237e1d1ad79be05c6d8d4da743ad1d39..3e0df6a6f77a6187fdaf1b92bc841bc6247a10fd 100644 (file)
@@ -47,6 +47,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-phinodes.h"
 #include "cfgexpand.h"
 #include "attribs.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 
 /* Actual prefixes of different newly synthetized parameters.  Keep in sync
index d3b3227b0feb17f13bb2b9e15a5e2ee5cffec03f..164aba4a126635da8b3d9353f8fa98f2b439c05a 100644 (file)
@@ -27,6 +27,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-vrp.h"
 #include "alloc-pool.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "real.h"
index 5e89f677c3e6fcbb7801612b08264bc1cdfe3bb7..27f411ce81a0de9653a3bbce0522ecfc6a5bbdbe 100644 (file)
@@ -55,6 +55,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-inline.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 
index bec0ebd210cfd4a3686dcce1edfd575c4f3681ab..e22c4f78405d290b48a43cd5cdd49ce47a7fe8a2 100644 (file)
@@ -41,6 +41,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimplify-me.h"
 #include "gimple-walk.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "tree-cfg.h"
 #include "tree-dfa.h"
@@ -4561,7 +4563,7 @@ ipa_node_params_t::duplicate(cgraph_node *, cgraph_node *,
                             ipa_node_params *new_info)
 {
   new_info->descriptors = vec_safe_copy (old_info->descriptors);
-  new_info->lattices = NULL;
+  gcc_assert (new_info->lattices.is_empty ());
   new_info->ipcp_orig_node = old_info->ipcp_orig_node;
   new_info->known_csts = old_info->known_csts.copy ();
   new_info->known_contexts = old_info->known_contexts.copy ();
index 9c78dc9f486017748d426d888cac020e51d1a060..ee3c0006add9755055d55d25ace8ab2bcc842fb2 100644 (file)
@@ -627,7 +627,7 @@ public:
   vec<ipa_param_descriptor, va_gc> *descriptors;
   /* Pointer to an array of structures describing individual formal
      parameters.  */
-  class ipcp_param_lattices * GTY((skip)) lattices;
+  vec<ipcp_param_lattices> GTY((skip)) lattices;
   /* Only for versioned nodes this field would not be NULL,
      it points to the node that IPA cp cloned from.  */
   struct cgraph_node * GTY((skip)) ipcp_orig_node;
@@ -662,7 +662,7 @@ public:
 
 inline
 ipa_node_params::ipa_node_params ()
-: descriptors (NULL), lattices (NULL), ipcp_orig_node (NULL),
+: descriptors (NULL), lattices (vNULL), ipcp_orig_node (NULL),
   known_csts (vNULL), known_contexts (vNULL), analysis_done (0),
   node_enqueued (0), do_clone_for_all_contexts (0), is_all_contexts_clone (0),
   node_dead (0), node_within_scc (0), node_is_self_scc (0),
@@ -673,8 +673,8 @@ ipa_node_params::ipa_node_params ()
 inline
 ipa_node_params::~ipa_node_params ()
 {
-  free (lattices);
   vec_free (descriptors);
+  lattices.release ();
   known_csts.release ();
   known_contexts.release ();
 }
index 7e9ece21b2298468014eafbc97bd42588713b359..d285462b6cf147f4bc173e236f1bf1e5f9eda006 100644 (file)
@@ -59,6 +59,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "ssa.h"
 #include "alloc-pool.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "symtab-thunks.h"
index 8e6aa018a7d4163898cc7b1bd66c5fc342d15780..39ad822608b2c62eb9ae0f36449f9c7891af0722 100644 (file)
@@ -95,6 +95,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "gimplify-me.h"
 #include "gimple-walk.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "tree-cfg.h"
 #include "tree-into-ssa.h"
index 14c2a344e6d82606b52be0df2114c1f08c265782..6d6da408925161705508d46e1ba163a9ba956c41 100644 (file)
@@ -84,6 +84,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "internal-fn.h"
 #include "symtab-clones.h"
 #include "attribs.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 
 static void ipa_sra_summarize_function (cgraph_node *);
index 0ee063c9eddc442c0db53ca10934669068ed32d8..09db1e04431939be0cff940159b8f09e7b363256 100644 (file)
@@ -43,6 +43,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "alloc-pool.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "gimple-fold.h"
index 1567874882fd92b3a835f38537c381b93a4246aa..3be0ddb8e966022b4b416db707d0c8e037c0fc65 100644 (file)
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-utils.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "tree-eh.h"
index 82d8c59d660be5d2507a6b98a63f1ef02f307a1d..c453fca5d9b68d65206e4c20985c1e659df31ea8 100644 (file)
@@ -33,6 +33,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-utils.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "dbgcnt.h"
index e54ddf2ca4103ed20d79c246ddfd2d6839e5a00b..2ce94cc32828ca0073e8501a581c113f6f2c4143 100644 (file)
@@ -37,6 +37,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "stor-layout.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "common.h"
 #include "debug.h"
index 7165747d57ef1ce81633aade9d1474d292cbab4d..19f91e5d6607b7e5662d6e0137db85c80e8f8fed 100644 (file)
@@ -31,10 +31,11 @@ along with GCC; see the file COPYING3.  If not see
 #include "lto-streamer.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-fnsummary.h"
 #include "lto-partition.h"
-#include "sreal.h"
 
 vec<ltrans_partition> ltrans_partitions;
 
index f7c0623f6b2ac58e0307c1b6ac1e5dca039623d2..91aa2fbddb4e66d7e8f1139018ecec3266f121f3 100644 (file)
@@ -38,6 +38,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "stor-layout.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "debug.h"
 #include "lto.h"
index 175d4cd18fa7d7e72fb156ed8c86a25851f4c087..2cd4096558e4ac5d51e66108194d8ddf14fddf03 100644 (file)
@@ -74,6 +74,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "ipa-reference.h"
 #include "symbol-summary.h"
 #include "tree-vrp.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "ipa-utils.h"
 #include "gcse.h"
index ad3b9b87c9d657ed3e79d17ccb42701da4d627ad..f6a5cd0ee6e0b929fab9d075d30dbaac766faf6a 100644 (file)
@@ -150,6 +150,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "alloc-pool.h"
 #include "symbol-summary.h"
 #include "ipa-utils.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "internal-fn.h"
 
index 38b806649cd92ffad8bfcbe553167c85228a958a..3e93685e80a6a2271cf7166cc610e217a045b77c 100644 (file)
@@ -76,6 +76,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-ssa-sccvn.h"
 #include "alloc-pool.h"
 #include "symbol-summary.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "target.h"
 
index 978025b51de62833a9ab25cae4f1176eb54ea9a4..b0f21e3aa60da0d9e4efd16a0acf1aaa41beeae4 100644 (file)
@@ -56,6 +56,8 @@ along with GCC; see the file COPYING3.  If not see
 #include "cgraph.h"
 #include "symbol-summary.h"
 #include "ipa-utils.h"
+#include "sreal.h"
+#include "ipa-cp.h"
 #include "ipa-prop.h"
 #include "attribs.h"