RFR: 8294217: Assertion failure: parsing found no loops but there are some [v2]

Roland Westrelin roland at openjdk.org
Tue Nov 8 14:06:38 UTC 2022


> This was reported on 11 and is not reproducible with the current
> jdk. The reason is that the PhaseIdealLoop invocation before EA was
> changed from LoopOptsNone to LoopOptsMaxUnroll. In the absence of
> loops, LoopOptsMaxUnroll exits earlier than LoopOptsNone. That wasn't
> intended and this patch makes sure they behave the same. Once that's
> changed, the crash reproduces with the current jdk.
> 
> The assert fires because PhaseIdealLoop::only_has_infinite_loops()
> returns false even though the IR only has infinite loops. There's a
> single loop nest and the inner most loop is an infinite loop. The
> current logic only looks at loops that are direct children of the root
> of the loop tree. It's not the first bug where
> PhaseIdealLoop::only_has_infinite_loops() fails to catch an infinite
> loop (8257574 was the previous one) and it's proving challenging to
> have PhaseIdealLoop::only_has_infinite_loops() handle corner cases
> robustly. I reworked PhaseIdealLoop::only_has_infinite_loops() once
> more. This time it goes over all children of the root of the loop
> tree, collects all controls for the loop and its inner loop. It then
> checks whether any control is a branch out of the loop and if it is
> whether it's not a NeverBranch.

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

  review

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10904/files
  - new: https://git.openjdk.org/jdk/pull/10904/files/3838eee1..1d2a7ef7

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

  Stats: 14 lines in 2 files changed: 5 ins; 3 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/10904.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10904/head:pull/10904

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


More information about the hotspot-compiler-dev mailing list