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

Reverse*VNode::Identity problem

    XMLWordPrintable

Details

    • b09

    Description

      (synopsis is provisional, feel free to change as you see fit)

      SonarCloud reports that the if-else-branch in Reverse*VNode::Identity has the same code:

      Node* ReverseBytesVNode::Identity(PhaseGVN* phase) {
        if (is_predicated_using_blend()) {
          return this;
        }
        // ReverseBytesV (ReverseBytesV X , MASK) , MASK => X
        if (in(1)->Opcode() == Op_ReverseBytesV) {
          if (is_predicated_vector() && in(1)->is_predicated_vector() && in(2) == in(1)->in(2)) {
            return in(1)->in(1);
          } else {
            // ReverseBytesV (ReverseBytesV X) => X
            return in(1)->in(1);
          }
        }
        return this;
      }

      Seems to me the first condition checks that MASKs are the same in both nodes. But if they are not, we are falling to "else" branch, where we do the same transformation anyway. So, there might be a bug lurking there when MASKs are different.

      Attachments

        Issue Links

          Activity

            People

              jbhateja Jatin Bhateja
              shade Aleksey Shipilev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: