Integrated: 8317723: C2: CountedLoopEndNodes and Zero Trip Guards are wrongly treated as Runtime Predicate
Christian Hagedorn
chagedorn at openjdk.org
Thu Nov 16 07:40:42 UTC 2023
On Fri, 10 Nov 2023 08:53:29 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
> In `testCountedLoopEndAsRuntimePredicate()`, a `CountedLoopEndNode` is wrongly treated as Runtime Predicate and added to a Predicate Block. This happens because a predicate trap ends up at one of the projections of the `CountedLoopEndNode` due to folding some other nodes:
>
> 
>
> The verification code then reports this failure when trying to find all predicates above `530 CountedLoop`. I've fixed `RuntimePredicate::is_success_proj()` to only treat an `IfNode` or a `RangeCheckNode` as Runtime Predicate.
>
> We could also end up treating a zero trip guard If node with an `OpaqueZeroTripGuardNode` as Runtime Predicate (see `testZeroTripGuardAsRuntimePredicate()`):
>
> 
>
> This could also potentially lead to problems. I've improved `RuntimePredicate::is_success_proj()` to additionally exclude zero trip guard checks. I've strengthened the verification code accordingly such that it would have failed with `testZeroTripGuardAsRuntimePredicate()`.
>
> Thanks,
> Christian
This pull request has now been integrated.
Changeset: 2db9ea9b
Author: Christian Hagedorn <chagedorn at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/2db9ea9bbf6d4b7875b0c62721f76f016fd7257e
Stats: 127 lines in 5 files changed: 126 ins; 0 del; 1 mod
8317723: C2: CountedLoopEndNodes and Zero Trip Guards are wrongly treated as Runtime Predicate
Reviewed-by: thartmann, epeter
-------------
PR: https://git.openjdk.org/jdk/pull/16596
More information about the hotspot-compiler-dev
mailing list