RFR: 8273454: C2: Transform (-a)*(-b) into a*b [v4]

Zhengyu Gu zgu at openjdk.java.net
Wed Sep 15 15:48:53 UTC 2021


On Tue, 14 Sep 2021 06:49:50 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Zhengyu Gu has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fix node in place instead of creating new node
>
> src/hotspot/share/opto/mulnode.cpp line 70:
> 
>> 68:   Node *in2 = in(2);
>> 69:   if (in1->is_Sub() && in2->is_Sub()) {
>> 70:     Node* n11 = in1->in(1);
> 
> For consistency with below code, I would name the local `in11` or simply use `phase->type(in1->in(1))` because it's the only user.

Fixed

> test/hotspot/jtreg/compiler/integerArithmetic/TestNegMultiply.java line 26:
> 
>> 24: /**
>> 25:  * @test
>> 26:  * @bug 8273454
> 
> The test needs `* @key randomness`

Done

> test/hotspot/jtreg/compiler/integerArithmetic/TestNegMultiply.java line 36:
> 
>> 34: 
>> 35: public class TestNegMultiply {
>> 36:     private static Random random = new Random();
> 
> You should use `Utils.getRandomInstance()` from `jdk.test.lib.Utils` to ensure that the seed is printed for reproducibility. You can check other tests for an example.

Done

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

PR: https://git.openjdk.java.net/jdk/pull/5403


More information about the hotspot-compiler-dev mailing list