RFR: 8282365: Optimize divideUnsigned and remainderUnsigned for constants [v25]

Quan Anh Mai qamai at openjdk.org
Fri Oct 6 17:54:31 UTC 2023


On Fri, 6 Oct 2023 07:19:09 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   require x64
>
> test/hotspot/jtreg/compiler/integerArithmetic/DivisionByConstant.java line 95:
> 
>> 93:             test.setDefaultWarmup(1);
>> 94:             test.addFlags("-DiDiv=" + iDiv, "-Di1=" + i1, "-Di2=" + i2,
>> 95:                     "-DlDiv=" + lDiv, "-Dl1=" + l1, "-Dl2=" + l2);
> 
> Does this really change the constants in every run? Is the `static` block above that parses the arguments really called more than one time? Maybe the `TestFramework` does some magic here. Do you know how that works?

The `TestFramework` spawns a separate VM for each `start` invocation so each will have its own set of `static final` variables. I have added a verification method to assert the validity of this approach.

> test/hotspot/jtreg/compiler/integerArithmetic/DivisionByConstant.java line 184:
> 
>> 182: 
>> 183:     @Test
>> 184:     @IR(failOn = IRNode.DIV)
> 
> Can you maybe also add some methods with IR rules that actually have present `IRNode.DIV` etc, just as a control test?

Done

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

PR Review Comment: https://git.openjdk.org/jdk/pull/9947#discussion_r1349150506
PR Review Comment: https://git.openjdk.org/jdk/pull/9947#discussion_r1349149415


More information about the hotspot-compiler-dev mailing list