JDK-8365841 : RISC-V: Several IR verification tests fail after JDK-8350960 without Zvfh
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: riscv
  • Submitted: 2025-08-20
  • Updated: 2025-08-26
  • Resolved: 2025-08-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25 JDK 26
25.0.2Fixed 26 b12Fixed
Related Reports
Relates :  
Description
The error in both cases is caused by the same reason: the target IR, MulReductionVI, is not matched.
This is because the match_rule_supported_vector in riscv_v.ad is missing a break. If the if condition in `case MulReductionVI` evaluates to false, the loop will not exit until the `return UseZvfh`.

Failed IR tests:
compiler/loopopts/superword/ProdRed_Int.java
compiler/loopopts/superword/RedTest_int.java

Error log of ProdRed_Int.java:
```
One or more @IR rules failed:

Failed IR Rules (1) of Methods (1)
----------------------------------
1) Method "public static int compiler.loopopts.superword.ProdRed_Int.prodReductionImplement(int[],int[],int)" - [Failed IR rules: 1]:
   * @IR rule 3: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#MUL_REDUCTION_VI#_", ">= 1", "_#MUL_REDUCTION_VI#_", "<= 2"}, failOn={}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={"rvv", "true"}, applyIfAnd={"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"}, applyIfNot={})"
     > Phase "PrintIdeal":
       - counts: Graph contains wrong number of nodes:
         * Constraint 1: "(\\d+(\\s){2}(MulReductionVI.*)+(\\s){2}===.*)"
           - Failed comparison: [found] 0 >= 1 [given]
           - No nodes matched!

>>> Check stdout for compilation output of the failed methods

One or more @IR rules failed:

Failed IR Rules (1) of Methods (1)
----------------------------------
1) Method "public static int compiler.loopopts.superword.ProdRed_Int.prodReductionImplement(int[],int[],int)" - [Failed IR rules: 1]:
   * @IR rule 3: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#MUL_REDUCTION_VI#_", ">= 1", "_#MUL_REDUCTION_VI#_", "<= 2"}, failOn={}, applyIfPlatform={}, applyIfPlatformOr={}, applyIfOr={}, applyIfCPUFeatureAnd={}, applyIf={}, applyIfCPUFeature={"rvv", "true"}, applyIfAnd={"SuperWordReductions", "true", "LoopMaxUnroll", ">= 8"}, applyIfNot={})"
     > Phase "PrintIdeal":
       - counts: Graph contains wrong number of nodes:
         * Constraint 1: "(\\d+(\\s){2}(MulReductionVI.*)+(\\s){2}===.*)"
           - Failed comparison: [found] 0 >= 1 [given]
           - No nodes matched!

>>> Check stdout for compilation output of the failed methods
```

Comments
[jdk25u-fix-request] Approval Request from Dingli Zhang Same issue exists in jdk25u repo as well. Backport to fix the IR verification test failure when running with linux-riscv64 fastdebug builds. This is a RISC-V specific change, should be low risk.
21-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk25u/pull/122 Date: 2025-08-21 01:27:00 +0000
21-08-2025

Changeset: 2e06a917 Branch: master Author: Dingli Zhang <dzhang@openjdk.org> Committer: Fei Yang <fyang@openjdk.org> Date: 2025-08-21 01:20:16 +0000 URL: https://git.openjdk.org/jdk/commit/2e06a917659d76fa1b4c63f38894564679209625
21-08-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/26854 Date: 2025-08-20 07:01:59 +0000
20-08-2025