RFR: 8302652: [SuperWord] Reduction should happen after loop, when possible [v7]
Vladimir Kozlov
kvn at openjdk.org
Tue May 16 17:51:57 UTC 2023
On Tue, 16 May 2023 17:47:34 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
>>
>> whitespace fix
>
> src/hotspot/share/opto/vectornode.hpp line 244:
>
>> 242:
>> 243: virtual VectorNode* make_normal_vector_op(Node* in1, Node* in2, const TypeVect* vt) = 0;
>> 244: virtual bool make_normal_vector_op_implemented(const TypeVect* vt) = 0;
>
> How about introducing `virtual int vect_Opcode()` (`norm_vect_Opcode()`) or something which returns normal vector opcode (`Op_AddVI` for `AddReductionVINode` for example). Then you don't need these 2 functions to be virtual:
>
> virtual int vect_Opcode() const = 0;
> VectorNode* make_normal_vector_op(Node* in1, Node* in2, const TypeVect* vt) {
> return new VectorNode::make(vect_Opcode(), in1, in2, vt);
> }
> bool make_normal_vector_op_implemented(const TypeVect* vt) {
> return Matcher::match_rule_supported_vector(vect_Opcode(), vt->length(), vt->element_basic_type());
> }
>
>
> If we need that in more cases then in your changes may be have even more general (in `VectorNode` class) `scalar_Opcode()` and use `VectorNode::opcode(sclar_Opcode(), vt->element_basic_type())` to get normal vector opcode. This may need more changes and testing - a separate RFE.
I am also not sure about need `_op` in these functions names.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13056#discussion_r1195505796
More information about the hotspot-compiler-dev
mailing list