tree-core.h (enum tree_index): Add TI_CHREC_DONT_KNOW and TI_CHREC_KNOWN.
authorRichard Biener <rguenther@suse.de>
Tue, 2 Jul 2019 09:35:12 +0000 (09:35 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 2 Jul 2019 09:35:12 +0000 (09:35 +0000)
2019-07-02  Richard Biener  <rguenther@suse.de>

* tree-core.h (enum tree_index): Add TI_CHREC_DONT_KNOW and
TI_CHREC_KNOWN.
* tree.h (chrec_not_analyzed_yet, chrec_dont_know, chrec_known):
Define here.
* tree.c (build_common_tree_nodes): Initialize them.
* tree-chrec.h (chrec_not_analyzed_yet, chrec_dont_know, chrec_known):
Make declarations comments.
* tree-scalar-evolution.c (chrec_not_analyzed_yet, chrec_dont_know,
chrec_known): Remove definitions.
(initialize_scalar_evolutions_analyzer): Remove.
(scev_initialize): Do not call initialize_scalar_evolutions_analyzer.
* tree-streamer.c (preload_common_nodes): Do not preload
TI_CHREC_DONT_KNOW or TI_CHREC_KNOWN.

From-SVN: r272928

gcc/ChangeLog
gcc/tree-chrec.h
gcc/tree-core.h
gcc/tree-scalar-evolution.c
gcc/tree-streamer.c
gcc/tree.c
gcc/tree.h

index 48ac980fa455223335744244fb63b419210bbd8c..a19368c348b6628fa129d289218b4b7ef8ae2dd5 100644 (file)
@@ -1,3 +1,19 @@
+2019-07-02  Richard Biener  <rguenther@suse.de>
+
+       * tree-core.h (enum tree_index): Add TI_CHREC_DONT_KNOW and
+       TI_CHREC_KNOWN.
+       * tree.h (chrec_not_analyzed_yet, chrec_dont_know, chrec_known):
+       Define here.
+       * tree.c (build_common_tree_nodes): Initialize them.
+       * tree-chrec.h (chrec_not_analyzed_yet, chrec_dont_know, chrec_known):
+       Make declarations comments.
+       * tree-scalar-evolution.c (chrec_not_analyzed_yet, chrec_dont_know,
+       chrec_known): Remove definitions.
+       (initialize_scalar_evolutions_analyzer): Remove.
+       (scev_initialize): Do not call initialize_scalar_evolutions_analyzer.
+       * tree-streamer.c (preload_common_nodes): Do not preload
+       TI_CHREC_DONT_KNOW or TI_CHREC_KNOWN.
+
 2019-07-02  Jan Hubicka  <jh@suse.cz>
 
        * tree-ssa-alias.c (aliasing_component_refs_p): Remove forgotten
index dbbc1b182ac3d40504b1aeb6199b1f5b476def30..3b5c090ef93a5ba963ee39c1ae3e1df0db41dac1 100644 (file)
@@ -23,11 +23,14 @@ along with GCC; see the file COPYING3.  If not see
 
 /* The following trees are unique elements.  Thus the comparison of another
    element to these elements should be done on the pointer to these trees,
-   and not on their value.  */
+   and not on their value.
 
-extern tree chrec_not_analyzed_yet;
-extern GTY(()) tree chrec_dont_know;
-extern GTY(()) tree chrec_known;
+   extern tree chrec_not_analyzed_yet;
+   extern tree chrec_dont_know;
+   extern tree chrec_known;
+
+   chrec_not_analyzed_yet is NULL_TREE and the others are defined
+   in global_trees[].  */
 
 /* After having added an automatically generated element, please
    include it in the following function.  */
index 23f8f01317e68f11aad55e3759df5d7f2176a2c8..8ac1978b93af002c81f751874f3414f5ba985d4b 100644 (file)
@@ -758,6 +758,9 @@ enum tree_index {
   TI_CURRENT_TARGET_PRAGMA,
   TI_CURRENT_OPTIMIZE_PRAGMA,
 
+  TI_CHREC_DONT_KNOW,
+  TI_CHREC_KNOWN,
+
   TI_MAX
 };
 
index 0bda94ab325bd0388e663e9b3841f364d5ede2af..81f70f193d9938b58b4dc2e82f4a14f4aca0ae13 100644 (file)
@@ -304,21 +304,6 @@ struct GTY((for_user)) scev_info_str {
 static unsigned nb_set_scev = 0;
 static unsigned nb_get_scev = 0;
 
-/* The following trees are unique elements.  Thus the comparison of
-   another element to these elements should be done on the pointer to
-   these trees, and not on their value.  */
-
-/* The SSA_NAMEs that are not yet analyzed are qualified with NULL_TREE.  */
-tree chrec_not_analyzed_yet;
-
-/* Reserved to the cases where the analyzer has detected an
-   undecidable property at compile time.  */
-tree chrec_dont_know;
-
-/* When the analyzer has detected that a property will never
-   happen, then it qualifies it with chrec_known.  */
-tree chrec_known;
-
 struct scev_info_hasher : ggc_ptr_hash<scev_info_str>
 {
   static hashval_t hash (scev_info_str *i);
@@ -3056,23 +3041,6 @@ gather_stats_on_scev_database (void)
 }
 
 \f
-
-/* Initializer.  */
-
-static void
-initialize_scalar_evolutions_analyzer (void)
-{
-  /* The elements below are unique.  */
-  if (chrec_dont_know == NULL_TREE)
-    {
-      chrec_not_analyzed_yet = NULL_TREE;
-      chrec_dont_know = make_node (SCEV_NOT_KNOWN);
-      chrec_known = make_node (SCEV_KNOWN);
-      TREE_TYPE (chrec_dont_know) = void_type_node;
-      TREE_TYPE (chrec_known) = void_type_node;
-    }
-}
-
 /* Initialize the analysis of scalar evolutions for LOOPS.  */
 
 void
@@ -3084,8 +3052,6 @@ scev_initialize (void)
 
   scalar_evolution_info = hash_table<scev_info_hasher>::create_ggc (100);
 
-  initialize_scalar_evolutions_analyzer ();
-
   FOR_EACH_LOOP (loop, 0)
     {
       loop->nb_iterations = NULL_TREE;
index b7bd276a397803d8dd3feb6fc29d1b885a1473d9..fb2888de66537e61928aa66d0d4d92f87e78bb25 100644 (file)
@@ -377,6 +377,9 @@ preload_common_nodes (struct streamer_tree_cache_d *cache)
        && i != TI_TARGET_OPTION_CURRENT
        && i != TI_CURRENT_TARGET_PRAGMA
        && i != TI_CURRENT_OPTIMIZE_PRAGMA
+       /* SCEV state shouldn't reach the IL.  */
+       && i != TI_CHREC_DONT_KNOW
+       && i != TI_CHREC_KNOWN
        /* Skip va_list* related nodes if offloading.  For native LTO
           we want them to be merged for the stdarg pass, for offloading
           they might not be identical between host and offloading target.  */
index 34912583bba4ebee064a9fb4349465d05abde6c2..f2c779f1fe5b08ad5305833a91b29a9c0c01dc26 100644 (file)
@@ -10641,6 +10641,12 @@ build_common_tree_nodes (bool signed_char)
 
     va_list_type_node = t;
   }
+
+  /* SCEV analyzer global shared trees.  */
+  chrec_dont_know = make_node (SCEV_NOT_KNOWN);
+  TREE_TYPE (chrec_dont_know) = void_type_node;
+  chrec_known = make_node (SCEV_KNOWN);
+  TREE_TYPE (chrec_known) = void_type_node;
 }
 
 /* Modify DECL for given flags.
index 1a43e6b7ff8516199acbd0f57816f9d211ae8788..ed59a5d06bf57de3283c9280420aa11039b7d89d 100644 (file)
@@ -4083,6 +4083,11 @@ tree_strip_any_location_wrapper (tree exp)
 #define current_target_pragma          global_trees[TI_CURRENT_TARGET_PRAGMA]
 #define current_optimize_pragma                global_trees[TI_CURRENT_OPTIMIZE_PRAGMA]
 
+/* SCEV analyzer global shared trees.  */
+#define chrec_not_analyzed_yet         NULL_TREE
+#define chrec_dont_know                        global_trees[TI_CHREC_DONT_KNOW]
+#define chrec_known                    global_trees[TI_CHREC_KNOWN]
+
 #define char_type_node                 integer_types[itk_char]
 #define signed_char_type_node          integer_types[itk_signed_char]
 #define unsigned_char_type_node                integer_types[itk_unsigned_char]