RFR: 8334078: RISC-V: TestIntVect.java fails after JDK-8332153 when running without RVV

Gui Cao gcao at openjdk.org
Sat Jun 15 06:53:11 UTC 2024


On Fri, 14 Jun 2024 17:26:34 GMT, Hamlin Li <mli at openjdk.org> wrote:

> Yes, rv* is much better, I'm OK with this renaming.
> 
> At the same time, can you fix `WHITE_BOX.getCPUFeatures()` with `CPUInfo.getFeatures()` in IREncodingPrinter.java? As I think it's the final fix for this kind of issue. As I said, with a `String.contains(xxx)`, it could fail with other cpu features in the future, as it mixes all cpu features in one long string, and there is no guarantee the similar issue will not happen again.

When I modify it this way, x86 fastdebug has some errors.
``` diff
diff --git a/test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java b/test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java
index 73943db3f53..03eba7c6c2c 100644
--- a/test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java
+++ b/test/hotspot/jtreg/compiler/lib/ir_framework/test/IREncodingPrinter.java
@@ -29,6 +29,7 @@
 import compiler.lib.ir_framework.shared.*;
 import jdk.test.lib.Platform;
 import jdk.test.whitebox.WhiteBox;
+import jdk.test.whitebox.cpuinfo.CPUInfo;
 
 import java.lang.reflect.Method;
 import java.nio.ByteOrder;
@@ -416,7 +417,7 @@ private boolean checkCPUFeature(String feature, String value) {
             TestFormat.failNoThrow("Provided incorrect value for feature " + feature + failAt());
             return false;
         }
-        String cpuFeatures = WHITE_BOX.getCPUFeatures();
+        List<String> cpuFeatures = CPUInfo.getFeatures();
         return (trueValue && cpuFeatures.contains(feature)) || (falseValue && !cpuFeatures.contains(feature));
     }
 



cpu info:

processor	: 127
vendor_id	: GenuineIntel
cpu family	: 6
model		: 106
model name	: Intel(R) Xeon(R) Platinum 8378C CPU @ 2.80GHz
stepping	: 6
microcode	: 0x1
cpu MHz		: 2799.998
cache size	: 58368 KB
physical id	: 1
siblings	: 64
core id		: 31
cpu cores	: 32
apicid		: 127
initial apicid	: 127
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves wbnoinvd arat avx512vbmi umip avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq fsrm md_clear arch_capabilities
bugs		: spectre_v1 spectre_v2 spec_store_bypass swapgs mmio_stale_data eibrs_pbrsb
bogomips	: 5599.99
clflush size	: 64
cache_alignment	: 64
address sizes	: 42 bits physical, 48 bits virtual
power management:


error message:

8) Method "public static void compiler.loopopts.superword.TestDependencyOffsets.testLongP7(long[])" - [Failed IR rules: 1]:
   * @IR rule 4: "@compiler.lib.ir_framework.IR(phase={DEFAULT}, applyIfPlatformAnd={}, applyIfCPUFeatureOr={}, counts={"_#V#LOAD_VECTOR_L#_", "> 0", "_#V#ADD_VL#_", "> 0", "_#STORE_VECTOR#_", "> 0"}, applyIfPlatformOr={}, applyIfPlatform={}, failOn={}, applyIfOr={}, applyIfCPUFeatureAnd={"avx2", "true", "avx512", "false"}, applyIf={}, applyIfCPUFeature={}, applyIfAnd={"AlignVector", "true", "MaxVectorSize", ">= 16"}, applyIfNot={})"
     > Phase "PrintIdeal":
       - counts: Graph contains wrong number of nodes:
         * Constraint 1: "(\\d+(\\s){2}(LoadVector.*)+(\\s){2}===.*vector[A-Za-z]\[8\]:\{long\})"
           - Failed comparison: [found] 0 > 0 [given]
           - No nodes matched!
         * Constraint 2: "(\\d+(\\s){2}(AddVL.*)+(\\s){2}===.*vector[A-Za-z]\[8\]:\{long\})"
           - Failed comparison: [found] 0 > 0 [given]
           - No nodes matched!

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


I think we modified it by use CPUInfo.getFeatures() instead of WHITE_BOX.getCPUFeatures(), machine cpu doesn't show avx512, but it seems he has avx512f, avx512dq, etc., and may be using avx512xx when he actually runs it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19686#discussion_r1640824142


More information about the hotspot-dev mailing list