RFR: 8297951: C2: Create skeleton predicates for all If nodes in loop predication
Christian Hagedorn
chagedorn at openjdk.org
Tue Dec 6 07:19:53 UTC 2022
On Thu, 1 Dec 2022 14:17:47 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> We currently only create skeleton predicates for `RangeCheck` nodes and not for normal `If` nodes:
> https://github.com/openjdk/jdk/blob/2cb64a75578ccc15a1dfc8c2843aa11d05ca8aa7/src/hotspot/share/opto/loopPredicate.cpp#L1344-L1346
>
> But it is also possible to create range check predicates in loop predication for `If` nodes if they have the right pattern checked in `PhaseIdealLoop::loop_predication_impl()` and `IdealLoopTree::is_range_check_if()`. This, however, is much more rare.
>
> Without skeleton predicates for these `If` nodes, we could run into the same problems already fixed for `RangeCheck` nodes (see [JDK-8193130](https://bugs.openjdk.org/browse/JDK-8193130) and related bugs). This is almost impossible to trigger in practice as it needs a very specific setup and the right optimizations to be applied. But the test case shows such a case where we hit an assert due to a broken memory graph because we are missing skeleton predicates.
>
> I therefore propose to always create skeleton predicates for hoisted range checks in loop predication.
>
> Thanks,
> Christian
Thank you Vladimir for your review!
-------------
PR: https://git.openjdk.org/jdk/pull/11454
More information about the hotspot-compiler-dev
mailing list