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:46 UTC 2025


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

>> Quan Anh Mai has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   move test to a new file, add block_comment
>
> src/hotspot/share/opto/c2_globals.hpp line 672:
> 
>> 670:           "have more verification coverage")                                \
>> 671:           range(0, 2)                                                       \
>> 672:                                                                             \
> 
> Nit: I think the alignment could be a little improved, maybe also the comments.
> Here a quick draft:
> 
> Suggestion:
> 
>   develop(uint, VerifyConstraintCasts, 0,                                   \
>           "Perform runtime checks to verify the value of a ConstraintCast " \
>           "lies inside its type"                                            \
>           "0: No verification."                                             \
>           "1: Verify (types are widened, same as without verification)."  \
>           "2: Verify, where types are not widened, for better  " \
>           "   verification coverage"). \
>           range(0, 2)                                                       \
>                                                                             \
> 
> I'm too lazy to fix the alignment of the ``. This here is just a suggestion, I leave it up to you in the end ;)

Done, I believe the common theme in this file is to use `=` to signify the meanings of different values of the same variable while `:` is to signify the meanings of different variables.

E.g:

      develop(uint, VerifyIterativeGVN, 0,                                      \
              "Verify Iterative Global Value Numbering"                         \
              "=XY, with Y: verify Def-Use modifications during IGVN"           \
              "          X: verify that type(n) == n->Value() after IGVN"       \
              "X and Y in 0=off; 1=on")                                         \
              constraint(VerifyIterativeGVNConstraintFunc, AtParse)             \

> src/hotspot/share/opto/castnode.cpp line 528:
> 
>> 526:   }
>> 527: 
>> 528:   // Keep these casts for verification
> 
> You could write about `VerifyConstraintCasts` with its 2 modes, and say why they are both useful.

Done

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

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


More information about the hotspot-compiler-dev mailing list