RFR: 8350563: C2 compilation fails because PhaseCCP does not reach a fixpoint [v7]
Liam Miller-Cushon
cushon at openjdk.org
Sat Apr 5 18:51:35 UTC 2025
On Mon, 31 Mar 2025 16:08:57 GMT, Liam Miller-Cushon <cushon at openjdk.org> wrote:
>> Hello, please consider this fix for [JDK-8350563](https://bugs.openjdk.org/browse/JDK-8350563) contributed by my colleague Matthias Ernst.
>>
>> https://github.com/openjdk/jdk/pull/22856 introduced a new `Value()` optimization for the pattern `AndIL(Con, Mask)`.
>> This optimization can look through CastNodes, and therefore requires additional logic in CCP to push these
>> transitive uses to the worklist.
>>
>> The optimization is closely related to analogous optimizations for SHIFT nodes, and we also extend the existing logic for
>> CCP worklist handling: the current logic is "if the shift input to a SHIFT node changes, push indirect AND node uses to the CCP worklist".
>> We extend it by adding "if the (new) type of a node is an IntegerType that `is_con, ...` to the predicate.
>
> Liam Miller-Cushon has updated the pull request incrementally with one additional commit since the last revision:
>
> Explicitly check for OP_Con instead of TypeInteger::is_con.
>
> 322 Phi === 303 119 255 [[ 399 388 351 751 366 377 ]] #int:-256..127 !jvms: Integer::parseInt @ bci:151 (line 625)
>
> While this Phi dumps as "#int:-256..127", `phase->type(expr)` returns a type that is_con -256.
>From Matthias
---
Thank you Christian for the excellent explanation. I understand how the phi going from con to non-con makes the AND node go from 0 back to top. I've pushed a commit with the fix and the reproducer; verified the latter only passes w/ the fix.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23871#issuecomment-2781039859
More information about the hotspot-compiler-dev
mailing list