RFR: 8319372: C2 compilation fails with "Bad immediate dominator info" [v2]

Roland Westrelin roland at openjdk.org
Wed Nov 29 13:28:09 UTC 2023


On Wed, 29 Nov 2023 08:15:02 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> However, there was still this [test](https://bugs.openjdk.org/secure/attachment/101741/Reduced2.java)
> 
> ```
> $ java -Xcomp -XX:CompileOnly=Reduced*::* -XX:-TieredCompilation Reduced2.java
> ```
> 
> which fails with mainline today but would work with your fix. You might want to add this test case as well.

I looked at this one and it indeed looks like some variation of the same problem (range checks are eliminated by range check elimination and not predication). I added it.

> Maybe we need to step through all the reported test cases which we closed as duplicates of [JDK-8275202](https://bugs.openjdk.org/browse/JDK-8275202) at some point and see if this patch can fix them as well. I have the feeling that it can.

Yes, that would make sense.

> Additionally, we might want to investigate separately at some point if this patch allows us to relax some of the constraints of `try_sink_out_of_loop()` which we added fix these kind of issues with `CastII` nodes. I'm not sure though how much benefit it will bring.

This too makes sense to me.

> Anyway, the fix looks good to me!

Thanks for the review!

> test/hotspot/jtreg/compiler/c2/TestTopCastIIOnUndetectedDeadPath.java line 31:
> 
>> 29:  *                   -XX:+UnlockDiagnosticVMOptions -XX:StressSeed=426264791 -XX:+StressIGVN TestTopCastIIOnUndetectedDeadPath
>> 30:  * @run main/othervm -Xcomp -XX:CompileOnly=TestTopCastIIOnUndetectedDeadPath::test -XX:CompileCommand=quiet -XX:-TieredCompilation
>> 31:  *                   -XX:+UnlockDiagnosticVMOptions -XX:+StressIGVN TestTopCastIIOnUndetectedDeadPath
> 
> Since `StressIGVN` is a C2 flag, you should also add a `@requires vm.compiler2.enabled`. Same for the other test.

Done in new commit.

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

PR Comment: https://git.openjdk.org/jdk/pull/16844#issuecomment-1831893499
PR Review Comment: https://git.openjdk.org/jdk/pull/16844#discussion_r1409279368


More information about the hotspot-compiler-dev mailing list