Integrated: 8263376: CTW (Shenandoah): assert(mems <= 1) failed: No node right after call if multiple mem projections

Roland Westrelin roland at openjdk.java.net
Fri Mar 26 16:52:50 UTC 2021


On Mon, 15 Mar 2021 10:06:20 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> This is another case of anti-dependence analysis being too conservative.
> 
> In TestBadRawMemoryAfterCall.test2(), test
> 
> if (i == 42) {
> 
> is split thru the Phi that merges values from the fallthru and
> exception paths. As a consequence, control flow at the call is
> roughly:
> a.m() call
> |         \       
> fallthru  exception
> |             |
> if (i == 42)  |
> |      \      |
> |       Region1
> \        /
>   Region2
> When anti-dependence analysis runs for the load after the call, it
> starts from the memory state out of the call on the fallthru path. One
> use is a memory Phi at Region2 (say Phi2). Another path leads to
> Region1 at, say, Phi1.
> 
> When anti-dependence analysis then goes over Phis, it processes Phi2,
> goes over the its inputs and finds that 2 are reachable: the one that
> has a direct edge to the memory state on the fallthru path and the one
> from Phi1. As a consequence, control for the load is set to be right
> after the call, which is too conservative.
> 
> When following the memory edges, the code stops at Phi1. It doesn't
> process uses of Phi1. Any anti-dependence that's needed between the
> load and Phi1 is then taken into account when Phis are processed. When
> inputs to Phi2 are processed, considering the Phi2->Phi1 is too
> conservative. As mentioned above, anti-dependences for Phi1 are taken
> into account separately. I think it's true for all Phi->Phi edges that
> they can be safely ignored. That's what I propose as a fix.

This pull request has now been integrated.

Changeset: 33c94ffc
Author:    Roland Westrelin <roland at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/33c94ffc
Stats:     30 lines in 2 files changed: 24 ins; 0 del; 6 mod

8263376: CTW (Shenandoah): assert(mems <= 1) failed: No node right after call if multiple mem projections

Reviewed-by: kvn, chagedorn

-------------

PR: https://git.openjdk.java.net/jdk/pull/3006


More information about the shenandoah-dev mailing list