RFR: 8352020: [CompileFramework] enable compilation for VectorAPI
Emanuel Peter
epeter at openjdk.org
Tue Mar 18 06:59:07 UTC 2025
On Mon, 17 Mar 2025 20:21:17 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> During work on [JDK-8344942](https://bugs.openjdk.org/browse/JDK-8344942) I discovered that it is currently not possible to compile VectorAPI code because it is still in incubator mode and needs flag "--add-modules=jdk.incubator.vector" for "javac".
>>
>> Also: "javac" can produce warnings, and that leads to issues like this: [JDK-8351998](https://bugs.openjdk.org/browse/JDK-8351998). We should allow such warnings, they are not compile failures.
>>
>> Example:
>>
>> javac --add-modules=jdk.incubator.vector Test.java
>> warning: [incubating] using incubating module(s): jdk.incubator.vector
>> 1 warning
>>
>>
>> I added an example test as well.
>
> test/hotspot/jtreg/testlibrary_tests/compile_framework/examples/IRFrameworkWithVectorAPIExample.java line 45:
>
>> 43: /**
>> 44: * This test shows that the IR verification can be done on code compiled by the Compile Framework.
>> 45: * The "@compile" command for JTREG is required so that the IRFramework is compiled, other javac
>
> What about a `CompileFilework::invokeIRTest()` or something like that, that just additionally loads the `TestFramework` class somehow (for example just creating an instance or accessing a field etc., we could also provide an empty static method in `TestFramework.java` that can be called to minimize the overhead), would that work? Then we do not need to worry about adding `@compile` or figuring out why the IR test is not working.
Maybe... but is this kind of magic really worth it? It would also mean that any `CompileFraework` test always loads the `TestFramework`. And if we decide to do this, I think it would be a separate RFE, since I'm just copying from `test/hotspot/jtreg/testlibrary_tests/compile_framework/examples/IRFrameworkJavaExample.java` here ;)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24082#discussion_r2000332758
More information about the hotspot-compiler-dev
mailing list