RFR: 8308994: C2: Re-implement experimental post loop vectorization [v2]
Pengfei Li
pli at openjdk.org
Mon Jul 3 09:48:11 UTC 2023
On Fri, 23 Jun 2023 15:02:15 GMT, Emanuel Peter <epeter at openjdk.org> wrote:
>> Pengfei Li has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address part of comments from Emanuel
>
> src/hotspot/share/opto/vmaskloop.cpp line 357:
>
>> 355: set_elem_bt(node, mem_type);
>> 356: } else {
>> 357: trace_msg(node, "Subword operand does not have precise type");
>
> Not clear to me what this means.
Precise type info about signedness means that we know exactly whether the data is signed or unsigned. For some operations, such as right shift, results are different for signed and unsigned operands, so C2 has to know the signedness. However, in any Java arithmetic operation, operands of Java subword types are promoted to int first. Sometimes, for example, if an intermediate result is a binary operation of both signed and unsigned, we don't have the precise type info, so we don't know how to vectorize it. (see below example where the signedness info is lost after a short and a char are added)
for (int i = 0; i < SIZE; i++) {
shorts[i] = (shorts[i] + chars[i]) >> 10;
}
> src/hotspot/share/opto/vmaskloop.cpp line 367:
>
>> 365: BasicType self_type = node->bottom_type()->array_element_basic_type();
>> 366: if (!same_element_size(self_type, stmt_bottom_type)) {
>> 367: trace_msg(node, "Vector element size does not match");
>
> does not match with what? size of store of statement?
The message is updated. Thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250582207
PR Review Comment: https://git.openjdk.org/jdk/pull/14581#discussion_r1250582846
More information about the hotspot-compiler-dev
mailing list