RFR: 8307513: C2: intrinsify Math.max(long,long) and Math.min(long,long) [v11]

Roland Westrelin roland at openjdk.org
Mon Feb 17 08:47:22 UTC 2025


On Mon, 17 Feb 2025 08:37:56 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

> > I suppose extracting the branch probability from the MethodData and attaching it to the Min/Max nodes is not impossible.
> 
> That is basically what `PhaseIdealLoop::conditional_move` already does, right? It detects the diamond and converts it to `CMove`. We could special case for `min / max`, and then we'd have the probability for the branch, which we could store at the node.

Possibly. We could also create the intrinsic they way it's done in the patch and extract the frequency from the `MethoData` for the min or max methods. The shape of the bytecodes for these methods should be simple enough that it should be feasible.

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

PR Comment: https://git.openjdk.org/jdk/pull/20098#issuecomment-2662424292


More information about the core-libs-dev mailing list