RFR: 8333334: C2: Make result of `Node::dominates` more precise to enhance scalar replacement [v5]

Emanuel Peter epeter at openjdk.org
Fri Jul 5 08:32:26 UTC 2024


On Fri, 5 Jul 2024 08:12:02 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Qizheng Xing has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add `@requires` for G1 GC.
>
> src/hotspot/share/opto/memnode.cpp line 431:
> 
>> 429: // an allocation it wants to look past.
>> 430: bool MemNode::all_controls_dominate(Node* dom, Node* sub, bool *dead_code) {
>> 431:   bool dummy_flag, &dead_code_flag = dead_code != nullptr ? *dead_code : dummy_flag;
> 
> This line is hard to read. And I'm not sure that `dummy_flag` is initialized. If not, it could most of the time happen to be `false`, but also randomly `true` sometimes. I would put the two variable definitions on separate lines.

Also, this looks like a nasty hack with the pointer variable and the `dummy_flag`. Can we not solve this differently somehow?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19496#discussion_r1666490501


More information about the hotspot-compiler-dev mailing list