RFR: 8349361: C2: RShiftL should support all applicable transformations that RShiftI does [v9]
Emanuel Peter
epeter at openjdk.org
Mon Feb 24 15:46:09 UTC 2025
On Fri, 14 Feb 2025 15:57:54 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.
>
> Roland Westrelin has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 15 additional commits since the last revision:
>
> - review
> - review
> - review
> - Merge branch 'master' into JDK-8349361
> - Update src/hotspot/share/opto/mulnode.cpp
>
> Co-authored-by: Emanuel Peter <emanuel.peter at oracle.com>
> - Update src/hotspot/share/opto/mulnode.cpp
>
> Co-authored-by: Emanuel Peter <emanuel.peter at oracle.com>
> - review
> - Update src/hotspot/share/opto/mulnode.hpp
>
> Co-authored-by: Jasmine Karthikeyan <25208576+jaskarth at users.noreply.github.com>
> - Update src/hotspot/share/opto/mulnode.cpp
>
> Co-authored-by: Jasmine Karthikeyan <25208576+jaskarth at users.noreply.github.com>
> - Update src/hotspot/share/opto/mulnode.cpp
>
> Co-authored-by: Jasmine Karthikeyan <25208576+jaskarth at users.noreply.github.com>
> - ... and 5 more: https://git.openjdk.org/jdk/compare/4ffbd68b...5b05d222
src/hotspot/share/opto/mulnode.cpp line 1351:
> 1349: const Node* and_node = in(1);
> 1350: if (and_node->Opcode() == Op_And(bt) &&
> 1351: (mask_t = phase->type(and_node->in(2))->isa_integer(bt)) &&
Is this an implicit null check?
Style guide:
> Do not use ints or pointers as (implicit) booleans with &&, ||, if, while. Instead, compare explicitly, i.e. if (x != 0) or if (ptr != nullptr), etc.
src/hotspot/share/opto/mulnode.cpp line 1415:
> 1413:
> 1414: return nullptr;
> 1415: }
This is the same code as above, right? As commented above: it would be good to not move it and reduce the size of the diff.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23438#discussion_r1967856470
PR Review Comment: https://git.openjdk.org/jdk/pull/23438#discussion_r1967904048
More information about the hotspot-compiler-dev
mailing list