Integrated: 8286625: C2 fails with assert(!n->is_Store() && !n->is_LoadStore()) failed: no node with a side effect

Roland Westrelin roland at openjdk.java.net
Wed Jun 8 06:38:41 UTC 2022


On Thu, 2 Jun 2022 15:43:09 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> 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)

This pull request has now been integrated.

Changeset: 590337e2
Author:    Roland Westrelin <roland at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/590337e2f229445e353e7c32e0dcff8d93e412d2
Stats:     64 lines in 3 files changed: 63 ins; 0 del; 1 mod

8286625: C2 fails with assert(!n->is_Store() && !n->is_LoadStore()) failed: no node with a side effect

Reviewed-by: thartmann, chagedorn

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

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


More information about the hotspot-compiler-dev mailing list