RFR: JDK-8319256: Print more diagnostic information when an unexpected user is found in a Phi

Vladimir Kozlov kvn at openjdk.org
Fri Nov 3 18:32:07 UTC 2023


On Thu, 2 Nov 2023 00:02:18 GMT, Cesar Soares Lucas <cslucas at openjdk.org> wrote:

> Can I please get some review on this PR to:
> 
> - Add more verification around the implementation of reduce allocation merges.
> - Print more diagnostic information when an unexpected situation is encountered.
> 
> Testing: Linux x64 tier1-4, Renaissance, Dacapo and SpecJBB.

src/hotspot/share/opto/c2_globals.hpp line 473:

> 471:           "Trace decision for simplifying allocation merges.")              \
> 472:                                                                             \
> 473:   notproduct(bool, VerifyReduceAllocationMerges , true,                     \

>From changes I assume you want verification done in debug VM. Use `develop(`  flag declaration for that.
(`notproduct` includes `optimized` VM build).

src/hotspot/share/opto/escape.cpp line 373:

> 371:   }
> 372: 
> 373:   if (VerifyReduceAllocationMerges) {

Add `#ifdef ASSERT`

src/hotspot/share/opto/escape.cpp line 377:

> 375:       Node* n = reducible_merges.at(i);
> 376:       if (!can_reduce_phi(n->as_Phi())) {
> 377:         NOT_PRODUCT(TraceReduceAllocationMerges = true;)

With `#ifdef` you don't need `NOT_PRODUCT()` here.

src/hotspot/share/opto/escape.cpp line 547:

> 545: #ifdef ASSERT
> 546:   if (VerifyReduceAllocationMerges && !can_reduce_phi(ophi)) {
> 547:     NOT_PRODUCT(TraceReduceAllocationMerges = true;)

With #ifdef you don't need NOT_PRODUCT() here.

src/hotspot/share/opto/escape.cpp line 3817:

> 3815:         // Split loads through phi
> 3816:         reduce_phi_on_field_access(n->as_Phi(), alloc_worklist);
> 3817:         if (VerifyReduceAllocationMerges) reduced_merges.push(n);

Code style. split line and use `{}` for body. And add `#ifdef ASSERT`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16465#discussion_r1382087641
PR Review Comment: https://git.openjdk.org/jdk/pull/16465#discussion_r1382088238
PR Review Comment: https://git.openjdk.org/jdk/pull/16465#discussion_r1382089232
PR Review Comment: https://git.openjdk.org/jdk/pull/16465#discussion_r1382089589
PR Review Comment: https://git.openjdk.org/jdk/pull/16465#discussion_r1382090996


More information about the hotspot-compiler-dev mailing list