RFR: 8313672: C2: PhaseCCP does not correctly track analysis dependencies involving shift, convert, and mask
Emanuel Peter
epeter at openjdk.org
Tue Oct 31 07:35:33 UTC 2023
On Tue, 31 Oct 2023 07:14:07 GMT, Daniel Lundén <duke at openjdk.org> wrote:
> This changeset fixes an issue where the `PhaseCCP` analysis stopped before fixpoint due to `Value`-updates for `AndL` nodes involving shift, convert, and mask (`MulNode::AndIL_shift_and_mask_is_always_zero`). Such updates did not previously repopulate the `PhaseCCP` worklist correctly.
>
> Changes:
> - Fix the issue by adding the missing pattern to `PhaseCCP::push_and`.
> - Update the `assert` error message that reported the issue to better describe the problem. The `PhaseCCP` analysis is optimistic, and the previous error message seemed to indicate the opposite ("Missed optimization opportunity"). If the assert triggers, it could be that the analysis result leads to unsound transformations later on.
>
> Result after `PhaseCCP` analysis (without fix, note `long:0` for node 116):
> 
>
> Result after `PhaseCCP` analysis (with fix, note `long` for node 116):
> 
>
> ### Testing (on all Oracle-supported platforms)
> - `tier1`
> - HotSpot parts of `tier2` and `tier3`
Thanks for the analysis. You should attach a regression test, the one from JBS.
src/hotspot/share/opto/phaseX.cpp line 1992:
> 1990: };
> 1991: ConstraintCastNode::visit_uncasted_uses(use, push_and_uses_to_worklist);
> 1992: if (conv) {
What happens if there were to be multiple such `ConvI2L` nodes? Or is that impossible?
-------------
Changes requested by epeter (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/16429#pullrequestreview-1705611671
PR Review Comment: https://git.openjdk.org/jdk/pull/16429#discussion_r1377159200
More information about the hotspot-compiler-dev
mailing list