RFR: 8349835: C2: simplify IGV property printing [v2]

Damon Fenacci dfenacci at openjdk.org
Mon Oct 27 13:04:35 UTC 2025


On Wed, 1 Oct 2025 12:28:38 GMT, Saranya Natarajan <snatarajan at openjdk.org> wrote:

>> The code that prints node properties and live range properties is very verbose and repetitive and could be simplified by applying a refactoring suggested [here](https://github.com/openjdk/jdk/pull/23558#discussion_r1950785708).
>> 
>> ### Fix 
>> Implemented the suggested refactoring. 
>> 
>> ### Testing 
>> Github Actions, Tier 1-3
>
> Saranya Natarajan has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - fixing test failure
>  - addressing review comments

Changes requested by dfenacci (Committer).

src/hotspot/share/opto/idealGraphPrinter.cpp line 1131:

> 1129:     print_property(C->matcher()->is_dontcare(node), "is_dontcare");
> 1130:     print_property(!(C->matcher()->is_dontcare(node)),"is_dontcare", IdealGraphPrinter::FALSE_VALUE);
> 1131:     print_property((C->matcher()->find_old_node(node) != nullptr), "old_node_idx", C->matcher()->find_old_node(node)->_idx);

I think we might have an issue here: `C->matcher()->find_old_node(node)->_idx` is always evaluated no matter if `C->matcher()->find_old_node(node) != nullptr` or not.

src/hotspot/share/opto/idealGraphPrinter.hpp line 180:

> 178:   PrintProperties(IdealGraphPrinter *printer) : _printer(printer) {}
> 179:   void print_node_properties(Node *node, Compile *C);
> 180:   void print_lrg_properties(const LRG &lrg, const char *buffer);

is passing by reference done to avoid copying?

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

PR Review: https://git.openjdk.org/jdk/pull/26902#pullrequestreview-3383168804
PR Review Comment: https://git.openjdk.org/jdk/pull/26902#discussion_r2465575666
PR Review Comment: https://git.openjdk.org/jdk/pull/26902#discussion_r2465423152


More information about the hotspot-compiler-dev mailing list