aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-if-conv.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2017-02-05 18:16:52 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2017-02-05 17:16:52 +0000
commit5d3ebb71cbf9c6ed0ce04230a387485fa57e71ed (patch)
tree6a1953407e98b13d0d2602cd0d7e48943219acd8 /gcc/tree-if-conv.c
parente6b07173d2cb671f6726bf1d00e08b107391fb5c (diff)
re PR tree-optimization/79347 (vect_do_peeling is messing up profile)
PR tree-ssa/79347 * cfgloopmanip.c (lv_adjust_loop_entry_edge, loop_version): Add ELSE_PROB. * cfgloopmanip.h (loop_version): Update prototype. * modulo-sched.c (sms_schedule): Update call of loop_version. * tree-if-conv.c(version_loop_for_if_conversion): Likewise. * tree-parloops.c (gen_parallel_loop): Likewise. * tree-ssa-loop-manip.c (tree_transform_and_unroll_loop): Likewise. * tree-ssa-loop-split.c (split_loop): Likewise. * tree-ssa-loop-unswitch.c (tree_unswitch_loop): Likewise. * tree-vect-loop-manip.c (vect_loop_versioning): Likewise. * gcc.dg/tree-ssa/ifc-10.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-11.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-12.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-20040816-1.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-20040816-2.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-5.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-8.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-9.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-cd.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-pr56541.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-pr68583.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-pr69489-1.c: Match for profile mismatches. * gcc.dg/tree-ssa/ifc-pr69489-2.c: Match for profile mismatches. From-SVN: r245196
Diffstat (limited to 'gcc/tree-if-conv.c')
-rw-r--r--gcc/tree-if-conv.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index c12987e55de..eb637952e22 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -2533,7 +2533,11 @@ combine_blocks (struct loop *loop)
will be if-converted, the new copy of the loop will not,
and the LOOP_VECTORIZED internal call will be guarding which
loop to execute. The vectorizer pass will fold this
- internal call into either true or false. */
+ internal call into either true or false.
+
+ Note that this function intentionally invalidates profile. Both edges
+ out of LOOP_VECTORIZED must have 100% probability so the profile remains
+ consistent after the condition is folded in the vectorizer. */
static struct loop *
version_loop_for_if_conversion (struct loop *loop)
@@ -2557,9 +2561,11 @@ version_loop_for_if_conversion (struct loop *loop)
saved_preds[i] = ifc_bbs[i]->aux;
initialize_original_copy_tables ();
+ /* At this point we invalidate porfile confistency until IFN_LOOP_VECTORIZED
+ is re-merged in the vectorizer. */
new_loop = loop_version (loop, cond, &cond_bb,
REG_BR_PROB_BASE, REG_BR_PROB_BASE,
- REG_BR_PROB_BASE, true);
+ REG_BR_PROB_BASE, REG_BR_PROB_BASE, true);
free_original_copy_tables ();
for (unsigned i = 0; i < save_length; i++)