RFR: 8350578: Refactor useless Parse and Template Assertion Predicate elimination code by using a PredicateVisitor [v2]
Galder Zamarreño
galder at openjdk.org
Fri Mar 14 12:05:04 UTC 2025
On Fri, 14 Mar 2025 10:05:22 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> When can `_parse_predicate_node` be null?
>
> When iterating through predicates, we use a `PredicateBlockIterator` for each Predicate Block, which consists of an optional Parse Predicate and a number of Regular Predicates (Runtime and Assertion Predicates). We could have either already removed the Parse Predicate before here:
> https://github.com/openjdk/jdk/blob/e3c29c9e6cff7648952c0ba359b0763a0ea8da18/src/hotspot/share/opto/loopnode.cpp#L5055-L5066
>
> or there is just no Parse Predicate for this loop. So, when initializing the `PredicateBlockIterator`, we could pass here a non-Parse-Predicate projection to the constructor of `ParsePredicate`:
> https://github.com/openjdk/jdk/blob/e3c29c9e6cff7648952c0ba359b0763a0ea8da18/src/hotspot/share/opto/predicates.hpp#L747
>
> We then set `_parse_predicate_node` to null here due to this mismatch:
> https://github.com/openjdk/jdk/blob/e3c29c9e6cff7648952c0ba359b0763a0ea8da18/src/hotspot/share/opto/predicates.hpp#L293-L296
Is the last code snippet the relevant one?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24013#discussion_r1995432535
More information about the hotspot-compiler-dev
mailing list