RFR: 8278949: Cleanups for 8277850

John R Rose jrose at openjdk.java.net
Sun Dec 19 20:06:20 UTC 2021


On Fri, 17 Dec 2021 08:03:19 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> When 8277850 (C2: optimize mask checks in counted loops) was reviewed,
> John made a number of comments and suggestions after the change was
> integrated. This change includes all of his comments, extra tests to
> cover all cases. I also moved the AndIL_add_shift_and_mask() call in
> AndXNode::Ideal() up so the expression with a non constant mask can be
> optimized as well.

Looks good.  One naming suggestion about `AndIL_shift_and_mask`

src/hotspot/share/opto/mulnode.cpp line 1730:

> 1728: // Because the optimization might work for a non-constant
> 1729: // mask M, we check the AndX for both operand orders.
> 1730: bool MulNode::AndIL_shift_and_mask(PhaseGVN* phase, Node* shift, Node* mask, BasicType bt, bool check_reverse) {

Since this is a boolean function, perhaps its name should indicate what question it is answering.

Suggestion:  `AndIL_shift_and_mask_is_always_zero`

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

Marked as reviewed by jrose (Reviewer).

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


More information about the hotspot-compiler-dev mailing list