RFR: 8283091: Support type conversion between different data sizes in SLP [v6]

Vladimir Kozlov kvn at openjdk.java.net
Fri Jun 3 03:16:25 UTC 2022


On Fri, 3 Jun 2022 01:03:59 GMT, Fei Gao <fgao at openjdk.org> wrote:

>> src/hotspot/share/opto/vectornode.cpp line 258:
>> 
>>> 256:     return Op_VectorCastF2X;
>>> 257:   case Op_ConvD2L:
>>> 258:     return Op_VectorCastD2X;
>> 
>> Why you removed these lines?
>
> @vnkozlov @sviswa7 , I removed these lines here, because I call another api to generate vector opcodes and vector nodes for conversion nodes [VectorCastNode::opcode()](https://github.com/openjdk/jdk/blob/ba9ee8cb286268f1d6a2820508334aaaf3131e15/src/hotspot/share/opto/vectornode.cpp#L1203), which is more precise than this one and unified with Vector API. Because converting short to double and converting int to double would use the same opcode `ConvI2D` for scalar nodes, we can't differentiate between them just based on the opcode of the current node. I adjusted the callers `VectorCastNode::implemented()` and `SuperWord::output()` to the removing.

I see the issue. Calls to `VectorCastNode::opcode()` use basic type of Ideal node which will hide sub-integer types. That is why you need `in->bottom_type()->is_vect()->element_basic_type()`.

May be we should have assert here to make sure that in all places we call `VectorCastNode::opcode()` for `Conv*` nodes:


 default:
    assert(!VectorNode::is_convert_opcode(sopc), "Convert node %s should be processed by VectorCastNode::opcode()", NodeClassNames[sopc]);
    return 0; // Unimplemented

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

PR: https://git.openjdk.java.net/jdk/pull/7806


More information about the hotspot-compiler-dev mailing list