RFR: 8286625: C2 fails with assert(!n->is_Store() && !n->is_LoadStore()) failed: no node with a side effect [v2]
Roland Westrelin
roland at openjdk.java.net
Tue Jun 7 15:08:29 UTC 2022
> It's another case where because of overunrolling, the main loop is
> never executed but not optimized out and the type of some
> CastII/ConvI2L for a range check conflicts with the type of its input
> resulting in a broken graph for the main loop.
>
> This is supposed to have been solved by skeleton predicates. There's
> indeed a predicate that should catch that the loop is unreachable but
> it doesn't constant fold. The shape of the predicate is:
>
> (CmpUL (SubL 15 (ConvI2L (AddI (CastII int:>=1) 15) minint..maxint)) 16)
>
> I propose adding a CastII, that is in this case:
>
> (CmpUL (SubL 15 (ConvI2L (CastII (AddI (CastII int:>=1) 15) 0..max-1) minint..maxint)) 16)
>
> The justification for the CastII is that the skeleton predicate is a
> predicate for a specific iteration of the loop. That iteration of the
> loop must be in the range of the iv Phi.
>
> With the extra CastII, the AddI can be pushed through the CastII and
> ConvI2L and the check constant folds. Actually, with the extra CastII,
> the predicate is not implemented with a CmpUL but a CmpU because the
> code can tell there's no risk of overflow (I did force the use of
> CmpUL as an experiment and the CmpUL does constant fold)
Roland Westrelin has updated the pull request incrementally with one additional commit since the last revision:
Update test/hotspot/jtreg/compiler/loopopts/TestOverUnrolling2.java
Co-authored-by: Tobias Hartmann <tobias.hartmann at oracle.com>
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/8996/files
- new: https://git.openjdk.java.net/jdk/pull/8996/files/8f4a999a..9c9120ef
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=8996&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=8996&range=00-01
Stats: 1 line in 1 file changed: 1 ins; 0 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/8996.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/8996/head:pull/8996
PR: https://git.openjdk.java.net/jdk/pull/8996
More information about the hotspot-compiler-dev
mailing list