diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp index 62c1a8362e9..2efb15fbd28 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -1055,6 +1055,9 @@ void SuperWord::filter_packs() { // Can code be generated for pack p? bool SuperWord::implemented(Node_List* p) { Node* p0 = p->at(0); + if (VectorNode::is_shift(p0) && in_bb(p0->in(2))) { + return false; // vector shift count should be loop's invariant. + } return VectorNode::implemented(p0->Opcode(), p->size(), velt_basic_type(p0)); } @@ -1404,6 +1407,7 @@ Node* SuperWord::vector_opd(Node_List* p, int opd_idx) { if (same_opd) { if (opd->is_Vector() || opd->is_LoadVector()) { + assert(((opd_idx != 2) || !VectorNode::is_shift(p0)), "shift's count can't be vector"); return opd; // input is matching vector } if ((opd_idx == 2) && VectorNode::is_shift(p0)) { diff --git a/hotspot/src/share/vm/opto/vectornode.cpp b/hotspot/src/share/vm/opto/vectornode.cpp index a0144df9041..8e5e03b9fa2 100644 --- a/hotspot/src/share/vm/opto/vectornode.cpp +++ b/hotspot/src/share/vm/opto/vectornode.cpp @@ -180,9 +180,9 @@ bool VectorNode::is_shift(Node* n) { return false; } -// Check if input is loop invarient vector. +// Check if input is loop invariant vector. bool VectorNode::is_invariant_vector(Node* n) { - // Only Replicate vector nodes are loop invarient for now. + // Only Replicate vector nodes are loop invariant for now. switch (n->Opcode()) { case Op_ReplicateB: case Op_ReplicateS: