File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -435,6 +435,14 @@ Node *SubLNode::Ideal(PhaseGVN *phase, bool can_reshape) {
435
435
if ( op1 == Op_AddL && op2 == Op_AddL && in1->in (2 ) == in2->in (2 ) )
436
436
return new SubLNode ( in1->in (1 ), in2->in (1 ) );
437
437
438
+ // Convert "(A+X) - (X+B)" into "A - B"
439
+ if ( op1 == Op_AddL && op2 == Op_AddL && in1->in (2 ) == in2->in (1 ) )
440
+ return new SubLNode ( in1->in (1 ), in2->in (2 ) );
441
+
442
+ // Convert "(X+A) - (B+X)" into "A - B"
443
+ if ( op1 == Op_AddL && op2 == Op_AddL && in1->in (1 ) == in2->in (2 ) )
444
+ return new SubLNode ( in1->in (2 ), in2->in (1 ) );
445
+
438
446
// Convert "A-(B-C)" into (A+C)-B"
439
447
if ( op2 == Op_SubL && in2->outcnt () == 1 ) {
440
448
Node *add1 = phase->transform ( new AddLNode ( in1, in2->in (2 ) ) );
You can’t perform that action at this time.
0 commit comments