RFR: 8346836: C2: Introduce a way to verify the correctness of ConstraintCastNodes at runtime [v3]

Quan Anh Mai qamai at openjdk.org
Wed Jan 22 15:22:48 UTC 2025


On Wed, 22 Jan 2025 08:12:21 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/c2/TestVerifyConstraintCasts.java line 39:
>> 
>>> 37:  * @summary Run with -Xcomp to test -XX:+StressGCM -XX:VerifyConstraintCasts=2 in debug builds.
>>> 38:  *
>>> 39:  * @run main/othervm/timeout=300 -Xbatch -Xcomp -XX:+StressGCM -XX:VerifyConstraintCasts=2 compiler.c2.TestVerifyConstraintCasts
>> 
>> Suggestion:
>> 
>>  * @run main/othervm/timeout=300 -Xbatch -Xcomp -XX:VerifyConstraintCasts=2 compiler.c2.TestVerifyConstraintCasts
>> 
>> I would have left the `StressGCM` out - we already add that in our CI testing for some runs anyway. But I suppose it does not super hurt to have it in either.
>
> What was your reason to put it in?

Even if a `ConstraintCastNode` has a wrong control input, it is normally scheduled later than the control input. Using `-XX:+StressGCM` helps lift the node in the dominator tree, increases the chance a wrong value is successfully observed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22880#discussion_r1925504733


More information about the hotspot-compiler-dev mailing list