RFR: 8277850: C2: optimize mask checks in counted loops
Vladimir Kozlov
kvn at openjdk.java.net
Mon Dec 6 17:46:16 UTC 2021
On Mon, 6 Dec 2021 08:39:23 GMT, Roland Westrelin <roland at openjdk.org> wrote:
>> src/hotspot/share/opto/mulnode.cpp line 514:
>>
>>> 512: }
>>> 513:
>>> 514: return MulINode::Value(phase);
>>
>> There is no `MulINode::value()` or `MulLNode::value()`, only based class `MulNode` have it.
>> You missing initial check done by `MulNode::value()`.
>> I suggest to move this code into `AndINode::mul_ring()` and `AndLNode::mul_ring()`.
>> Also in `mul_ring()` you can pass `r1->get_con()` as `mask` value to `AndIL_shift_and_mask()`.
>
> Thanks for reviewing this.
> MulNode::AndIL_shift_and_mask() needs the shift node so it can test for shift->Opcode() == Op_ConvI2L. mult_ring() only gets the Type* as input. Are you suggesting to change mul_ring's signature?
You are right, I missed that.
It is unfortunate - we will have many duplicated checks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/6697
More information about the hotspot-compiler-dev
mailing list