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

Saranya Natarajan snatarajan at openjdk.org
Mon Oct 27 22:10:03 UTC 2025


On Mon, 27 Oct 2025 13:00:26 GMT, Damon Fenacci <dfenacci at openjdk.org> wrote:

>> Saranya Natarajan has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - fixing test failure
>>  - addressing review comments
>
> 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.

Yes, I have fixed this now.

> 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?

That is my only reason for doing this.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26902#discussion_r2467191433
PR Review Comment: https://git.openjdk.org/jdk/pull/26902#discussion_r2467193122


More information about the hotspot-compiler-dev mailing list