[jdk11u-dev] Integrated: 8307683: Loop Predication should not hoist range checks with trap on success projection by negating their condition

Andrew Lu andrewlu at openjdk.org
Thu Dec 14 01:56:53 UTC 2023


On Wed, 6 Dec 2023 05:57:03 GMT, Andrew Lu <andrewlu at openjdk.org> wrote:

> I backport this for parity with 11.0.23-oracle.
> 
> To solve the error after backport, follow the jdk17 backport, https://github.com/openjdk/jdk17u-dev/pull/1553
> as Goetz describe, the changes are:
> 
> Resolves in detail:
> 
> src/hotspot/share/opto/loopPredicate.cpp
> In head, there are two variants of is_range_check_if(), 11 has only one. Omitted the changes to the second one.
> loop_predication_impl_helper()
> Renamed the variable. In head, it is if_proj->if_success_proj, here it is proj->success_proj.
> I introduce a new vairalbe IfProjNode if_success_proj. Calls to loop_predication_impl_helper
> pass Projs and not IfProjs, so this seems cleaner. Added assertion.
> Passing proj instead of if to is_range_check_if().
> Computation of the deleted "bool negate" differs. Deleted anyways.
> Removed all the uses of negate.
> 
> src/hotspot/share/opto/loopTransform.cpp
> Trivial resolve.
> 
> src/hotspot/share/opto/loopnode.cpp
> extract_long_range_checks() was introduced in "8259609: C2: optimize long range checks in long counted loops".
> The change is only needed as the input to is_range_check_if() was
> changed from the IfNode to the IfProjNode below. The change here has no effect on the fix. Skipped.
> 
> patching file src/hotspot/share/opto/loopnode.hpp
> Resolved, simple differences.

This pull request has now been integrated.

Changeset: 1adabcd6
Author:    Andrew Lu <andrewlu at openjdk.org>
URL:       https://git.openjdk.org/jdk11u-dev/commit/1adabcd6b2003f2aa4475bfa02504845c2e2a43b
Stats:     256 lines in 4 files changed: 227 ins; 6 del; 23 mod

8307683: Loop Predication should not hoist range checks with trap on success projection by negating their condition

Reviewed-by: lucy
Backport-of: dfd3da3f52480f68f653beb1e720691f8232ace7

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

PR: https://git.openjdk.org/jdk11u-dev/pull/2340


More information about the jdk-updates-dev mailing list