JDK-8303970 : C2 can not merge homogeneous adjacent two If
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 21
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-03-10
  • Updated: 2023-03-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Description
    public static void test(int a, int b) { // ok, identical ifs, apply split_if
        if (a == b) {
            int_field = 0x42;
        } else {
            int_field = 42;
        }
        if (a == b) {
            int_field = 0x42;
        } else {
            int_field = 42;
        }
    }

    public static void test(int a, int b) { // do nothing
        if (a == b) {
            int_field = 0x42;
        } else {
            int_field = 42;
        }
        if (b == a) { 
            int_field = 0x42;
        } else {
            int_field = 42;
        }
    }
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/12978 Date: 2023-03-10 14:37:06 +0000
10-03-2023

[~roland], is that something you plan to address with JDK-8275202? Update: Roland said no. I'm still linking it because it's kind of related.
10-03-2023