RFR: 8291809: Convert compiler/c2/cr7200264/TestSSE2IntVect.java to IR verification test [v2]

Christian Hagedorn chagedorn at openjdk.org
Wed Jan 17 14:11:53 UTC 2024


On Wed, 17 Jan 2024 10:03:06 GMT, Daniel Lundén <dlunden at openjdk.org> wrote:

>> This changeset translates the tests in `compiler/c2/cr7200264/` to use the IR verification framework.
>> 
>> The proposed translation, to the extent possible, attempts to preserve the semantics of the original test. A major difference is that the IR checks are now local (for every `test_*` method) instead of global. The execution time of the new test is comparable to the old test.
>> 
>> Testing:
>> - [GitHub Actions](https://github.com/dlunde/jdk/actions/runs/7553846710)
>> - Ran the new translated tests within all tier1 through tier10 contexts on windows-x64, linux-x64, linux-aarch64, macosx-x64, and macosx-aarch64.
>> - Tested that manually adding `-XX:LoopUnrollLimit=0` to the test framework flags caused the translated tests to fail. Note: it is, however, no longer possible to break the test by passing `-XX:LoopUnrollLimit=0` on the command line.
>
> Daniel Lundén has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Refactor test to use multiple @Test

test/hotspot/jtreg/compiler/c2/cr7200264/TestIntVect.java line 64:

> 62:     public void run() {
> 63: 
> 64:         System.out.println("Testing Integer vectors");

Not sure if it's worth to keep these printing statements. But does not hurt either to leave them in.

test/hotspot/jtreg/compiler/c2/cr7200264/TestIntVect.java line 155:

> 153:             test_addc(a0, a1);
> 154:             for (int i=0; i<ARRLEN; i++) {
> 155:                 errn += verify("test_addc: ", i, a0[i], (int)((int)(ADD_INIT+i)+VALUE));

I suggest to either directly use:

Asserts.assertEQ(a0[i],  (int)((int)(ADD_INIT+i)+VALUE), "test_addc failed at a0[" + i + "]");

Or change `verify()` such that it uses `Asserts.assertEQ()` (just an example and could also be adjusted):

    static int verify(String text, int i, int elem, int val) {
        Asserts.assertEQ(elem, val, text + " failed at a0[" + i + "]").
    }

test/hotspot/jtreg/compiler/c2/cr7200264/TestIntVect.java line 510:

> 508:     }
> 509: 
> 510:     void test_divc(int[] a0, int[] a1) {

What about these tests without IR verification? Are they expected to be not vectorized?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17428#discussion_r1455657566
PR Review Comment: https://git.openjdk.org/jdk/pull/17428#discussion_r1455622323
PR Review Comment: https://git.openjdk.org/jdk/pull/17428#discussion_r1455653160


More information about the hotspot-compiler-dev mailing list