RFR: 8344251: C2: remove blackholes with dead control input
Aleksey Shipilev
shade at openjdk.org
Tue Apr 15 16:41:45 UTC 2025
On Tue, 15 Apr 2025 16:34:10 GMT, Marc Chevalier <mchevalier at openjdk.org> wrote:
>> Or you can di separate runs with different flags, including default.
>
> I've added the `-Xcomp` flag because the dead `if` branch was compiled into an uncommon trap (reason = unstable_if), and I had no `BlackholeNode`. Looking at the code emitting the trap, it seems to come from some profiling information, but that the generation of this uncommon trap is explicitly disabled if `-Xcomp` is given. I am not entirely sure why, but `-XX:CompileThreshold=100` does the job to make the compilation of the dead `if` branch happen as well. But if I give no such flag, the test fails for lack of a `BlackholeNode` after parsing (also meaning that the test doesn't exercise the deletion of the `BlackholeNode`).
>
> I'm currently testing further with `-XX:CompileThreshold=100` as suggested (it works on my laptop so far), but if you have a more canonical trick to inhibit the uncommon trap in the dead branch, I'd take happily!
Last time I had this problem, I did this:
https://github.com/openjdk/jdk/blob/cec48ed270d3bdf704c389a091b42a32c2ed6440/test/hotspot/jtreg/compiler/c2/irTests/gc/ReferenceClearTests.java#L48-L49
https://github.com/openjdk/jdk/blob/cec48ed270d3bdf704c389a091b42a32c2ed6440/test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java#L303-L307
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24663#discussion_r2045045847
More information about the hotspot-compiler-dev
mailing list