RFR: 8349479: C2: when a Type node becomes dead, make CFG path that uses it unreachable [v2]

Roland Westrelin roland at openjdk.org
Fri Mar 21 16:28:10 UTC 2025


On Tue, 18 Mar 2025 14:48:22 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

> But also a problem, indeed. I just think that going into the future, we should still make a reasonable effort to try and let the control path die sanely without needing this patch. It should only serve as a last resort to avoid breaking the graph. While I think it's the safest solution, my concern is that we will not find inefficiencies anymore with this patch. For example, if someone breaks Assertion Predicates, how can we detect this when the graph will always be sane? It's especially tricky now that I'm still adding Assertion Predicate patches and things might break during development and it goes unnoticed. But maybe I just need to turn this patch off locally.

I agree with that. So ideally the code for this patch should only execute for those cases not properly handled some other way. I tried to figure out a way to do that but concluded it was not really possible. One thing could be to have a flag on `Compile` that's only set to true once a dangerous transformation is performed (in the case of this test case, some transformation involving cast nodes that widens the type at some point in the graph). The new logic would only execute when that flag is true. Do you think it's worth trying or would the logic still run too often to catch bugs elsewhere?

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

PR Comment: https://git.openjdk.org/jdk/pull/23468#issuecomment-2743866070


More information about the hotspot-compiler-dev mailing list