RFR: 8298632: [TESTBUG] Add IR checks in jtreg vectorization tests [v4]

Pengfei Li pli at openjdk.org
Fri Jan 13 08:19:05 UTC 2023


> In JDK-8183390, we introduced a new auto-vectorization testing framework in hotspot jtreg tests. The new framework provides us a much simpler way to add new test cases of auto-vectorizable loops. But the previous patch just added a check of the correctness of the result after vectorization. There is no check about whether the code is vectorized or not.
> 
> This patch adds IR checks to verify C2's vectorization ability on test cases inside this framework. With this patch, each test method annotated with `@Test` is verified in two ways. First, it's invoked twice and the return results from the interpreter and C2 compiled code are compared. Second, the count of expected vector IR is checked by the IR framework if the test method has IR rule annotation.
> 
> Ideally, we should check IR rules on all platforms. But in practice, the vectorization ability can be quite different on different platforms, or different generations of CPUs of one platform. So in this patch, we only add vectorizable checks for AArch64. Checks for other platforms (such as x86) can still be added later with more CPU feature conditions. We also add some negative rules (or in-vectorizable rules) with `@IR(failOn=...` on cases that should not be vectorized on any platform.
> 
> A few more test cases are added within this patch as well.
> 
> We tested the new IR rules on below kinds of CPUs.
> - AArch64 w/ 512-bit SVE
> - AArch64 w/ 128-bit SVE
> - AArch64 w/o SVE (NEON only)
> - x86

Pengfei Li has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:

 - Add more exact IR rules
 - Merge branch 'master' into ircheck
 - Update copyright years to 2023
 - Address review comments
 - 8298632: [TESTBUG] Add IR checks in jtreg vectorization tests
   
   In JDK-8183390, we introduced a new auto-vectorization testing framework
   in hotspot jtreg tests. The new framework provides us a much simpler way
   to add new test cases of auto-vectorizable loops. But the previous patch
   just added a check of the correctness of the result after vectorization.
   There is no check about whether the code is vectorized or not.
   
   This patch adds IR checks to verify C2's vectorization ability on test
   cases inside this framework. With this patch, each test method annotated
   with `@Test` is verified in two ways. First, it's invoked twice and the
   return results from the interpreter and C2 compiled code are compared.
   Second, the count of expected vector IR is checked by the IR framework
   if the test method has IR rule annotation.
   
   Ideally, we should check IR rules on all platforms. But in practice, the
   vectorization ability can be quite different on different platforms, or
   different generations of CPUs of one platform. So in this patch, we only
   add vectorizable checks for AArch64. Checks for other platforms (such as
   x86) can still be added later with more CPU feature conditions. We also
   add some negative rules (or in-vectorizable rules) with `@IR(failOn=...`
   on cases that should not be vectorized on any platform.
   
   A few more test cases are added within this patch as well.
   
   We tested the new IR rules on below kinds of CPUs.
   - AArch64 w/ 512-bit SVE
   - AArch64 w/ 128-bit SVE
   - AArch64 w/o SVE (NEON only)
   - x86

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/11687/files
  - new: https://git.openjdk.org/jdk/pull/11687/files/91237524..faa95c53

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=11687&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=11687&range=02-03

  Stats: 21898 lines in 1199 files changed: 12313 ins; 5107 del; 4478 mod
  Patch: https://git.openjdk.org/jdk/pull/11687.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11687/head:pull/11687

PR: https://git.openjdk.org/jdk/pull/11687


More information about the hotspot-compiler-dev mailing list