RFR: 8278114: New addnode ideal optimization: converting "x + x" into "x << 1" [v9]
Claes Redestad
redestad at openjdk.java.net
Tue Jan 4 20:26:09 UTC 2022
On Sun, 19 Dec 2021 20:28:07 GMT, Zhiqiang Zang <duke at openjdk.java.net> wrote:
>> A new ideal optimization can be introduced for addnode: converting "x + x" into "x << 1".
>>
>>
>> // Convert "x + x" into "x << 1"
>> if (in1 == in2) {
>> return new LShiftINode(in1, phase->intcon(1));
>> }
>
> Zhiqiang Zang has updated the pull request incrementally with three additional commits since the last revision:
>
> - refactor the ir test.
> - rename tests.
> - use compiler mode blackhole in microbenchmark to prevent function calling from dominating time.
Looks good. The further microbenchmark improvements suggested by @merykitty makes a lot of sense given the context.
The comment about compiler blackhole is becoming a bit redundant with the upgrade to JMH 1.34 (#6955), which enables the compiler assisted blackholes by default.
-------------
Marked as reviewed by redestad (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/6675
More information about the hotspot-compiler-dev
mailing list