RFR: 8352020: [CompileFramework] enable compilation for VectorAPI

Christian Hagedorn chagedorn at openjdk.org
Mon Mar 17 20:27:13 UTC 2025


On Mon, 17 Mar 2025 15:53:17 GMT, Emanuel Peter <epeter 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.

Otherwise, it looks good to me, too.

test/hotspot/jtreg/compiler/lib/compile_framework/Compile.java line 200:

> 198: 
> 199:         // Note: the output can be non-empty even if the compilation succeeds, e.g. for warnings.
> 200:         if (exitCode != 0) {

Would `-XX:-PrintWarnings` also work?

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.

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

PR Review: https://git.openjdk.org/jdk/pull/24082#pullrequestreview-2691878964
PR Review Comment: https://git.openjdk.org/jdk/pull/24082#discussion_r1999546090
PR Review Comment: https://git.openjdk.org/jdk/pull/24082#discussion_r1999551575


More information about the hotspot-compiler-dev mailing list