RFR: 8331575: C2: crash when ConvL2I is split thru phi at LongCountedLoop [v2]

Emanuel Peter epeter at openjdk.org
Mon May 13 17:10:04 UTC 2024


On Mon, 13 May 2024 13:23:07 GMT, Roland Westrelin <roland at openjdk.org> wrote:

> > I guess the issue is that ConvL2I and ConvI2L are also type nodes, which can restrict their type, just like CastII nodes. And that restricting of the type is only true under a certain if-branch.
> 
> That's not entirely true here. The `ConvL2I` captures the type of its input so not a narrower type. The problem is that the type is that of a `Phi` for a counted loop and once pushed through phi, the type captured by the `ConvI2L` becomes incorrect.

So what exactly is it that guarantees the correctness of the `phi` range under the counted loop that is not true when you push it back? I mean I would assume the `phi` can only have values that its inputs actually produce, so its inputs cannot have wildly different ranges, right? At some point, this range must be established by some control flow, at which point we can do the "type restriction".

I would now have to dive into the code and debug if the "type restriction" for counted loop phi happens purely because of the input values, or because of explicitly restrincting the type of the `ConvI2L`. But I do see that there is some `new ConvI2LNode(input, type)` cases where we do restrict the type of a `ConvI2L`.

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

PR Comment: https://git.openjdk.org/jdk/pull/19086#issuecomment-2108260349


More information about the hotspot-compiler-dev mailing list