RFR: 8324655: Identify integer minimum and maximum patterns created with if statements [v6]
Emanuel Peter
epeter at openjdk.org
Thu Mar 7 08:51:58 UTC 2024
On Thu, 7 Mar 2024 08:38:42 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Jasmine Karthikeyan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Change transform to work on CMoves
>
> src/hotspot/share/opto/movenode.cpp line 189:
>
>> 187:
>> 188: // Try to identify min/max patterns in CMoves
>> 189: static Node* is_minmax(PhaseGVN* phase, Node* cmov) {
>
> I'm not a fan of `is_...` methods that do more than a check, but actually have a side-effect.
> I also suggest that `cmov` should already have a `CMovNode` type, and there should be an assert here.
>
> I would probably do it similar to `AddNode::IdealIL` and `AddPNode::Ideal_base_and_offset`: call it `CMoveNode::IdealIL_minmax`. But add an assert to check for int or long.
And then you could actualy move the call to `CMoveNode::Ideal`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17574#discussion_r1515761304
More information about the hotspot-compiler-dev
mailing list