RFR: 8288022: c2: Transform (CastLL (AddL into (AddL (CastLL when possible
Roland Westrelin
roland at openjdk.java.net
Tue Jun 14 07:02:49 UTC 2022
On Mon, 13 Jun 2022 08:26:47 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> This implements a transformation that already exists for CastII and
> ConvI2L and helps code generation. The tricky part is that:
>
> (CastII (AddI into (AddI (CastII
>
> is performed by first computing the bounds of the type of the AddI. To
> protect against overflow, jlong variables are used. With CastLL/AddL
> nodes there's no larger integer type to promote the bounds to. As a
> consequence the logic in the patch explicitly tests for overflow. That
> logic is shared by the int and long cases. The previous logic for the
> int cases that promotes values to long is used as verification.
>
> This patch also widens the type of CastLL nodes after loop opts the
> way it's done for CastII/ConvI2L to allow commoning of nodes.
>
> This was observed to help with Memory Segment micro benchmarks.
Commenting because RFR email didn't go out
-------------
PR: https://git.openjdk.org/jdk/pull/9139
More information about the hotspot-compiler-dev
mailing list