-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 16, 17
-
b22
While writing some tests using the new IR-based test framework (https://github.com/openjdk/jdk/pull/3508) I found the following issues on ADDLNode::Ideal transformations:
// Convert "(a-b)+(c-a)" into "(c-b)"
if( op2 == Op_SubL && in1->in(1) == in1->in(2) ) ...
*** Notice the second part of the comparison.
// Convert "(0-y)+x" into "(x-y)"
if( op1 == Op_SubL && phase->type(in1->in(1)) == TypeInt::ZERO )
*** Should be "TypeLong::ZERO" instead of "TypeInt::ZERO"
*** Actually found by Christian Hagedorn
// Convert "X+X+X...+X+Y" into "k*X+Y" or really convert "X+(X+Y)"
// into "(X<<1)+Y" and let shift-folding happen.
if( op2 == Op_AddL &&
in2->in(1) == in1 &&
op1 != Op_ConL &&
0 ) {
*** The optimization is disabled due the "&& 0" at the end. Later I found that this is being tracked by this issue: https://bugs.openjdk.java.net/browse/JDK-8259624
// Convert "(a-b)+(c-a)" into "(c-b)"
if( op2 == Op_SubL && in1->in(1) == in1->in(2) ) ...
*** Notice the second part of the comparison.
// Convert "(0-y)+x" into "(x-y)"
if( op1 == Op_SubL && phase->type(in1->in(1)) == TypeInt::ZERO )
*** Should be "TypeLong::ZERO" instead of "TypeInt::ZERO"
*** Actually found by Christian Hagedorn
// Convert "X+X+X...+X+Y" into "k*X+Y" or really convert "X+(X+Y)"
// into "(X<<1)+Y" and let shift-folding happen.
if( op2 == Op_AddL &&
in2->in(1) == in1 &&
op1 != Op_ConL &&
0 ) {
*** The optimization is disabled due the "&& 0" at the end. Later I found that this is being tracked by this issue: https://bugs.openjdk.java.net/browse/JDK-8259624
- duplicates
-
JDK-8259624 C2: Fix disabled reduction in AddLNode::Ideal
- Closed
- relates to
-
JDK-8267980 Add IR tests for JDK-8266601
- Closed