Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8278733 | 19 | Igor Veresov | P4 | Resolved | Fixed | b28 |
A DESCRIPTION OF THE PROBLEM :
## Synopsis
New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x"
## Description
A new ideal optimization can be introduced for subnode: converting "c0 - (x + c1)" into "(c0 - c1) - x".
// Convert "c0 - (x + c1)" into "(c0 - c1) - x"
if (in2->Opcode() == Op_AddI
&& phase->type(in1)->isa_int() != NULL
&& phase->type(in1)->isa_int()->is_con()
&& phase->type(in2->in(2))->isa_int() != NULL
&& phase->type(in2->in(2))->isa_int()->is_con()) {
jint c0 = phase->type(in1)->isa_int()->get_con();
jint c1 = phase->type(in2->in(2))->isa_int()->get_con();
return new SubINode(phase->intcon(java_subtract(c0, c1)), in2->in(1));
}
I have submitted a pull request https://github.com/openjdk/jdk/pull/6441 and included both microbenchmark and jtreg tests.
## Synopsis
New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x"
## Description
A new ideal optimization can be introduced for subnode: converting "c0 - (x + c1)" into "(c0 - c1) - x".
// Convert "c0 - (x + c1)" into "(c0 - c1) - x"
if (in2->Opcode() == Op_AddI
&& phase->type(in1)->isa_int() != NULL
&& phase->type(in1)->isa_int()->is_con()
&& phase->type(in2->in(2))->isa_int() != NULL
&& phase->type(in2->in(2))->isa_int()->is_con()) {
jint c0 = phase->type(in1)->isa_int()->get_con();
jint c1 = phase->type(in2->in(2))->isa_int()->get_con();
return new SubINode(phase->intcon(java_subtract(c0, c1)), in2->in(1));
}
I have submitted a pull request https://github.com/openjdk/jdk/pull/6441 and included both microbenchmark and jtreg tests.
- backported by
-
JDK-8278733 New subnode ideal optimization: converting "c0 - (x + c1)" into "(c0 - c1) - x"
-
- Resolved
-