Tue, 21 Aug 2012 14:50:02 -0700
7192964: assert(false) failed: bad AD file
Summary: Shifts with loop variant counts "a[i]=1<<b[i];" should not be vectorized since hw does not support it.
Reviewed-by: twisti
src/share/vm/opto/superword.cpp | file | annotate | diff | comparison | revisions | |
src/share/vm/opto/vectornode.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/share/vm/opto/superword.cpp Tue Aug 21 10:48:50 2012 -0700 1.2 +++ b/src/share/vm/opto/superword.cpp Tue Aug 21 14:50:02 2012 -0700 1.3 @@ -1055,6 +1055,9 @@ 1.4 // Can code be generated for pack p? 1.5 bool SuperWord::implemented(Node_List* p) { 1.6 Node* p0 = p->at(0); 1.7 + if (VectorNode::is_shift(p0) && in_bb(p0->in(2))) { 1.8 + return false; // vector shift count should be loop's invariant. 1.9 + } 1.10 return VectorNode::implemented(p0->Opcode(), p->size(), velt_basic_type(p0)); 1.11 } 1.12 1.13 @@ -1404,6 +1407,7 @@ 1.14 1.15 if (same_opd) { 1.16 if (opd->is_Vector() || opd->is_LoadVector()) { 1.17 + assert(((opd_idx != 2) || !VectorNode::is_shift(p0)), "shift's count can't be vector"); 1.18 return opd; // input is matching vector 1.19 } 1.20 if ((opd_idx == 2) && VectorNode::is_shift(p0)) {
2.1 --- a/src/share/vm/opto/vectornode.cpp Tue Aug 21 10:48:50 2012 -0700 2.2 +++ b/src/share/vm/opto/vectornode.cpp Tue Aug 21 14:50:02 2012 -0700 2.3 @@ -180,9 +180,9 @@ 2.4 return false; 2.5 } 2.6 2.7 -// Check if input is loop invarient vector. 2.8 +// Check if input is loop invariant vector. 2.9 bool VectorNode::is_invariant_vector(Node* n) { 2.10 - // Only Replicate vector nodes are loop invarient for now. 2.11 + // Only Replicate vector nodes are loop invariant for now. 2.12 switch (n->Opcode()) { 2.13 case Op_ReplicateB: 2.14 case Op_ReplicateS: