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

Wang Haomin wanghaomin at openjdk.org
Mon Mar 20 13:01:41 UTC 2023


On Mon, 20 Mar 2023 08:26:14 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> Wang Haomin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   compare the results with 0
>
> 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.

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

PR: https://git.openjdk.org/jdk/pull/12917


More information about the hotspot-compiler-dev mailing list