RFR: 8302652: [SuperWord] Reduction should happen after loop, when possible [v2]
Pengfei Li
pli at openjdk.org
Mon May 8 07:49:27 UTC 2023
On Mon, 8 May 2023 07:12:46 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> src/hotspot/share/opto/loopopts.cpp line 4305:
>>
>>> 4303:
>>> 4304: // Turn the scalar phi into a vector phi.
>>> 4305: _igvn.rehash_node_delayed(phi);
>>
>> Is it possible to setup the vector phi first, and then replace all reduction nodes by vector accumulators via calling `_igvn.replace_node()`? Current code here looks a bit wordy.
>
> If I set up the phi first, then where do I keep the `init` value? I have to make sure it has a use throughout the transformation, other wise it may think it is `dead`.
Why can the `init` node be dead? I think it should be ok as long as `init` node is connected well at the end of this transformation function. Registering new nodes just puts nodes into igvn worklist and no actual igvn is performed in the middle.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13056#discussion_r1187134726
More information about the hotspot-compiler-dev
mailing list