RFR: 8327963: C2: fix construction of memory graph around Initialize node to prevent incorrect execution if allocation is removed [v12]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Wed Sep 24 12:01:28 UTC 2025


On Mon, 22 Sep 2025 13:26:05 GMT, Roland Westrelin <roland at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/escapeAnalysis/TestIterativeEA.java line 53:
>> 
>>> 51:     analyzer.shouldContain("++++ Eliminated: 26 Allocate");
>>> 52:     analyzer.shouldContain("++++ Eliminated: 51 Allocate");
>>> 53:     analyzer.shouldContain("++++ Eliminated: 84 Allocate");
>> 
>> Did you analyze why there are more allocations removed than before in this test case? I did not expect this changeset to have an effect on the number of removed allocations.
>
> There are not more allocations removed. The message is confusing.
> "Eliminated: 84 Allocate" logs that node number 84 was eliminated (and not 84 nodes).
> This patch changes the number of nodes required at allocations so it also has an impact on node numbering.

I see, thanks. Expecting specific C2 node identifiers seems fragile. I understand it is a pre-existing issue, but since this changeset needs to address it anyway, please consider making it more robust by e.g. using regular expression matching. Here is a suggestion, feel free to incorporate it: https://github.com/openjdk/jdk/commit/9fd6378156187e497b1e4233d57282cad9ede29f. The ultimately improvement would be using the IR test framework, but that is out of scope here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24570#discussion_r2375544305


More information about the hotspot-compiler-dev mailing list