https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95018

--- Comment #20 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jiu Fu Guo from comment #18)
> Currently, I'm thinking to enhance GCC 'cunroll' as:
> if the loop has multi-exits or upbound is not a fixed number, we may not do
> 'complete unroll' for the loop, except -funroll-all-loops is specified.

That doens't make much sense (-funroll-all-loops is RTL unroller only).

I think the growth limits are simply too large unless we compute a "win"
which we in this case do not.  So I'd say the growth limits should scale
with win ^ (1/new param) thus if we estimate to eliminate 20% of the
loop stmts due to unrolling then the limit to apply is
limit * (0.2 ^ (1/X)) with X maybe defaulting to 2.

I'd only apply this new limit for peeling (peeling is when the loop count
is not constant and thus we keep the exit tests).

Of course people want more peeling (hello POWER people!)

Reply via email to