Hi, this patch makes vect_analyze_loop_2 to give up on loops with low max iteration counts (instead of only considering estimated_stmt_executions_int). This change was eaerlier approved by Richi in stage4 and reverted. I got wrong the testm instead == -1 there was != -1 and thus the regressions. Noticed that only now.
Bootstrapped/regtested x86_64-linux, comitted. Honza Index: ChangeLog =================================================================== --- ChangeLog (revision 236477) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2016-05-19 Jan Hubicka <hubi...@ucw.cz> + + * tree-vect-loop.c (vect_analyze_loop_2): Use also + max_loop_iterations_int. + 2016-05-19 Marek Polacek <pola...@redhat.com> PR tree-optimization/71031 Index: tree-vect-loop.c =================================================================== --- tree-vect-loop.c (revision 236450) +++ tree-vect-loop.c (working copy) @@ -2065,6 +2065,8 @@ start_over: estimated_niter = estimated_stmt_executions_int (LOOP_VINFO_LOOP (loop_vinfo)); + if (estimated_niter == -1) + estimated_niter = max_niter; if (estimated_niter != -1 && ((unsigned HOST_WIDE_INT) estimated_niter <= MAX (th, (unsigned)min_profitable_estimate)))