diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-09-26 09:30:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 09:30:08 +0000 |
commit | 8ed1bbaa40527c561b25b5dadb963ca404f2da37 (patch) | |
tree | b68241b6d5b2361edc1b6352e503660602c28885 /gcc/tree-ssa-loop-split.cc | |
parent | 6d98713a7b9cc58573be3e209a27a6c4ce682166 (diff) | |
parent | 033a4599350d23d55f5e9a0f9adf497e7f0279e8 (diff) | |
download | gcc-8ed1bbaa40527c561b25b5dadb963ca404f2da37.zip gcc-8ed1bbaa40527c561b25b5dadb963ca404f2da37.tar.gz gcc-8ed1bbaa40527c561b25b5dadb963ca404f2da37.tar.bz2 |
Merge #1542
1542: Merge GCC mainline/master into gccrs/master r=philberty a=ibuclaw
As per title, pull in the latest and greatest from gcc development.
Co-authored-by: Tim Lange <mail@tim-lange.me>
Co-authored-by: GCC Administrator <gccadmin@gcc.gnu.org>
Co-authored-by: Martin Liska <mliska@suse.cz>
Co-authored-by: Javier Miranda <miranda@adacore.com>
Co-authored-by: Bob Duff <duff@adacore.com>
Co-authored-by: Patrick Bernardi <bernardi@adacore.com>
Co-authored-by: Steve Baird <baird@adacore.com>
Co-authored-by: Gary Dismukes <dismukes@adacore.com>
Co-authored-by: Eric Botcazou <ebotcazou@adacore.com>
Co-authored-by: Justin Squirek <squirek@adacore.com>
Co-authored-by: Piotr Trojanek <trojanek@adacore.com>
Co-authored-by: Joffrey Huguet <huguet@adacore.com>
Co-authored-by: Yannick Moy <moy@adacore.com>
Diffstat (limited to 'gcc/tree-ssa-loop-split.cc')
-rw-r--r-- | gcc/tree-ssa-loop-split.cc | 16 |
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). */ |