On Tue, 12 May 2026 14:04:34 GMT, Tobias Hartmann <[email protected]> wrote:

>> The problem is that we are pushing casts through InlineTypeNodes without 
>> checking if their types are even compatible. In dead parts of the graph, 
>> when a type check wasn't folded yet, the type of the CheckCastPP can be 
>> completely unrelated to the type of the InlineTypeNode. Pushing the cast 
>> through leads to an incorrect type being used further below in the graph and 
>> subsequent failures.
>> 
>> I tried hard to come up with standalone reproducer for this but failed. It 
>> reproduces reliably with replay compilation though.
>> 
>> Thanks,
>> Tobias
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Tobias Hartmann has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Fixed check

I think we agree on what I called unconsistencies, but after that, I'm more 
puzzled. Indeed, we cannot assume the checkcast will pass, but if we can show 
it doesn't, we already know these nodes must be dead. I suppose right now, we 
are waiting for the condition to remove them later during the same IGVN by 
finding out that `C` never allows this branch to be taken. But I wonder whether 
we could be more aggressive and remove them now, so that we don't need to be 
able to simplify `C` (or alternatively, we can see it as another way to prove a 
path is dead). Isn't it similar to something Roland did?

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

PR Comment: https://git.openjdk.org/valhalla/pull/2423#issuecomment-4432203387

Reply via email to