diff mbox

Revamp loop profile scaling to profile_probability

Message ID 20170703170930.GA40014@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka July 3, 2017, 5:09 p.m. UTC
> On Sat, Jul 1, 2017 at 7:14 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> > Hi,
> > this patch makes loop profile scaling to use profile_probability.  This
> > is mostly trivial change except for vect_do_peeling which seems to scale
> > profile down and then back up.  This is a bad idea, because things may simply
> > drop to 0.  So I kept that one to use integer scaling (because probability
> > can not represent value greater than 1).
> >
> > Bootstrapped/regtested x86_64-linux.
> 
> This likely regressed
> 
> FAIL: gcc.dg/vect/pr79347.c scan-tree-dump-not vect "Invalid sum of "

Oops, thanks. It was stupid updating typo (which took me a long while to find).
I will commit the following after regtesting.
diff mbox

Patch

Index: tree-vect-loop-manip.c
===================================================================
--- tree-vect-loop-manip.c	(revision 249926)
+++ tree-vect-loop-manip.c	(working copy)
@@ -1849,8 +1849,8 @@  vect_do_peeling (loop_vec_info loop_vinf
 	     get lost if we scale down to 0.  */
 	  int scale_up = REG_BR_PROB_BASE * REG_BR_PROB_BASE
 			 / prob_vector.to_reg_br_prob_base ();
-	  basic_block *bbs = get_loop_body (loop);
-	  scale_bbs_frequencies_int (bbs, loop->num_nodes, scale_up,
+	  basic_block *bbs = get_loop_body (epilog);
+	  scale_bbs_frequencies_int (bbs, epilog->num_nodes, scale_up,
 				     REG_BR_PROB_BASE);
 	  free (bbs);
 	}