RFR: 8314580: PhaseIdealLoop::transform_long_range_checks fails with assert "was tested before"
Vladimir Kozlov
kvn at openjdk.org
Wed Aug 30 21:26:06 UTC 2023
On Thu, 24 Aug 2023 07:57:34 GMT, Roland Westrelin <roland at openjdk.org> wrote:
> For long counted loops, `PhaseIdealLoop::create_loop_nest()` first
> goes over the loop body to collect range checks, then transforms the
> long counted loop into a loop nest and then goes over the list of
> range checks it collected to transfrom them. For that last step,
> `PhaseIdealLoop::transform_long_range_checks()` needs to extract the
> parameters of the range check from the range check expression. It
> should still recognize the range check expression even though the loop
> was transformed in the meantime. That's what fails here. The reason is
> that the range check expression uses the long loop increment as input
> which, in the creation of the loop nest, is transformed to `outer
> phi + inner incr`. That breaks pattern matching of the range check
> expression. I propose removing the transformation:
>
>
> incr=>(outer_phi+inner_incr)
>
>
> entireley. After looking at this code again, I don't think it's
> needed. The transformation:
>
>
> phi=>(outer_phi+inner_phi)
>
>
> should be all that's needed to correctly transform the loop.
Looks good to me too. Thank you for explaining the issue in details.
-------------
Marked as reviewed by kvn (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/15411#pullrequestreview-1603519597
More information about the hotspot-compiler-dev
mailing list