RFR: 8286800: Assert in PhaseIdealLoop::dump_real_LCA is too strong [v2]

Christian Hagedorn chagedorn at openjdk.org
Mon Nov 7 11:47:51 UTC 2022


> We sometimes hit the following assert when dumping a bad graph (before crashing with the bad graph assertion):
> 
> assert(real_LCA != NULL, "must always find an LCA"
> ``` 
> The algorithm is not correct as we should always find an LCA of two nodes. To fix this, I've re-implemented the algorithm and improved the dumped idom chains:
> - I limited the node dump to idx + node name to reduce the noise which made it hard to read.
> - Reversed the idom chain dumps to reflect the graph structure.
> 
> Example output:
> 
> Bad graph detected in build_loop_late
> n:  138  CastPP  === 205 38  [[ 263 140 140 168 ]]  #Test:NotNull *  Oop:Test:NotNull * !jvms: Test::mainTest @ bci:40 (line 154)
> 
> [... same output as before ...]
> 
> idoms of early "197 IfFalse":
> idom[2]:    42  If
> idom[1]:    44  IfTrue
> idom[0]:   196  If
> n:         197  IfFalse
> 
> idoms of (wrong) LCA "205 IfTrue":
> idom[4]:    42  If
> idom[3]:    37  Region
> idom[2]:    73  If
> idom[1]:    83  IfTrue
> idom[0]:   204  If
> n:         205  IfTrue
> 
> Real LCA of early "197 IfFalse" (idom[2]) and wrong LCA "205 IfTrue" (idom[4]):
>   42  If  === 30 41  [[ 43 44 ]] P=0.999000, C=-1.000000 !jvms: Test::mainTest @ bci:32 (line 153)
> 
> Tested by manually calling `dump_idoms` during a compilation and by running reproducers of different bad graph assertion bugs.
> 
> Thanks,
> Christian

Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:

  Fix optimized build

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11015/files
  - new: https://git.openjdk.org/jdk/pull/11015/files/884c0f82..342213d6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11015&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11015&range=00-01

  Stats: 6 lines in 1 file changed: 1 ins; 3 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/11015.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11015/head:pull/11015

PR: https://git.openjdk.org/jdk/pull/11015


More information about the hotspot-compiler-dev mailing list