On 12/11/2015 03:05 AM, Richard Biener wrote:
On Thu, Dec 10, 2015 at 9:08 PM, Jeff Law <l...@redhat.com> wrote:
On 12/03/2015 07:38 AM, Richard Biener wrote:

This pass is now enabled by default with -Os but has no limits on the
amount of
stmts it copies.

The more statements it copies, the more likely it is that the path spitting
will turn out to be useful!  It's counter-intuitive.

Well, it's still not appropriate for -Os (nor -O2 I think).  -ftracer is enabled
with -fprofile-use (but it is also properly driven to only trace hot paths)
and otherwise not by default at any optimization level.
I've just committed a patch to limit to loops we're optimizing for speed and moved the transformation from -O2 to -O3.

I put in some instrumentation to see when this was triggering and, as expected the vast majority of triggers are with very small blocks, 2-3 statements. But those are probably the least interesting. There's limited instances where it triggers on large blocks (say > 10 statements). But those were with GCC sources. I'm going to pull out SPEC and do some instrumented builds with that, obviously focusing on those benchmarks where Ajit saw improvements.

Hmmm, the updated code keeps the single latch property, but I'm pretty sure
it won't keep a single exit policy.

To keep a single exit policy would require keeping an additional block
around.  Each of the split paths would unconditionally transfer to this new
block.  The new block would then either transfer to the latch block or out
of the loop.

Don't see how this would work for the CFG pattern it operates on unless you
duplicate the exit condition into that new block creating an even more
obfuscated CFG.
Upon further reflection, I don't think this is important as the pass runs after the tree loop optimizers.


Note that both passes are placed quite late and thus won't see much
of the GIMPLE optimizations (DOM mainly).  I wonder why they were
not placed adjacent to each other.
I'm going to move them to be adjacent. If for no other reason than it'll make comparisons easier without having to worry about any passes between them. I suspect that'll drop in tonight after I get the kids to sleep :-)

Jeff

Reply via email to