Re: [PATCH v2 1/4] Fix loop split incorrect count and probability

2021-10-27 Thread Jan Hubicka via Gcc-patches
> On Wed, 27 Oct 2021, Jan Hubicka wrote: > > > > > > > gcc/ChangeLog: > > > > > > * tree-ssa-loop-split.c (split_loop): Fix incorrect probability. > > > (do_split_loop_on_cond): Likewise. > > > --- > > > gcc/tree-ssa-loop-split.c | 25 - > > > 1 file changed, 16 ins

Re: [PATCH v2 1/4] Fix loop split incorrect count and probability

2021-10-27 Thread Richard Biener via Gcc-patches
On Wed, 27 Oct 2021, Jan Hubicka wrote: > > > > gcc/ChangeLog: > > > > * tree-ssa-loop-split.c (split_loop): Fix incorrect probability. > > (do_split_loop_on_cond): Likewise. > > --- > > gcc/tree-ssa-loop-split.c | 25 - > > 1 file changed, 16 insertions(+), 9 de

Re: [PATCH v2 1/4] Fix loop split incorrect count and probability

2021-10-27 Thread Jan Hubicka via Gcc-patches
> As discussed yesterday, for loop of form > > for (...) > if (cond) > cond = something(); > else > something2 > > Split as > Say "if (cond)" has probability p, then individual statements scale as follows: loop1: pfor (...) p if (true) 1cond = something(); 1

Re: [PATCH v2 1/4] Fix loop split incorrect count and probability

2021-10-27 Thread Jan Hubicka via Gcc-patches
> > gcc/ChangeLog: > > * tree-ssa-loop-split.c (split_loop): Fix incorrect probability. > (do_split_loop_on_cond): Likewise. > --- > gcc/tree-ssa-loop-split.c | 25 - > 1 file changed, 16 insertions(+), 9 deletions(-) > > diff --git a/gcc/tree-ssa-loop-split.

[PATCH v2 1/4] Fix loop split incorrect count and probability

2021-10-26 Thread Xionghu Luo via Gcc-patches
loop split condition is moved between loop1 and loop2, the split bb's count and probability should also be duplicated instead of (100% vs INV), secondly, the original loop1 and loop2 count need be propotional from the original loop. Regression tested pass, OK for master? diff base/loop-cond-split