RFR: 8366702: C2 SuperWord: refactor VTransform vector nodes [v2]
Emanuel Peter
epeter at openjdk.org
Mon Sep 8 08:18:15 UTC 2025
On Mon, 8 Sep 2025 07:31:40 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> review comment implemented
>
> src/hotspot/share/opto/superwordVTransformBuilder.cpp line 154:
>
>> 152: Node* p0 = pack->at(0);
>> 153: const VTransformVectorNodePrototype prototype = VTransformVectorNodePrototype::make_from_pack(pack, _vloop_analyzer);
>> 154: const int sopc = prototype.scalar_opcode();
>
> You use this at other places already but could be more readable when renamed to `scalar_opc` or `scalar_opcode`.
We use `sopc` and `vopc` in many places in vectorization code - just grep for it ;)
Otherwise some lines just get much longer, and I think that makes the code less readable generally.
> src/hotspot/share/opto/vtransform.hpp line 617:
>
>> 615:
>> 616: public:
>> 617: static VTransformVectorNodePrototype make_from_pack(const Node_List* pack, const VLoopAnalyzer& vloop_analyzer) {
>
> When switching to "Properties", you could also rename this to something like "fetch_from_pack" since `make` also suggests to actually creating a dummy-kind node when it's only trying to fetch useful information.
I prefer the `make_...` naming. I think it is generally used as a "factory" prefix all over the place. `fetch` means we would be "loading" if from somewhere, and that's not what we do here - rather we just construct the `Properties` given the pack.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27056#discussion_r2329483851
PR Review Comment: https://git.openjdk.org/jdk/pull/27056#discussion_r2329487912
More information about the hotspot-compiler-dev
mailing list