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

C2: Fix disabled reduction in AddLNode::Ideal

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8, 11, 16, 17
    • Fix Version/s: 17
    • Component/s: hotspot

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cslucas John Tortugo
              Reporter:
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: