This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem in propagating profiling information through loop unrolling


Hello,

> On Apr 19, 2004, at 2:20 PM, Mostafa Hagog wrote:
> >The following line from "scale_bbs_frequencies" of cfgloopmanip.c
> >      bbs[i]->count = (bbs[i]->count * num) / den;
> >may cause a loop whose preheader has a count of 1 (and whose body has a
> >very
> >large count) to receive a zero preheader count after a precondition is
> >inserted on the preheader edge.  This phenomena was observed after 
> >noticing
> >that the doloop rewrite (of Zedenek Dvorak) produced less 
> >branch-on-counts
> >than the original one when feedback is turned on.  The zero preheader 
> >count
> >convinced the doloop optimization that it was not profitable to 
> >perform the
> >doloop opt.
> 
> Good catch.
> Why is the doloop opt sensitive to that?  I can see disabling 
> unrolling, but
> using BCT is harmless even for unexecuted loops.  Unless you're then 
> allowing it
> in an outer loop?

we in fact do not test whether the loop is executed; the problem is that
the test for expected number of iterations returns nonsense in this
case, which causes the doloop optimizer believe that the loop does not
roll and therefore that using the doloop pattern for it would not be
useful.

Zdenek


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]