RFR(XS): 8229450: C2 compilation fails with assert(found_sfpt) failed
Liu Xin
navy.xliu at gmail.com
Thu Aug 29 06:41:29 UTC 2019
- line 53: How can bytes ever be NULL?
MyTest.java try to simulate this function.
https://github.com/amzn/ion-java/blob/0873d5c1429a3bf6365d56ae2ae8461bd3865289/src/com/amazon/ion/impl/_Private_IonReaderFactory.java#L327
I manually inlined isIonBinary
https://github.com/amzn/ion-java/blob/0873d5c1429a3bf6365d56ae2ae8461bd3865289/src/com/amazon/ion/util/IonStreamUtils.java#L70
- Compared to the replay file, are you sure that the same paths are being
marked as taken with your test?
yes. I tried all kinds of combination.
- Did you compare the output of TraceLoopOpts?
yes. I did compare them. they are very same, right?
TestMe.java
Loop: N0/N0 has_call has_sfpt
Loop: N354/N353 limit_check sfpts={ 356 }
Loop: N355/N216 limit_check counted [0,4),+1 (-1 iters) has_sfpt
strip_mined
Loop: N364/N362 limit_check counted [int,0),-1 (-1 iters) has_call
has_sfpt
Replay TraceLoopOpts
Loop: N0/N0 has_call has_sfpt
Loop: N681/N680 limit_check sfpts={ 683 }
Loop: N682/N366 limit_check counted [0,4),+1 (-1 iters) has_sfpt
strip_mined
Loop: N691/N689 limit_check counted [int,0),-1 (-1 iters) has_call
has_sfpt
One thing is beyond my understanding. According to the inline tree of
replay, it should have yet another loop but I can't find it!
This loop should appear after the reverse loop 'Loop: N691/N689
limit_check counted [int,0),-1 (-1 iters)'
https://github.com/amzn/ion-java/blob/0873d5c1429a3bf6365d56ae2ae8461bd3865289/src/com/amazon/ion/util/IonStreamUtils.java#L104
Do you know who can wipe out this loop? it's not dead code. I can't
understand how dare optimizer remove it.
Another thing is I still have a hard time to understand profile data
embedded in IR.
in this graph:
https://bugs.openjdk.java.net/secure/attachment/84402/JDK-8229450.png
677 CountedLoopEnd, [lt] P=0.800000, C=8188.000000
520 If, P=0.000000, C=4617.000000
I guess P == possibility and C == counts. my program is same possibilities
as replay's.
On Wed, Aug 28, 2019 at 2:46 AM Tobias Hartmann <tobias.hartmann at oracle.com>
wrote:
>
> On 27.08.19 10:34, Liu Xin wrote:
> > I followed Tobias' guideline. I make a testcase: TestMe.java. It's very
> similar to the graph
> > generated from replay file. I intend to force line 40 and 53 share the
> boolean expression 'len <
> > BINARY_VERSION_MARKER_SIZE', but still no luck.
> > IGVN always removes one of them. I am pretty sure that replay file
> compiles the same graph, but some
> > profile data keep 364 Bool like that. Could you give me a hint?
>
> Just quickly looked at your test:
> - line 53: How can bytes ever be NULL?
> - Compared to the replay file, are you sure that the same paths are being
> marked as taken with your
> test? For example, is the break in line 43 executed or the return in line
> 54? It seems that you are
> always running with the exact same array whereas it seems likely that the
> original run used
> different arrays (and therefore the profile in the replay reports
> different paths to be taken).
> - Did you compare the output of TraceLoopOpts?
>
> Best regards,
> Tobias
>
More information about the hotspot-compiler-dev
mailing list