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:42:42 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> 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`.
Who knows, maybe we one day extend this to other types
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17574#discussion_r1515761693
More information about the hotspot-compiler-dev
mailing list