RFR: 8307513: C2: intrinsify Math.max(long,long) and Math.min(long,long) [v11]
Roland Westrelin
roland at openjdk.org
Mon Feb 17 10:50:22 UTC 2025
On Mon, 17 Feb 2025 10:36:52 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
> I suppose we could write an optimization that can hoist out loop independent if-diamonds out of a loop. If the condition and all phi inputs are loop invariant, you could just cut the diamond out of the loop, and paste it before the loop entry.
Right. But, it would likely not optimize as well. The new optimization will possibly have heuristics to limit complexity so could be limited. The diamond could be transformed to something else by some other optimization before it gets a chance to get hoisted. There are likely other optimizations that apply to floating nodes that would still not apply: for instance, `MinL`/`MaxL` can be split thru phi even if the `min` call is not right after the merge point. With branches that's not true. Also, with more compexity comes more bugs.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20098#issuecomment-2662733218
More information about the core-libs-dev
mailing list