RFR: 8333684: C2 SuperWord: multiple smaller refactorings in preparation for JDK-8332163 [v2]

Christian Hagedorn chagedorn at openjdk.org
Wed Jun 12 12:34:18 UTC 2024


On Wed, 12 Jun 2024 12:09:27 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> src/hotspot/share/opto/superword.cpp line 1625:
>> 
>>> 1623: 
>>> 1624: // If the j-th input for all nodes in the pack is the same unique input: return it, else nullptr.
>>> 1625: Node* PackSet::isa_unique_input_or_null(const Node_List* pack, int j) const {
>> 
>> Two things here:
>> 1. You do not seem to be using the actual unique input at the call sites and only care about whether there is a unique input or not (all checks are against `nullptr`).
>> 2.  I'm not sure if "unique" could be misleading as in "only once" in the entire pack. 
>> 
>> To address both, I suggest to change this to:
>> `bool PackSet::same_input_at_index()`
>> 
>> What do you think?
>
>> You do not seem to be using the actual unique input at the call sites and only care about whether there is a unique input or not (all checks are against nullptr).
> 
> I do not need it now, but will after a further refactoring. So I'd like to have it already available to keep the noise in the next refactoring down.
> 
>> I'm not sure if "unique" could be misleading as in "only once" in the entire pack.
> 
> Ok, I could do that. That would be closer to the old name `same_inputs`.

`same_inputs_at_index_or_null()`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19573#discussion_r1636375990


More information about the hotspot-compiler-dev mailing list