This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fixes to estimate_num_insns from pretty-ipa branch
> Hi,
>
> > 6) Esimated_unrolled_size have off-by-one bug. When loop iterates 4 times, it is estimating
> > inlined body size as containing 5 copies.
>
> this is actually correct. Number of iterations of a loop as passed to
> estimated_unrolled_size is the number of executions of a latch edge.
> Since the exit edge is expected to be after loop body, if latch
> is executed 4 times, then the body will be executed 5 times.
Hmm, isn't there problem that the loop condition is at end of body?
I definitly had looop for (i=0;i<4;i++) body and the code multiplied
body estimate by 5. I will take a look again today.
Honza
>
> Zdenek