diff src/share/vm/opto/superword.cpp @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents 6987871cfb9b
children dc682d9431f3
line wrap: on
line diff
--- a/src/share/vm/opto/superword.cpp	Sat Dec 17 20:50:09 2011 +0100
+++ b/src/share/vm/opto/superword.cpp	Sat Dec 17 21:40:27 2011 +0100
@@ -70,6 +70,8 @@
   assert(lpt->_head->is_CountedLoop(), "must be");
   CountedLoopNode *cl = lpt->_head->as_CountedLoop();
 
+  if (!cl->is_valid_counted_loop()) return; // skip malformed counted loop
+
   if (!cl->is_main_loop() ) return; // skip normal, pre, and post loops
 
   // Check for no control flow in body (other than exit)
@@ -1167,7 +1169,7 @@
 
       } else if (n->is_Store()) {
         // Promote value to be stored to vector
-        VectorNode* val = vector_opd(p, MemNode::ValueIn);
+        Node* val = vector_opd(p, MemNode::ValueIn);
 
         int   opc = n->Opcode();
         Node* ctl = n->in(MemNode::Control);
@@ -1199,7 +1201,7 @@
 
 //------------------------------vector_opd---------------------------
 // Create a vector operand for the nodes in pack p for operand: in(opd_idx)
-VectorNode* SuperWord::vector_opd(Node_List* p, int opd_idx) {
+Node* SuperWord::vector_opd(Node_List* p, int opd_idx) {
   Node* p0 = p->at(0);
   uint vlen = p->size();
   Node* opd = p0->in(opd_idx);
@@ -1215,9 +1217,10 @@
   }
 
   if (same_opd) {
-    if (opd->is_Vector()) {
-      return (VectorNode*)opd; // input is matching vector
+    if (opd->is_Vector() || opd->is_VectorLoad()) {
+      return opd; // input is matching vector
     }
+    assert(!opd->is_VectorStore(), "such vector is not expected here");
     // Convert scalar input to vector. Use p0's type because it's container
     // maybe smaller than the operand's container.
     const Type* opd_t = velt_type(!in_bb(opd) ? p0 : opd);