RFR: 8350563: C2 compilation fails because PhaseCCP does not reach a fixpoint [v9]

Christian Hagedorn chagedorn at openjdk.org
Tue Apr 8 08:19:27 UTC 2025


On Mon, 7 Apr 2025 15:07: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:
> 
>   Merge tests together

test/hotspot/jtreg/compiler/ccp/TestAndConZeroCCP.java line 43:

> 41:         }
> 42:         Integer.parseInt("1");
> 43:     }

The test timed out in our CI. I think looping `run()` with `-Xint` is too slow (i.e. `compileonly` with `parseInt()`). I suggest to just exclude `run()` when checking for the `parseInt()` failure. Maybe something like that:

Suggestion:

 * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:RepeatCompilation=300 -XX:+StressIGVN -XX:+StressCCP -Xcomp
 *                   -XX:CompileOnly=java.lang.Integer::parseInt compiler.ccp.TestAndConZeroCCP compileonly
 * @run main compiler.ccp.TestAndConZeroCCP
 */
package compiler.ccp;

import java.util.Arrays;

public class TestAndConZeroCCP {

    public static void main(String[] args) {
        Integer.parseInt("1");
        if (args.length != 0) {
            return;
        }

        for (int i = 0; i < 10000; ++i) {
            run();
        }
    }

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23871#discussion_r2032651697


More information about the hotspot-compiler-dev mailing list