Integrated: 8334650: Add debug information about whether an Assertion Predicate is for the init or last value

Christian Hagedorn chagedorn at openjdk.org
Wed Jun 26 07:12:14 UTC 2024


On Mon, 24 Jun 2024 12:23:56 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> It is sometimes hard to see if an Assertion Predicate is about the init or the last value of a range check. This patch therefore adds debugging information when dumping an Assertion Predicate node to tty or for IGV:
> 
> Template Assertion Predicate:
> 
>  292  Opaque4  === _ 291 25  [[ 295 ]]  !orig=[174]
>  293  IfTrue  === 295  [[ 401 ]] #1 !orig=[176]
>  294  IfFalse  === 295  [[ 297 ]] #0 !orig=[177]
>  295  RangeCheck  === 273 292  [[ 293 294 ]] #Init Value Assertion Predicate  P=0.999999, C=-1.000000 !orig=[175]
> ...
>  272  Opaque4  === _ 271 25  [[ 275 ]]  !orig=[184]
>  273  IfTrue  === 275  [[ 295 ]] #1 !orig=[186]
>  274  IfFalse  === 275  [[ 277 ]] #0 !orig=[187]
>  275  RangeCheck  === 262 272  [[ 273 274 ]] #Last Value Assertion Predicate  P=0.999999, C=-1.000000 !orig=[185]
> 
> Initialized Assertion Predicate:
> 
>  398  OpaqueInitializedAssertionPredicate  === _ 396  [[ 401 ]] 
>  399  IfTrue  === 401  [[ 413 ]] #1 !orig=293,[176]
>  400  IfFalse  === 401  [[ 403 ]] #0 !orig=294,[177]
>  401  RangeCheck  === 293 398  [[ 399 400 ]] #Init Value Assertion Predicate  P=0.999999, C=-1.000000 !orig=295,[175]
> ...
>  410  OpaqueInitializedAssertionPredicate  === _ 408  [[ 413 ]] 
>  411  IfTrue  === 413  [[ 149 ]] #1 !orig=273,[186]
>  412  IfFalse  === 413  [[ 415 ]] #0 !orig=274,[187]
>  413  RangeCheck  === 399 410  [[ 411 412 ]] #Last Value Assertion Predicate  P=0.999999, C=-1.000000 !orig=275,[185]
> 
> 
> IGV:
> ![image](https://github.com/openjdk/jdk/assets/17833009/4d2725f7-ea8e-4304-8ad6-2c7bf76b072b)
> 
> I could have added an additional "initialized" or "template" to better distinguish them but I eventually plan to get rid of `If` nodes for templates and introduce a dedicated `TemplateAssertionPredicateNode`. I therefore use the same strings for templates and initialized versions for now. Moreover, one can easily look at the input nodes to see if it is a template (with `Opaque4`) or an initialized version (with `OpaqueInitializedAssertionPredicate`).
> 
> Since this is only useful for debugging, I've guarded everything with `NOT_PRODUCT`.
> 
> Thanks,
> Christian

This pull request has now been integrated.

Changeset: a5f401f3
Author:    Christian Hagedorn <chagedorn at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/a5f401f3a8534a64cf3c27c2ef67f17860de6d6b
Stats:     106 lines in 6 files changed: 70 ins; 9 del; 27 mod

8334650: Add debug information about whether an Assertion Predicate is for the init or last value

Reviewed-by: roland, kvn

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

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


More information about the hotspot-compiler-dev mailing list