[lworld] RFR: 8376708: [lworld] Missed Ideal optimization around CmpL [v2]
duke
duke at openjdk.org
Mon Feb 23 10:11:55 UTC 2026
On Fri, 20 Feb 2026 10:46:26 GMT, Benoît Maillard <bmaillard at openjdk.org> wrote:
>> This PR adresses a missed optimization in `CmpLNode::Ideal`. It occurs when when we encode a pointer comparison as `CmpL(OrL(left, right), 0L)` (which essentially translates to "both operands are null") during parsing in `do_acmp`, and this comparison can later be folded to a constant in `CmpLNode::Ideal` because one of the operands has a `NotNull` type. This optimization hides behind `can_reshape`, so it can only be carried out during IGVN and not during the initial GVN pass. To fix this, we just need to make sure to add the compare to the worklist during parsing.
>>
>> ### Testing
>> - [x] GitHub Actions
>> - [x] tier1-3, plus some internal testing
>>
>> Thank you for reviewing!
>
> Benoît Maillard has updated the pull request incrementally with one additional commit since the last revision:
>
> Missing IgnoreUnrecognizedVMOptions
@benoitmaillard
Your change (at version 90c7e12e7b8663a979fe697f939178f5a6731ea0) is now ready to be sponsored by a Committer.
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/2145#issuecomment-3943809303
More information about the valhalla-dev
mailing list