RFR: 8288022: c2: Transform (CastLL (AddL into (AddL (CastLL when possible [v2]
Roland Westrelin
roland at openjdk.org
Wed Jul 6 07:21:38 UTC 2022
> 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.
Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
Update test/hotspot/jtreg/compiler/c2/irTests/TestPushAddThruCast.java
Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/9139/files
- new: https://git.openjdk.org/jdk/pull/9139/files/5579e664..80577689
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=9139&range=01
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=9139&range=00-01
Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
Patch: https://git.openjdk.org/jdk/pull/9139.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/9139/head:pull/9139
PR: https://git.openjdk.org/jdk/pull/9139
More information about the hotspot-compiler-dev
mailing list