Integrated: 8336830: C2: assert(get_loop(lca)->_nest < n_loop->_nest || lca->in(0)->is_NeverBranch()) failed: must not be moved into inner loop

Roland Westrelin roland at openjdk.org
Mon Aug 26 07:34:14 UTC 2024


On Thu, 25 Jul 2024 15:16:39 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> A store is sunk from a counted loop into an enclosing infinite
> loop. The assert fires because:
> 
> 
> get_loop(lca)->_nest < n_loop->_nest
> 
> 
> is false. That happens because the outer loop was found to be infinite
> in the current loop opts pass. When that happens, it's not properly
> attached to the loop tree. The second part of the assert was added to
> cover a similar case:
> 
> 
> lca->in(0)->is_NeverBranch()
> 
> 
> but it doesn't work in this case bcause lca is not a projection of the
> `NeverBranch`. It's the exit projection of the counted loop. The fix I
> propose changes that part of the assert to test that lca is, indeed,
> in an infinite loop in a way that's robust.
> 
> I also removed some code that I believe to be useless following
> 8335709.

This pull request has now been integrated.

Changeset: 0c14579f
Author:    Roland Westrelin <roland at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/0c14579fef902f0501d0510bdc32e8cece34834a
Stats:     58 lines in 2 files changed: 57 ins; 0 del; 1 mod

8336830: C2: assert(get_loop(lca)->_nest < n_loop->_nest || lca->in(0)->is_NeverBranch()) failed: must not be moved into inner loop

Co-authored-by: Emanuel Peter <epeter at openjdk.org>
Reviewed-by: thartmann, chagedorn, epeter

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

PR: https://git.openjdk.org/jdk/pull/20334


More information about the hotspot-compiler-dev mailing list