]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Do not use annotations on edges in if-conversion.
authorspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 May 2010 17:14:17 +0000 (17:14 +0000)
committerspop <spop@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 29 May 2010 17:14:17 +0000 (17:14 +0000)
2010-05-29  Sebastian Pop  <sebastian.pop@amd.com>

* tree-if-conv.c (add_to_dst_predicate_list): Do not use the ->aux
field on edges.
(predicate_bbs): Same.
(clean_predicate_lists): Same.
(find_phi_replacement_condition): Do not AND the predicate from
edge->aux.

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

gcc/ChangeLog
gcc/tree-if-conv.c

index 82d9c19162eb05cfb3a217620b8667c4e4582959..a01622a7028d55128e5be5de6f34cc6f0606ed89 100644 (file)
@@ -1,3 +1,12 @@
+2010-05-29  Sebastian Pop  <sebastian.pop@amd.com>
+
+       * tree-if-conv.c (add_to_dst_predicate_list): Do not use the ->aux
+       field on edges.
+       (predicate_bbs): Same.
+       (clean_predicate_lists): Same.
+       (find_phi_replacement_condition): Do not AND the predicate from
+       edge->aux.
+
 2010-05-29  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR bootstrap/44315
index 2729bf3cf159d3a7b0dadb5986027f4b4d976e0c..45ce388891db5c019468fa0fa39e15fae2e1288d 100644 (file)
@@ -163,15 +163,8 @@ add_to_dst_predicate_list (struct loop *loop, edge e,
   if (prev_cond == boolean_true_node || !prev_cond)
     new_cond = unshare_expr (cond);
   else
-    {
-      /* Add the condition COND to the e->aux field.  In case the edge
-        destination is a PHI node, this condition will be added to
-        the block predicate to construct a complete condition.  */
-      e->aux = cond;
-
-      new_cond = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
-                             unshare_expr (prev_cond), cond);
-    }
+    new_cond = fold_build2 (TRUTH_AND_EXPR, boolean_type_node,
+                           unshare_expr (prev_cond), cond);
 
   add_to_predicate_list (e->dest, new_cond);
   return new_cond;
@@ -469,12 +462,12 @@ get_loop_body_in_if_conv_order (const struct loop *loop)
 /* Returns true when the analysis of the predicates for all the basic
    blocks in LOOP succeeded.
 
-   predicate_bbs first clears the ->aux fields of the edges and basic
-   blocks.  These fields are then initialized with the tree
-   expressions representing the predicates under which a basic block
-   is executed in the LOOP.  As the loop->header is executed at each
-   iteration, it has the "true" predicate.  Other statements executed
-   under a condition are predicated with that condition, for example
+   predicate_bbs first clears the ->aux fields of the basic blocks.
+   These fields are then initialized with the tree expressions
+   representing the predicates under which a basic block is executed
+   in the LOOP.  As the loop->header is executed at each iteration, it
+   has the "true" predicate.  Other statements executed under a
+   condition are predicated with that condition, for example
 
    | if (x)
    |   S1;
@@ -490,18 +483,7 @@ predicate_bbs (loop_p loop)
   unsigned int i;
 
   for (i = 0; i < loop->num_nodes; i++)
-    {
-      edge e;
-      edge_iterator ei;
-      basic_block bb = ifc_bbs [i];
-      gimple_stmt_iterator itr = gsi_start_phis (bb);
-
-      if (!gsi_end_p (itr))
-       FOR_EACH_EDGE (e, ei, bb->preds)
-         e->aux = NULL;
-
-      bb->aux = NULL;
-    }
+    ifc_bbs[i]->aux = NULL;
 
   for (i = 0; i < loop->num_nodes; i++)
     {
@@ -714,26 +696,18 @@ if_convertible_loop_p (struct loop *loop)
 
 /* During if-conversion, the bb->aux field is used to hold a predicate
    list.  This function cleans for all the basic blocks in the given
-   LOOP their predicate list.  It also cleans up the e->aux field of
-   all the successor edges: e->aux is used to hold the true and false
-   conditions for conditional expressions.  */
+   LOOP their predicate list.  */
 
 static void
 clean_predicate_lists (struct loop *loop)
 {
-  basic_block *bb;
   unsigned int i;
-  edge e;
-  edge_iterator ei;
+  basic_block *bbs = get_loop_body (loop);
 
-  bb = get_loop_body (loop);
   for (i = 0; i < loop->num_nodes; i++)
-    {
-      bb[i]->aux = NULL;
-      FOR_EACH_EDGE (e, ei, bb[i]->succs)
-       e->aux = NULL;
-    }
-  free (bb);
+    bbs[i]->aux = NULL;
+
+  free (bbs);
 }
 
 /* Basic block BB has two predecessors.  Using predecessor's bb->aux
@@ -799,12 +773,6 @@ find_phi_replacement_condition (struct loop *loop,
     {
       *cond = (tree) (second_edge->src)->aux;
 
-      /* If there is a condition on an incoming edge, add it to the
-        incoming bb predicate.  */
-      if (second_edge->aux)
-       *cond = build2 (TRUTH_AND_EXPR, boolean_type_node,
-                       *cond, (tree) second_edge->aux);
-
       if (TREE_CODE (*cond) == TRUTH_NOT_EXPR)
        *cond = invert_truthvalue (*cond);
       else
@@ -812,15 +780,7 @@ find_phi_replacement_condition (struct loop *loop,
        first_edge = second_edge;
     }
   else
-    {
-      *cond = (tree) (first_edge->src)->aux;
-
-      /* If there is a condition on an incoming edge, add it to the
-        incoming bb predicate.  */
-      if (first_edge->aux)
-       *cond = build2 (TRUTH_AND_EXPR, boolean_type_node,
-                       *cond, (tree) first_edge->aux);
-    }
+    *cond = (tree) (first_edge->src)->aux;
 
   /* Gimplify the condition: the vectorizer prefers to have gimple
      values as conditions.  Various targets use different means to