RFR: 8271589: fatal error with variable shift count integer rotate operation.

Vladimir Kozlov kvn at openjdk.java.net
Mon Aug 2 19:36:34 UTC 2021


On Mon, 2 Aug 2021 18:13:08 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> src/hotspot/share/opto/superword.cpp line 2491:
>> 
>>> 2489:         Node* in1 = low_adr->in(1);
>>> 2490:         Node* in2 = p->at(0)->in(2);
>>> 2491:         assert(in2->bottom_type()->isa_int(), "Shift must always be an int value");
>> 
>> Why you removed the assert? What other types can be seen here?
>> The following code (specifically `in2->get_int()`) will fail if it is not Integer type.
>
> At this point in code, the shift is either an int value or a vector of an int value. If it's a vector !in2->is_Con() will make the condition true and no need to check for get_int due to short-circuiting.

Okay. IT should be fine because get_int() has own assert.

>> src/hotspot/share/opto/vectornode.cpp line 1171:
>> 
>>> 1169:       } else {
>>> 1170:          assert(cnt->bottom_type()->isa_long() &&
>>> 1171:                 cnt->bottom_type()->is_long()->is_con(), "Long constant expected");
>> 
>> Is this case from Vector API? I think in Java we can have only Int type for shifts.
>
>> Is this case from Vector API? I think in Java we can have only Int type for shifts.
> 
> This is to handle long rotates, SLP will insert a ConvI2L before broadcasting shift value into a long vector. In case of constant int value, ConvI2L::Value will create a constant of TypeLong and which is what is being handled here.

Got it.

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

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


More information about the hotspot-compiler-dev mailing list