RFR(XS): 8229450: C2 compilation fails with assert(found_sfpt) failed
Liu Xin
navy.xliu at gmail.com
Sat Aug 31 05:40:05 UTC 2019
hi, Roland and Tobias,
I made mistake yesterday. I missed ' -XX:+UseCountedLoopSafepoints'.
https://cr.openjdk.java.net/~xliu/8229450/03/webrev/test/hotspot/jtreg/compiler/loopstripmining/LoadDependsOnIfIdenticalToLoopExit.java.html
The reason I want to explicitly declare '-XX:+UseCountedLoopSafepoints
-XX:LoopStripMiningIter=1000' because this test needs 'strip-mined loop'
Yes, indeed, G1 and shenandoah set it by default, but it's good idea to set
this explicitly.
On Fri, Aug 30, 2019 at 6:50 AM Roland Westrelin <rwestrel at redhat.com>
wrote:
>
> > I just did cosmetic things for your patch. Could you review and sponsor
> > it?
>
> Let me run some more testing with it.
>
> > Could you tell me what 'chain of events' leads you to your test1?
>
> Something like this:
>
> 1- we need a loop that's strip mined and followed by a test with the same
> test as the exit condition with a dependent load (the load has to have
> its control input set to the right branch of the if)
>
> - One way to have a load with a control set is to have a load from an
> array (because then, the load is dependent on an array bound check). A
> field load wouldn't be directly control dependent.
>
> - but the load must be directly dependent on the if, there must be no
> bound check in between: one way for c2 to optimize out the bound check
> is it can prove it's useless which is the case for a newly allocated
> object
>
> - but a load from a newly allocated would also be optimized out so let's
> put a non inlined call in the way to defeat that optimization
>
> 2- we need the if to be optimized out during loop opts. If it's right at
> the exit of the loop, then IGVN optimizes it out before the strip mined
> loop is even created so put extra control flow between the if and the
> loop exit to get in the way of the IGVN optimization
>
> with a lot of trial and error and going back and forth between the test
> and what c2 actually generates.
>
> Roland.
>
Thanks a lot. now I know how you got test1. The event is actually c2 event.
I thought there's a short-cut to be there. Actually, there isn't! A man
can't get whatever code shape he want until he knows every single
optimization.
Clearly, I am far far away from that level.
Tobias,
Thank you to let me watchpoint tips and rr debugger. I got a video on
youtube.
thanks,
--lx
More information about the hotspot-compiler-dev
mailing list