RFR: 8349361: C2: RShiftL should support all applicable transformations that RShiftI does

Emanuel Peter epeter at openjdk.org
Tue Feb 4 18:16:20 UTC 2025


On Tue, 4 Feb 2025 13:02:47 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> This change refactors `RShiftI`/`RshiftL` `Ideal`, `Identity` and
> `Value` because the `int` and `long` versions are very similar and so
> there's no logic duplication. In the process, support for some extra
> transformations is added to `RShiftL`. I also added some new test
> cases.

Drive-by code style comment ;)

src/hotspot/share/opto/mulnode.cpp line 1311:

> 1309: }
> 1310: 
> 1311: Node *RShiftNode::IdealIL(PhaseGVN *phase, bool can_reshape, BasicType bt) {

Drive-by: fix position of `*`

src/hotspot/share/opto/mulnode.cpp line 1314:

> 1312:   // Inputs may be TOP if they are dead.
> 1313:   const TypeInteger* t1 = phase->type(in(1))->isa_integer(bt);
> 1314:   if (!t1) return NodeSentinel;        // Left input is an integer

Drive-by: don't use implicit null-check, make comparison with `nullptr` explicit. And add curly braces.

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

Changes requested by epeter (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23438#pullrequestreview-2593673668
PR Review Comment: https://git.openjdk.org/jdk/pull/23438#discussion_r1941676625
PR Review Comment: https://git.openjdk.org/jdk/pull/23438#discussion_r1941677350


More information about the hotspot-compiler-dev mailing list