RFR: 8303804: Fix some errors of If-VectorTest and CMove-VectorTest [v2]

Tobias Hartmann thartmann at openjdk.org
Wed Mar 22 06:42:46 UTC 2023


On Mon, 20 Mar 2023 12:58:57 GMT, Wang Haomin <wanghaomin at openjdk.org> wrote:

>> src/hotspot/share/adlc/output_c.cpp line 3989:
>> 
>>> 3987:   if (inst->captures_bottom_type(_globalNames)) {
>>> 3988:     if (strncmp("MachCall", inst->mach_base_class(_globalNames), strlen("MachCall")) != 0
>>> 3989:       && strncmp("MachIf", inst->mach_base_class(_globalNames), strlen("MachIf")) != 0) {
>> 
>> Could you please explain this change, and how it relates to JDK-8292289, in more detail?
>
> Add `match(If cop (VectorTest op1 op2));` into ad file.
> The following code will be generated in`MachNode *State::MachNodeGenerator(int opcode)` of ad_xxx_gen.cpp.
> 
> 
> 5458   case anytrue_in_maskV16_branch_rule: {
> 5459       anytrue_in_maskV16_branchNode *node = new anytrue_in_maskV16_branchNode();
> 5460       node->set_opnd_array(4, MachOperGenerator(LABEL));
> 5461       node->_bottom_type = _leaf->bottom_type();
> 5462       node->_prob = _leaf->as_If()->_prob;
> 5463       node->_fcnt = _leaf->as_If()->_fcnt;
> 5464       return node;
> 5465     }
> 
> 
> `error: 'class anytrue_in_maskV16_branchNode' has no member named '_bottom_type';` reported when `make hotspot`.
> In fact, `MachIfNode` does not have the member `_bottom_type`.
> 
> Normal `MachIfNode` will return false in `inst->captures_bottom_type`. However, the right child node of this `MachIfNode` is `VectorTest`. `is_vector` return true, so `inst->captures_bottom_type` return true. Therefore the error occurred.

Thanks for the explanation. The change looks good to me.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/12917#discussion_r1144292178


More information about the hotspot-compiler-dev mailing list