Integrated: 8290529: C2: assert(BoolTest(btest).is_canonical()) failure

Roland Westrelin roland at openjdk.org
Fri Sep 2 13:37:53 UTC 2022


On Tue, 19 Jul 2022 12:28:10 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> For the test case:
> 
> 1) In Parse::do_if(), tst0 is:
> 
> (Bool#lt (CmpU 0 Parm0))
> 
> 2) transformed by gvn in tst:
> 
> (Bool#gt (CmpU Parm0 0))
> 
> 3) That test is not canonical and is negated and retransformed which
> results in:
> 
> (Bool#eq (CmpI Parm0 0))
> 
> The assert fires because that test is not canonical either.
> 
> The root cause I think is that the (CmpU .. 0) -> (CmpI .. 0) only
> triggers if the condition of the CmpU is canonical (and results in a
> non canonical test). Tweaking it so it applies even if the condition
> is not leads to the following change in the steps above:
> 
> 2) (Bool#ne (CmpI Parm0 0))
> 
> which is a canonical test.

This pull request has now been integrated.

Changeset: 77e21c57
Author:    Roland Westrelin <roland at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/77e21c57ce00463db4cc3d87f93729cbfe2c96b4
Stats:     113 lines in 4 files changed: 110 ins; 0 del; 3 mod

8290529: C2: assert(BoolTest(btest).is_canonical()) failure

Reviewed-by: kvn, thartmann

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

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


More information about the hotspot-compiler-dev mailing list