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

Daniel Lundén dlunden at openjdk.org
Wed Jan 17 15:10:55 UTC 2024


On Wed, 17 Jan 2024 14:08:03 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> 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.

Same comment here as above, is updating the testing code itself within the scope of this issue?

> 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 + "]").
>     }

When translating the test, I focused only on translating the old ad-hoc IR tests to the IR verification framework. Do we want to extend the scope of this issue to also update the testing code? Mainly, the reason I'm asking is that copies of `TestIntVect.java` appears in many places (e.g., `test/compiler/6340864/TestIntVect.java`), and the testing pattern in particular appears in many places (grep for, e.g., `errn += verify(`). If we update the pattern here, we should probably also update it everywhere else?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17428#discussion_r1455809950
PR Review Comment: https://git.openjdk.org/jdk/pull/17428#discussion_r1455806619


More information about the hotspot-compiler-dev mailing list