RFR: 8351280: Mark Assertion Predicates useless instead of replacing them by a constant directly

Christian Hagedorn chagedorn at openjdk.org
Fri Mar 7 09:23:53 UTC 2025


On Fri, 7 Mar 2025 09:00:00 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/opaquenode.cpp line 154:
>> 
>>> 152:   _useless = true;
>>> 153:   igvn._worklist.push(this);
>>> 154: }
>> 
>> Here you directly push to worklist. And for `OpaqueTemplateAssertionPredicateNode` you seem to do it at the call-site. We should probably unify this. If you want to push inside `mark_useless`, then you should probably adjust the code for `OpaqueMultiversioning` as well.
>
> Pushing inside of `mark_useless` has the advantage that one cannot forget pushing.

Forgot to comment on that. With the next PR, I'm updating the elimination of Template Assertion Predicates and thus require to call `mark_useless()` in a first step to mark them all useless. Afterwards, I'm marking those non-useless again that can be found from loops. Thus, we do not want to always add all nodes to the worklist when calling `mark_useless()` if they are not going to be removed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23941#discussion_r1984720518


More information about the hotspot-compiler-dev mailing list