diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-22 21:49:12 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-12-22 21:49:12 +0000 |
commit | fc7a3a00ad5089bd13f7e4646f7a319e7eee407c (patch) | |
tree | c6b42b81bbd93ea071dc0836af82026b018e9ac6 /gcc/gimple-ssa-split-paths.c | |
parent | 612a610dff37b37a7cdd8e92c8d65766724b58d6 (diff) | |
download | gcc-fc7a3a00ad5089bd13f7e4646f7a319e7eee407c.tar.gz |
[PATCH] Avoid unnecessary block copying in path splitting
* gimple-ssa-split-paths.c (split_paths): Avoid unnecessary block
copying.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231915 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-ssa-split-paths.c')
-rw-r--r-- | gcc/gimple-ssa-split-paths.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/gimple-ssa-split-paths.c b/gcc/gimple-ssa-split-paths.c index 540fdf3c33a..294a1afb3fc 100644 --- a/gcc/gimple-ssa-split-paths.c +++ b/gcc/gimple-ssa-split-paths.c @@ -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; } } |