RFR: 8350578: Refactor useless Parse and Template Assertion Predicate elimination code by using a PredicateVisitor
Christian Hagedorn
chagedorn at openjdk.org
Fri Mar 14 10:02:54 UTC 2025
On Thu, 13 Mar 2025 16:27:05 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> src/hotspot/share/opto/cfgnode.hpp line 508:
>>
>>> 506: void mark_maybe_useful();
>>> 507: bool is_useful() const;
>>> 508: void mark_useful();
>>
>> Needed to move these definitions to the source file because I cannot include `predicates.hpp` here due to circular dependencies. I solved this by forward declaring `PredicateState` and moving the definitions to the source file.
>>
>> Same for these methods for `OpaqueTemplateAssertionPredicate` further down.
>
> Can you add `predicates.inline.hpp` for this?
Do you mean the enum definition for `PredicateState`? That could work, so I can just include that header when I need to use the enum. Should I then rather name the `hpp` file something like `predicates_enums.hpp`? IIUC, `xyz.inline.hpp` should be used primarily for inline methods.
Having the separate enum header also allows us to put this one there which makes things cleaner:
https://github.com/openjdk/jdk/blob/e3c29c9e6cff7648952c0ba359b0763a0ea8da18/src/hotspot/share/opto/predicates.hpp#L203-L211
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24013#discussion_r1995268997
More information about the hotspot-compiler-dev
mailing list