aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-loop-split.cc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-09-12 10:43:19 +0200
committerMartin Liska <mliska@suse.cz>2022-09-12 10:43:19 +0200
commitfdb97cd0b7d15efa39ba79dca44be93debb0ef12 (patch)
tree65a6d95503fb9897bda29c72a629e57bb773d1c1 /gcc/tree-ssa-loop-split.cc
parent918bc838c2803f08e4d7ccd179396d48cb8ec804 (diff)
parent643ae816f17745a77b62188b6bf169211609a59b (diff)
downloadgcc-fdb97cd0b7d15efa39ba79dca44be93debb0ef12.zip
gcc-fdb97cd0b7d15efa39ba79dca44be93debb0ef12.tar.gz
gcc-fdb97cd0b7d15efa39ba79dca44be93debb0ef12.tar.bz2
Merge branch 'master' into devel/sphinx
Diffstat (limited to 'gcc/tree-ssa-loop-split.cc')
-rw-r--r--gcc/tree-ssa-loop-split.cc16
1 files changed, 10 insertions, 6 deletions
diff --git a/gcc/tree-ssa-loop-split.cc b/gcc/tree-ssa-loop-split.cc
index bccf621..fad4e83 100644
--- a/gcc/tree-ssa-loop-split.cc
+++ b/gcc/tree-ssa-loop-split.cc
@@ -531,16 +531,17 @@ split_loop (class loop *loop1)
tree guard_iv;
tree border = NULL_TREE;
affine_iv iv;
+ edge exit1;
- if (!single_exit (loop1)
+ if (!(exit1 = single_exit (loop1))
+ || EDGE_COUNT (exit1->src->succs) != 2
/* ??? We could handle non-empty latches when we split the latch edge
(not the exit edge), and put the new exit condition in the new block.
OTOH this executes some code unconditionally that might have been
skipped by the original exit before. */
|| !empty_block_p (loop1->latch)
|| !easy_exit_values (loop1)
- || !number_of_iterations_exit (loop1, single_exit (loop1), &niter,
- false, true)
+ || !number_of_iterations_exit (loop1, exit1, &niter, false, true)
|| niter.cmp == ERROR_MARK
/* We can't yet handle loops controlled by a != predicate. */
|| niter.cmp == NE_EXPR)
@@ -644,10 +645,13 @@ split_loop (class loop *loop1)
fix_loop_bb_probability (loop1, loop2, true_edge, false_edge);
/* Fix first loop's exit probability after scaling. */
- edge exit_to_latch1 = single_pred_edge (loop1->latch);
+ edge exit_to_latch1;
+ if (EDGE_SUCC (exit1->src, 0) == exit1)
+ exit_to_latch1 = EDGE_SUCC (exit1->src, 1);
+ else
+ exit_to_latch1 = EDGE_SUCC (exit1->src, 0);
exit_to_latch1->probability *= true_edge->probability;
- single_exit (loop1)->probability
- = exit_to_latch1->probability.invert ();
+ exit1->probability = exit_to_latch1->probability.invert ();
/* Finally patch out the two copies of the condition to be always
true/false (or opposite). */