RFR: 8333394: C2: assert(bol->is_Opaque4() || bol->is_OpaqueInitializedAssertionPredicate()) failed: Opaque node of non-null-check or of Initialized Assertion Predicate

Tobias Hartmann thartmann at openjdk.org
Mon Jun 3 13:04:05 UTC 2024


On Mon, 3 Jun 2024 08:29:18 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> [JDK-8330386](https://bugs.openjdk.org/browse/JDK-8330386) added some additional asserts to ensure that we are dealing with Template Assertion Predicates and/or non-null-checks which both use `Opaque4` nodes. I've also improved the following bailout from `!= 2` to `< 2` since the original comment suggested that if there is a test without 2 inputs, it must be a dead test (i.e. I assumed a `ConNode`):
> 
> https://github.com/openjdk/jdk/blob/91101f0d4fc8e06d0d74e06361db6ac87efeeb8e/src/hotspot/share/opto/loopTransform.cpp#L1204-L1206
> 
> But apparently, we could also have the following, also dead, `If` with a condition with 3 inputs (`505 Phi`) created by `split_thru_phi`:
> 
> ![image](https://github.com/openjdk/jdk/assets/17833009/003ad32a-a675-49f2-a263-7ca28d1faf82)
> 
> I therefore revert the check back to `!= 2` and improved the comment.
> 
> Thanks,
> Christian

Looks good to me.

test/hotspot/jtreg/compiler/predicates/assertion/TestIfWithPhiInput.java line 29:

> 27:  * @bug 8333394
> 28:  * @summary Test bailout of range check policy with an If with a Phi as condition.
> 29:  * @run main/othervm -XX:CompileCommand=compileonly,*TestIfWithPhiInput*::* -Xcomp

Suggestion:

 * @run main/othervm -XX:CompileCommand=compileonly,*TestIfWithPhiInput*::* -Xcomp -XX:-TieredCompilation


Just to make sure C2 compilation is triggered.

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

Marked as reviewed by thartmann (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19517#pullrequestreview-2093803652
PR Review Comment: https://git.openjdk.org/jdk/pull/19517#discussion_r1624419531


More information about the hotspot-compiler-dev mailing list