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;
}
}
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;
}
}
- relates to
-
JDK-8275202 C2: optimize out more redundant conditions
-
- Open
-
-
JDK-8278228 C2: Improve identical back-to-back if elimination
-
- Resolved
-
- links to
-
Review openjdk/jdk/12978