RFR: 8308892: Bad graph detected in build_loop_late after JDK-8305635 [v4]
Christian Hagedorn
chagedorn at openjdk.org
Thu Jun 1 07:44:16 UTC 2023
> The cleanup done in [JDK-8305635](https://bugs.openjdk.org/browse/JDK-8305635) wrongly identifies unrelated Parse Predicates which are not cleaned up, yet. It just walks from the entry of the loop up and tries to find each of the three Parse Predicates once but in no particular order. This order insensitive walk is wrong as seen in the following graph (from the attached replay file of this bug):
>
> ![image](https://github.com/openjdk/jdk/assets/17833009/32f73fcb-1d36-40d6-938c-2d282a98ea52)
>
> We first find `116 Parse Predicate` for Loop Predicates, then `84 Parse Predicate` for Profiled Loop Predicates and then stop when finding `71 Parse Predicate` for Loop Predicates because we've already found a Parse Predicate for Loop Predicates already. We then wrongly create Loop Predicates (above `116 Parse Predicate`) which are below newly created Profiled Loop Predicates (above `84 Parse Predicate`). This could lead to a bad graph because of data dependencies that rely on the fact that Loop Predicates are above Profiled Loop Predicates:
> https://github.com/openjdk/jdk/blob/547a8b40b324917e66c71409b31421feacce79d7/src/hotspot/share/opto/loopPredicate.cpp#L1529-L1543
>
> The fix is straight forward to make the assignment of Parse Predicate projections in `ParsePredicates` aware of the relative ordering constraint. Note that this class will be refactored again in [JDK-8305636](https://bugs.openjdk.org/browse/JDK-8305636). But I think properly fixing this first is better than waiting for JDK-8305636 to go in.
>
> Testing: tier1-4, hs-precheckin-comp, hs-stress-comp
>
> Thanks,
> Christian
Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
Simplify test
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/14196/files
- new: https://git.openjdk.org/jdk/pull/14196/files/13c7c6d5..25df83dc
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=14196&range=03
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=14196&range=02-03
Stats: 32 lines in 1 file changed: 12 ins; 12 del; 8 mod
Patch: https://git.openjdk.org/jdk/pull/14196.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/14196/head:pull/14196
PR: https://git.openjdk.org/jdk/pull/14196
More information about the hotspot-compiler-dev
mailing list