RFR: 8271600: C2: CheckCastPP which should closely follow Allocate is sunk of a loop
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Mon Aug 23 13:31:47 UTC 2021
>> I took a look at JDK-8272562. Your analysis looks reasonable, but I'm still curious whether the problem is specific to cast nodes. My understanding is the general problem stems from the fact that a computation may be sunk into an effectively dead path. When C2 can't prove that the branch is dead, the dying computation on that path corrupts the graph. Do we need to introduce a more robust solution to guarantee the corruption never happens?
>
> I think it is generally a problem that C2 cannot prove that this branch is dead but data could be dying. But it looks like that data can only die when sinking nodes with `CastII` nodes which gives us the improved type information to trigger that. I could not think of/find another testcase where this could occur otherwise. So, going with your originally proposed fix would prevent the problem from happening but it still exists. Might be worth to further investigate why C2 cannot let control die, too, in this case.
Unless the path dies in controllable manner, there are usually some
leftovers hanging around which break different invariants on allowed IR
shapes.
It seems like we would need an additional pass to clean up the graph and
forcibly prune effectively dead paths in corrupted state and seal them
with Halt nodes.
Best regards,
Vladimir Ivanov
More information about the hotspot-compiler-dev
mailing list