RFR: 8254317: C2: Resource consumption of ConvI2LNode::Ideal() grows exponentially [v2]

Roberto Castañeda Lozano rcastanedalo at openjdk.java.net
Thu Oct 22 09:07:15 UTC 2020


On Thu, 22 Oct 2020 03:32:48 GMT, eric.1iu <github.com+10482586+erik1iu at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/conversions/TestMoveConvI2LThroughAddIs.java line 38:
>> 
>>> 36:  *          the short specified timeout.
>>> 37:  * @library /test/lib /
>>> 38:  * @run main/othervm -Xcomp -XX:-TieredCompilation -XX:-Inline
>> 
>> For future tests writing.
>> In general we should avoid using -Xcomp because it does not provide profiling information to C2 and it may generate unexpected code because branches frequencies are not known.
>> Preferable way is warm up test method by calling it in a loop enough times to make sure it is compiled and then verify results outside test method.
>> Then you don't need -XX:CompileOnly command.
>
> Without -Xcomp, the final code would not the same as expected, lots of branches have been optimized with profiling data which we **do** normally used. 
> 
> I wonder whether it's feasible to create such a test case that grows exponentially with profiling data. I think that may decriable the issue more realistic.

Thanks for the feedback! The goal of these test cases is to exercise the logic in `ConvI2LNode::Ideal()` in a way as isolated as possible from the rest of the JVM, for simplicity, reproducibility, and ease of debugging. I will rewrite them to verify the results outside the test method. I will see if I can get rid of `-Xcomp` and `-XX:CompileOnly` without making them too complex. If that does not work, I will try to construct another test case as suggested by @erik1iu .

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

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


More information about the hotspot-compiler-dev mailing list