[PATCH] Avoid unnecessary block copying in path splitting
authorJeff Law <law@redhat.com>
Tue, 22 Dec 2015 21:49:12 +0000 (14:49 -0700)
committerJeff Law <law@gcc.gnu.org>
Tue, 22 Dec 2015 21:49:12 +0000 (14:49 -0700)
* gimple-ssa-split-paths.c (split_paths): Avoid unnecessary block
copying.

From-SVN: r231915

gcc/ChangeLog
gcc/gimple-ssa-split-paths.c

index 73ab7d4081899ddc55f5700f7ef55e0262b11f9a..5e1e8192949c633a010d16f10dfa6fc3f83047a2 100644 (file)
@@ -1,3 +1,8 @@
+2015-12-22  Jeff Law  <law@redhat.com>
+
+       * gimple-ssa-split-paths.c (split_paths): Avoid unnecessary block
+       copying.
+
 2015-12-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/67376
index 540fdf3c33aae43da20e0ac9d398a47937e0b028..294a1afb3fcc747b81286478a03a2d95912fb809 100644 (file)
@@ -192,9 +192,10 @@ split_paths ()
 
       /* BB is the merge point for an IF-THEN-ELSE we want to transform.
 
-        Essentially we want to create two duplicates of BB and append
-        a duplicate to the THEN and ELSE clauses.  This will split the
-        path leading to the latch.  BB will be unreachable and removed.  */
+        Essentially we want to create a duplicate of bb and redirect the
+        first predecessor of BB to the duplicate (leaving the second
+        predecessor as is.  This will split the path leading to the latch
+        re-using BB to avoid useless copying.  */
       if (bb && is_feasible_trace (bb))
        {
          if (dump_file && (dump_flags & TDF_DETAILS))
@@ -202,9 +203,7 @@ split_paths ()
                     "Duplicating join block %d into predecessor paths\n",
                     bb->index);
          basic_block pred0 = EDGE_PRED (bb, 0)->src;
-         basic_block pred1 = EDGE_PRED (bb, 1)->src;
          transform_duplicate (pred0, bb);
-         transform_duplicate (pred1, bb);
          changed = true;
        }
     }