RFR: 8314580: PhaseIdealLoop::transform_long_range_checks fails with assert "was tested before"
Roland Westrelin
roland at openjdk.org
Thu Aug 24 08:03:52 UTC 2023
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.
-------------
Commit messages:
- fix & test
Changes: https://git.openjdk.org/jdk/pull/15411/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15411&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8314580
Stats: 52 lines in 2 files changed: 46 ins; 4 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/15411.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/15411/head:pull/15411
PR: https://git.openjdk.org/jdk/pull/15411
More information about the hotspot-compiler-dev
mailing list