Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8259624

C2: Fix disabled reduction in AddLNode::Ideal

XMLWordPrintable

      SonarCloud reports this branch is never taken in AddLNode::Ideal:

        // Convert "X+X+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 ) {
          Node *shift = phase->transform(new LShiftLNode(in1,phase->intcon(1)));
          return new AddLNode(shift,in2->in(2));
        }

      Notice the trailing "&& 0" in the condition. Seems to be that way since the initial load.

            cslucas Cesar Soares
            shade Aleksey Shipilev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: