RFR: 8369167: C2: refactor LShiftINode/LShiftLNode Value/Identity/Ideal [v2]

Roland Westrelin roland at openjdk.org
Thu Oct 16 07:26:26 UTC 2025


On Tue, 14 Oct 2025 09:19:33 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:

>>> An idea (not a suggestion, just something that crossed my mind, take it more as a thought experiment): we could also parametrize everything not with a `BasicType` parameter but a template parameter (since `IdealIL` and co are invoked with literal values). It wouldn't change much, but for instance it would allow to replace the assert in `java_shift_left` and friends with static checks (I have a bias toward static checks).
>> 
>> I wondered about that too. There are many more methods that are parameterized by a `BasicType`. They would have to all go through that transition.
>
>> They would have to all go through that transition.
> 
> For consistency yes. But yet, I think I recall some functions that are not called with a compile-time constant, so we can't do that everywhere. Technically, calling a function that takes it as parameter from the templated version, and just passing our template argument is fine. What is not (easily) possible is normal parameter -> template. But again, that was just "for fun".

@marc-chevalier @eme64 thanks for the reviews.

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

PR Comment: https://git.openjdk.org/jdk/pull/27725#issuecomment-3409531060


More information about the hotspot-compiler-dev mailing list