]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2008-07-14 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jul 2008 15:38:49 +0000 (15:38 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 14 Jul 2008 15:38:49 +0000 (15:38 +0000)
* tree-ssa-sccvn.c (pre_info): Remove.
(switch_to_PRE_table): Likewise.
(free_scc_vn): Do not clear SSA_NAME_VALUE.
Do not free pre_info.
(set_hashtable_value_ids): Do not create value-ids for the
optimistic tables.
(run_scc_vn): Remove double test.  Remove bogus special-case
in value-number printing.
* tree-ssa-sccvn.h (switch_to_PRE_table): Remove.
* tree-ssa-ccp.c (get_symbol_constant_value): Do not look at
SSA_NAME_VALUE.
* tree-flow-inline.h (get_value_handle): Remove.
* tree-flow.h (get_value_handle): Remove.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137787 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/tree-flow-inline.h
gcc/tree-flow.h
gcc/tree-ssa-ccp.c
gcc/tree-ssa-sccvn.c
gcc/tree-ssa-sccvn.h

index aa13213fc86a4ab2fc46ee13f9249e006ee1601f..c619f7ec1665a2acea8b5fdff3eba6794875f911 100644 (file)
@@ -1,3 +1,19 @@
+2008-07-14  Richard Guenther  <rguenther@suse.de>
+
+       * tree-ssa-sccvn.c (pre_info): Remove.
+       (switch_to_PRE_table): Likewise.
+       (free_scc_vn): Do not clear SSA_NAME_VALUE.
+       Do not free pre_info.
+       (set_hashtable_value_ids): Do not create value-ids for the
+       optimistic tables.
+       (run_scc_vn): Remove double test.  Remove bogus special-case
+       in value-number printing.
+       * tree-ssa-sccvn.h (switch_to_PRE_table): Remove.
+       * tree-ssa-ccp.c (get_symbol_constant_value): Do not look at
+       SSA_NAME_VALUE.
+       * tree-flow-inline.h (get_value_handle): Remove.
+       * tree-flow.h (get_value_handle): Remove.
+
 2008-07-14  Martin Jambor  <mjambor@suse.cz>
 
        * tree-switch-conversion.c (gen_inbound_check): Make sure the type
index 19a3002dfda33c5c9a1d1f6028ffdb4db264094c..1eb284047e3e83b1ef97456ff0d4eeba02a8b829 100644 (file)
@@ -1659,34 +1659,6 @@ set_symbol_mem_tag (tree sym, tree tag)
   get_var_ann (sym)->symbol_mem_tag = tag;
 }
 
-/* Get the value handle of EXPR.  This is the only correct way to get
-   the value handle for a "thing".  If EXPR does not have a value
-   handle associated, it returns NULL_TREE.  
-   NB: If EXPR is min_invariant, this function is *required* to return
-   EXPR.  */
-
-static inline tree
-get_value_handle (tree expr)
-{
-  if (TREE_CODE (expr) == SSA_NAME)
-    return SSA_NAME_VALUE (expr);
-  else if (DECL_P (expr) || TREE_CODE (expr) == TREE_LIST
-          || TREE_CODE (expr) == CONSTRUCTOR)
-    {
-      tree_ann_common_t ann = tree_common_ann (expr);
-      return ((ann) ? ann->value_handle : NULL_TREE);
-    }
-  else if (is_gimple_min_invariant (expr))
-    return expr;
-  else if (EXPR_P (expr))
-    {
-      tree_ann_common_t ann = tree_common_ann (expr);
-      return ((ann) ? ann->value_handle : NULL_TREE);
-    }
-  else
-    gcc_unreachable ();
-}
-
 /* Accessor to tree-ssa-operands.c caches.  */
 static inline struct ssa_operands *
 gimple_ssa_operands (const struct function *fun)
index 0cb8fa5d1ec9d4cf661589d67f2c1adb9b97f1d7..a441893e00412fa93782df1631524972cd83ede0 100644 (file)
@@ -1134,7 +1134,6 @@ void print_value_expressions (FILE *, unsigned int);
 tree make_value_handle (tree);
 void set_value_handle (tree, tree);
 bool expressions_equal_p (tree, tree);
-static inline tree get_value_handle (tree);
 void sort_vuses (VEC (tree, gc) *);
 void sort_vuses_heap (VEC (tree, heap) *);
 tree vn_lookup_or_add (tree);
index 3b90da4ddc8fe545b3714220fef7aa606d06f5d6..4b6fe6a1b6946ee3dfa9ee7305342f5f47eae5ef 100644 (file)
@@ -310,13 +310,10 @@ get_symbol_constant_value (tree sym)
       change the constant value of the PHI node, which allows for more
       constants to be propagated.
 
-   3- If SSA_NAME_VALUE is set and it is a constant, its value is
-      used.
-
-   4- Variables defined by statements other than assignments and PHI
+   3- Variables defined by statements other than assignments and PHI
       nodes are considered VARYING.
 
-   5- Initial values of variables that are not GIMPLE registers are
+   4- Initial values of variables that are not GIMPLE registers are
       considered VARYING.  */
 
 static prop_value_t
@@ -332,12 +329,6 @@ get_default_value (tree var)
         non-register when DO_STORE_CCP is false.  */
       val.lattice_val = VARYING;
     }
-  else if (SSA_NAME_VALUE (var)
-          && is_gimple_min_invariant (SSA_NAME_VALUE (var)))
-    {
-      val.lattice_val = CONSTANT;
-      val.value = SSA_NAME_VALUE (var);
-    }
   else if ((cst_val = get_symbol_constant_value (sym)) != NULL_TREE)
     {
       /* Globals and static variables declared 'const' take their
index 659fecdfa8aa6f411bb929eab1fc72550db2500a..f1318656b9b839bdff78b77df6c8bf3d323f830c 100644 (file)
@@ -129,11 +129,6 @@ static vn_tables_t valid_info;
 
 static vn_tables_t optimistic_info;
 
-/* PRE hashtables storing information about mapping from expressions to
-   value handles.  */
-
-static vn_tables_t pre_info;
-
 /* Pointer to the set of hashtables that is currently being used.
    Should always point to either the optimistic_info, or the
    valid_info.  */
@@ -2376,15 +2371,6 @@ init_scc_vn (void)
   allocate_vn_table (valid_info);
   optimistic_info = XCNEW (struct vn_tables_s);
   allocate_vn_table (optimistic_info);
-  pre_info = NULL;
-}
-
-void
-switch_to_PRE_table (void)
-{
-  pre_info = XCNEW (struct vn_tables_s);
-  allocate_vn_table (pre_info);
-  current_info = pre_info;
 }
 
 void
@@ -2402,9 +2388,6 @@ free_scc_vn (void)
   for (i = 0; i < num_ssa_names; i++)
     {
       tree name = ssa_name (i);
-      if (name
-         && SSA_NAME_VALUE (name))
-       SSA_NAME_VALUE (name) = NULL;
       if (name
          && VN_INFO (name)->needs_insertion)
        release_ssa_name (name);
@@ -2417,14 +2400,9 @@ free_scc_vn (void)
   XDELETE (valid_info);
   free_vn_table (optimistic_info);
   XDELETE (optimistic_info);
-  if (pre_info)
-    {
-      free_vn_table (pre_info);
-      XDELETE (pre_info);
-    }
 }
 
-/* Set the value ids in the valid/optimistic hash tables.  */
+/* Set the value ids in the valid hash tables.  */
 
 static void
 set_hashtable_value_ids (void)
@@ -2433,7 +2411,7 @@ set_hashtable_value_ids (void)
   vn_nary_op_t vno;
   vn_reference_t vr;
   vn_phi_t vp;
-  
+
   /* Now set the value ids of the things we had put in the hash
      table.  */
 
@@ -2449,18 +2427,6 @@ set_hashtable_value_ids (void)
        }
     }
 
-  FOR_EACH_HTAB_ELEMENT (optimistic_info->nary,
-                        vno, vn_nary_op_t, hi) 
-    {
-      if (vno->result)
-       {
-         if (TREE_CODE (vno->result) == SSA_NAME)
-           vno->value_id = VN_INFO (vno->result)->value_id;
-         else if (is_gimple_min_invariant (vno->result))
-           vno->value_id = get_or_alloc_constant_value_id (vno->result);
-       }
-    }
-
   FOR_EACH_HTAB_ELEMENT (valid_info->phis,
                         vp, vn_phi_t, hi) 
     {
@@ -2472,18 +2438,6 @@ set_hashtable_value_ids (void)
            vp->value_id = get_or_alloc_constant_value_id (vp->result);
        }
     }
-  FOR_EACH_HTAB_ELEMENT (optimistic_info->phis,
-                        vp, vn_phi_t, hi) 
-    {
-      if (vp->result)
-       {
-         if (TREE_CODE (vp->result) == SSA_NAME)
-           vp->value_id = VN_INFO (vp->result)->value_id;
-         else if (is_gimple_min_invariant (vp->result))
-           vp->value_id = get_or_alloc_constant_value_id (vp->result);
-       }
-    }
-
 
   FOR_EACH_HTAB_ELEMENT (valid_info->references,
                         vr, vn_reference_t, hi) 
@@ -2496,17 +2450,6 @@ set_hashtable_value_ids (void)
            vr->value_id = get_or_alloc_constant_value_id (vr->result);
        }
     }
-  FOR_EACH_HTAB_ELEMENT (optimistic_info->references,
-                        vr, vn_reference_t, hi) 
-    {
-      if (vr->result)
-       {
-         if (TREE_CODE (vr->result) == SSA_NAME)
-           vr->value_id = VN_INFO (vr->result)->value_id;
-         else if (is_gimple_min_invariant (vr->result))
-           vr->value_id = get_or_alloc_constant_value_id (vr->result);
-       }
-    }
 }
 
 /* Do SCCVN.  Returns true if it finished, false if we bailed out
@@ -2577,7 +2520,6 @@ run_scc_vn (bool may_insert_arg)
          info = VN_INFO (name);
          if (TREE_CODE (info->valnum) == SSA_NAME
              && info->valnum != name
-             && TREE_CODE (info->valnum) == SSA_NAME
              && info->value_id != VN_INFO (info->valnum)->value_id)
            {
              changed = true;
@@ -2594,16 +2536,13 @@ run_scc_vn (bool may_insert_arg)
       for (i = 0; i < num_ssa_names; i++)
        {
          tree name = ssa_name (i);
-         if (name && VN_INFO (name)->visited
-             && (SSA_VAL (name) != name
-                 || is_gimple_min_invariant (VN_INFO (name)->expr)))
+         if (name
+             && VN_INFO (name)->visited
+             && SSA_VAL (name) != name)
            {
              print_generic_expr (dump_file, name, 0);
              fprintf (dump_file, " = ");
-             if (is_gimple_min_invariant (VN_INFO (name)->expr))
-               print_generic_expr (dump_file, VN_INFO (name)->expr, 0);
-             else
-               print_generic_expr (dump_file, SSA_VAL (name), 0);
+             print_generic_expr (dump_file, SSA_VAL (name), 0);
              fprintf (dump_file, "\n");
            }
        }
index 0f8189cf2a5ba363e2faae0afc8bc8d570fe469e..9f391af43aa5c79f20aa24572a832f8715231576 100644 (file)
@@ -140,7 +140,6 @@ extern vn_ssa_aux_t VN_INFO (tree);
 extern vn_ssa_aux_t VN_INFO_GET (tree);
 bool run_scc_vn (bool);
 void free_scc_vn (void);
-void switch_to_PRE_table (void);
 tree vn_nary_op_lookup (tree, vn_nary_op_t *);
 tree vn_nary_op_lookup_pieces (unsigned int, enum tree_code,
                               tree, tree, tree, tree, tree,