changeset 13488:a9ec58a1f613

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
author kvn
date Tue, 21 Aug 2012 14:50:02 -0700
parents 75aa4880b15f
children 51d8afc9439e
files hotspot/src/share/vm/opto/superword.cpp hotspot/src/share/vm/opto/vectornode.cpp
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/share/vm/opto/superword.cpp	Tue Aug 21 10:48:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/superword.cpp	Tue Aug 21 14:50:02 2012 -0700
@@ -1055,6 +1055,9 @@
 // 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 @@
 
   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)) {
--- a/hotspot/src/share/vm/opto/vectornode.cpp	Tue Aug 21 10:48:50 2012 -0700
+++ b/hotspot/src/share/vm/opto/vectornode.cpp	Tue Aug 21 14:50:02 2012 -0700
@@ -180,9 +180,9 @@
   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: