RFR: 8366815: C2: Delay Mod/Div by constant transformation

Emanuel Peter epeter at openjdk.org
Mon Dec 15 09:17:53 UTC 2025


On Mon, 15 Dec 2025 09:09:51 GMT, Hannes Greule <hgreule at openjdk.org> wrote:

>> @iwanowww I see, so we could implement something like a `CastII` with multiple inputs, which we know must all be identical at runtime. The first input is the one we will in the end pick. But during `Value`, we take the intersection of all input ranges. So if another (not the first input) has a narrower type, we can use that type. I suppose that would be feasible. Do you have a good name for such a node?
>> 
>> What I don't know: how does that interact with other IGVN optimizations, especially those that want to pattern match specific nodes? Inserting such special cast nodes could interrupt `Ideal` optimizations, current pattern matching would not know how to deal with it. Probably it is not a big issue, but I'm not sure.
>
> @eme64 do you want me to merge master? I guess re-running tests then wouldn't hurt either.

@SirYwell Yeah, this is now quite old. Why don't you merge with master and let the GitHub actions run for now.

Maybe someone has more comments on this now: speak up!

I can run tests once GitHub actions are passing ;)

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

PR Comment: https://git.openjdk.org/jdk/pull/27886#issuecomment-3654567133


More information about the hotspot-compiler-dev mailing list