RFR: 8287801: Fix test-bugs related to stress flags [v2]

Tobias Hartmann thartmann at openjdk.org
Mon Jun 20 12:56:57 UTC 2022


On Mon, 20 Jun 2022 10:45:57 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> I recently ran many tests with additional stress flags. While there were a few bugs I found, most of the issues were test bugs.
>> 
>> I found a list of tests that are problematic with specific stress flags, I adjusted the tests so that they can now be run with the flag. Often I just fix the flag at the default value, so that setting it from the outside does not affect the test.
>> 
>> Below I explain for each test how and why I adjusted the test.
>> 
>> - test/hotspot/jtreg/compiler/arraycopy/TestArrayCopyNoInitDeopt.java
>>   - Problem Flags: `-XX:+UnlockExperimentalVMOptions -XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0`
>>     - Disabling traps by setting limit of traps to zero, means some optimistic optimizations are not made, and can therefore not lead to deoptimization. The test expects deoptimization due to traps, so we need to have them on.
>> - test/hotspot/jtreg/compiler/c2/cr7200264/TestDriver.java
>>   - used by TestSSE2IntVect.java and TestSSE4IntVect.java
>> - test/hotspot/jtreg/compiler/c2/cr7200264/TestSSE2IntVect.java
>>   - Problem Flags: `-XX:StressLongCountedLoop=2000000`
>>     - Test checks the IR, and if we convert loops to long loops, some operations will not show up anymore, the test fails. Disable StressLongCountedLoop.
>> - test/hotspot/jtreg/compiler/c2/cr7200264/TestSSE4IntVect.java
>>   - See TestSSE2IntVect.java
>> - test/hotspot/jtreg/compiler/c2/irTests/blackhole/BlackholeStoreStoreEATest.java
>>   - Problem Flags: `-XX:-UseTLAB`
>>     - No thread local allocation (TLAB) means IR is changed. Test checks for MemBarStoreStore, which is missing without TLAB. Solution: always have TLAB on.
>> - test/hotspot/jtreg/compiler/cha/AbstractRootMethod.java
>>   - Problem Flags: `-XX:+StressMethodHandleLinkerInlining`
>>     - Messes with recompilation, makes assert fail that expects recompilation. Must disable flag.
>> - test/hotspot/jtreg/compiler/cha/DefaultRootMethod.java
>>   - see AbstractRootMethod.java
>> - test/hotspot/jtreg/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java
>>   - Problem Flags: `-XX:+UnlockExperimentalVMOptions -XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0`
>>     - Need traps, otherwise some optimistic optimisations are not made, and then they also are not trapped and deoptimized.
>>   - Problem Flags: `-XX:TypeProfileLevel=222`
>>     - Profiling also messes with optimizations / deoptimization.
>>   - Problem Flags: `-XX:+StressReflectiveCode`
>>     - Messes with types at allocation, which messes with optimizations.
>>   - Problem Flags: `-XX:-UncommonNullCast`
>>     - Is required for trapping in null checks.
>>   - Problem Flags: `-XX:+StressMethodHandleLinkerInlining`
>>     - Messes with inlining / optimization - turn it off.
>> - test/hotspot/jtreg/compiler/jvmci/compilerToVM/IsMatureVsReprofileTest.java
>>   - Problem Flags: `-XX:Tier4BackEdgeThreshold=1 -Xbatch -XX:-TieredCompilation`
>>   - Lead to OSR compilation in loop calling `testMethod`, which is expected to be compiled. But with the OSR compilation, that function is inlined, and never compiled. Solution was to make sure we only compile `testMethod`.
>> - test/hotspot/jtreg/compiler/jvmci/compilerToVM/ReprofileTest.java
>>   - Problem Flags: `-XX:TypeProfileLevel=222`
>>     - Changing profile flags messes with test, which assumes default behavior.
>> - test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java
>>   - Problem Flags: `-XX:+UnlockExperimentalVMOptions -XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0`
>>     - Need traps to check for optimistic optimizations.
>> - test/hotspot/jtreg/compiler/rangechecks/TestExplicitRangeChecks.java
>>   - Problem Flags: `-XX:+UnlockExperimentalVMOptions -XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0`
>>     - Need traps to check for optimistic optimizations.
>> - test/hotspot/jtreg/compiler/rangechecks/TestLongRangeCheck.java
>>   - Problem Flags: `-XX:+UnlockExperimentalVMOptions -XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0`
>>     - Need traps to check for optimistic optimizations.
>> - test/hotspot/jtreg/compiler/rangechecks/TestRangeCheckSmearing.java
>>   - Problem Flags: `-XX:TieredStopAtLevel=3 -XX:+StressLoopInvariantCodeMotion`
>>     - Test expects to be run at compilation tier 4 / C2, so must fix it at that in requirement.
>> - test/hotspot/jtreg/compiler/uncommontrap/Decompile.java
>>   - Problem Flags: `-XX:+UnlockExperimentalVMOptions -XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0 -XX:PerBytecodeTrapLimit=0`
>>   -   The tests if we trap and decompile after we call member functions of a class that we did not use before. If we disable traps, then internally it uses a virtual call, and no deoptimization is required - but the test expects trapping and deoptimization. Solution: set trap limits to default.
>>   - Problem Flags: `-XX:TypeProfileLevel=222`
>>   -   Changing profiling behavior also messes with deoptimization - disable it.
>> - test/hotspot/jtreg/compiler/uncommontrap/TestUnstableIfTrap.java
>>   - Problem Flags: `-XX:+UnlockExperimentalVMOptions -XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0`
>>     - Test expects traps, so we must ensure the limits are at default.
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   adding IgnoreUnrecognizedVMOptions to some test files, so product builds do not fail with debug flags

Marked as reviewed by thartmann (Reviewer).

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

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


More information about the hotspot-compiler-dev mailing list