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

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


> 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.

Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:

  bug number in test

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/3006/files
  - new: https://git.openjdk.java.net/jdk/pull/3006/files/a47fa7b7..9529fa73

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=3006&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=3006&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/3006.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/3006/head:pull/3006

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


More information about the shenandoah-dev mailing list