Integrated: 8344213: Cleanup OpaqueLoop*Node verification code for Assertion Predicates

Christian Hagedorn chagedorn at openjdk.org
Mon Nov 25 16:49:29 UTC 2024


On Fri, 15 Nov 2024 08:17:22 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> This patch cleans up the `OpaqueLoop*Node` verification code that is called with `PhaseIdeaLoop::assertion_predicate_has_loop_opaque_node()`.
> 
> There are some places where the verification code is
> - missing
> - called twice in row with different methods
> - unnecessarily called
> 
> This patch cleans this up and moves the verification code inside the `TemplateAssertionPredicate` and the `InitializedAssertionPredicate` class.
> 
> #### Details of this Patch
> - Doing a simpler BFS similar to what `ReplaceOpaqueStrideInput::replace()` is doing.
> - Noticed that the new code looks very similar, so I decided to create a dedicated `DataNodeBFS` class which could be reused again in the future to perform a BFS on data nodes.
>   - One can implement the new `BFSActions` interface to define
>     - Whether a node's input should be further visited.
>     - Whether a node is a target node for this BFS.
>     - What action that should be performed with the target node.
>   - Updated `ReplaceOpaqueStrideInput` to use the new `DataNodeBFS/BFSActions` classes.
>   - Implemented a new `OpaqueLoopNodesVerifier` class using `DataNodeBFS/BFSActions` which does the `OpaqueLoop*Node` verification previously done with `assertion_predicate_has_loop_opaque_node()`:
>     - Verify Template Assertion Predicates:
>       - For init value: Only `OpaqueLoopInit`
>       - For last value: Both `OpaqueLoop*Nodes`
>     - Verify Initialized Assertion Predicates:
>       - No `OpaqueLoop*Nodes`
> 
> Thanks,
> Christian

This pull request has now been integrated.

Changeset: 08dfc4a4
Author:    Christian Hagedorn <chagedorn at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/08dfc4a42e58a13a51fb7be2ebfa1c15daea28a9
Stats:     276 lines in 7 files changed: 151 ins; 92 del; 33 mod

8344213: Cleanup OpaqueLoop*Node verification code for Assertion Predicates

Reviewed-by: thartmann, epeter

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

PR: https://git.openjdk.org/jdk/pull/22136


More information about the hotspot-compiler-dev mailing list