RFR: 8354282: C2: more crashes in compiled code because of dependency on removed range check CastIIs [v8]
Emanuel Peter
epeter at openjdk.org
Tue Dec 2 15:32:57 UTC 2025
On Tue, 2 Dec 2025 15:17:38 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/opto/castnode.hpp line 108:
>>
>>> 106: // Floating: The Cast is only dependent on the single range check.
>>> 107: // Narrowing: The Cast narrows the type to a positive index. If the input to the Cast is narrower, we can safely
>>> 108: // remove the cast because the array access will be safe.
>>
>> The "Floating" part is a bit counter intuitive here, because the ctrl of the CastII is the RangeCheck, right?
>> So is it not therefore already pinned?
>>
>> Maybe we can add some detail about what the "floating" explicitly means here. Is it that we can later move the CastII up in an optimization?
>
> Actually, I'm wondering if the term `hoistable` and `non-hoistable` would not be better terms...
At least we could say that it is allowed to hoist the RangeCheck, and the CastII could float up to where the RC is hoisted.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24575#discussion_r2581649395
More information about the hotspot-dev
mailing list