RFR: 8373396: Min and Max Ideal missing AddNode::Ideal optimisations

Emanuel Peter epeter at openjdk.org
Fri Dec 12 17:16:54 UTC 2025


On Fri, 12 Dec 2025 16:45:31 GMT, Galder Zamarreño <galder at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/c2/irTests/TestMinMaxIdeal.java line 30:
>> 
>>> 28:  * @modules java.base/jdk.internal.misc
>>> 29:  * @library /test/lib /
>>> 30:  * @run driver compiler.c2.irTests.TestMinMaxIdeal
>> 
>> Suggestion:
>> 
>>  * @run driver ${test.main.class}
>> 
>> Also: please don't put any new tests in `irTests`. Rather put it in a directory based on the topic.
>
> I did think about that but then I saw `TestMinMaxIdentities` was on the package so thought of adding it next to it. What about putting it in `compiler.intrinsics.math` instead?

I think it belongs more under idealization. So either a `gvn` or `igvn` directory.

>> test/hotspot/jtreg/compiler/c2/irTests/TestMinMaxIdeal.java line 56:
>> 
>>> 54:         String templatedPackage ="compiler.c2.templated";
>>> 55:         String templatedClassName ="MinMaxIdeal";
>>> 56:         String templatedFQN = "%s.%s".formatted(templatedPackage, templatedClassName);
>> 
>> That looks a bit convoluted. Why not just use the final string?
>
> Not sure exactly what you mean. For `addJavaSourceCode` I need the combined FQN and for `TestFrameworkClass.render` I need the classname and package separated.

It is just a nit, I leave it to you. I'm also fine taking it as is :)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28770#discussion_r2614991145
PR Review Comment: https://git.openjdk.org/jdk/pull/28770#discussion_r2614992970


More information about the hotspot-compiler-dev mailing list