RFR: 8317723: C2: CountedLoopEndNodes and Zero Trip Guards are wrongly treated as Runtime Predicate [v2]
Christian Hagedorn
chagedorn at openjdk.org
Wed Nov 15 13:53:05 UTC 2023
> 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
Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:
update zero trip guard check code
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/16596/files
- new: https://git.openjdk.org/jdk/pull/16596/files/4413de39..dde90415
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=16596&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=16596&range=00-01
Stats: 9 lines in 2 files changed: 1 ins; 6 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/16596.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/16596/head:pull/16596
PR: https://git.openjdk.org/jdk/pull/16596
More information about the hotspot-compiler-dev
mailing list