RFR: 8265956: JVM crashes when matching LShiftVB Node [v3]

Xiaohong Gong xgong at openjdk.java.net
Sat May 8 07:06:54 UTC 2021


On Sat, 8 May 2021 06:40:31 GMT, Wang Huang <whuang at openjdk.org> wrote:

>> src/hotspot/share/opto/vectorIntrinsics.cpp line 372:
>> 
>>> 370:   } else if (step_val->get_con() > 1) {
>>> 371:     Node* cnt = gvn().makecon(TypeInt::make(log2i_exact(step_val->get_con())));
>>> 372:     Node* shift_cnt = gvn().transform(new LShiftCntVNode(cnt, vt));
>> 
>> Use "vector_shift_count"?  It will mask the shift count before generating the `LShiftCntVNode`.
>
> `vector_shift_count` which calls `VectorNode::shift_count` does not contain `Op_LShiftB`:
> 
> ```c++
> VectorNode* VectorNode::shift_count(int opc, Node* cnt, uint vlen, BasicType bt) {
>   // Match shift count type with shift vector type.
>   const TypeVect* vt = TypeVect::make(bt, vlen);
>   switch (opc) {
>   case Op_LShiftI:
>   case Op_LShiftL:
>     return new LShiftCntVNode(cnt, vt);
>   case Op_RShiftI:
>   case Op_RShiftL:
>   case Op_URShiftB:
>   case Op_URShiftS:
>   case Op_URShiftI:
>   case Op_URShiftL:
>     return new RShiftCntVNode(cnt, vt);
>   default:
>     fatal("Missed vector creation for '%s'", NodeClassNames[opc]);
>     return NULL;
>   }
> }

Byte and short will use `"Op_LShiftI/Op_RShiftI"`. Please see: https://github.com/openjdk/panama-vector/blob/master/src/hotspot/share/prims/vectorSupport.cpp#L335

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

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


More information about the hotspot-compiler-dev mailing list