6927049: assert(is_Loop(),"invalid node class")
authornever
Fri, 19 Feb 2010 13:06:11 -0800
changeset 5026 51f0e7aa2245
parent 5025 05adc9b8f96a
child 5027 813528a66eed
6927049: assert(is_Loop(),"invalid node class") Reviewed-by: kvn
hotspot/src/share/vm/opto/loopTransform.cpp
--- a/hotspot/src/share/vm/opto/loopTransform.cpp	Fri Feb 19 10:04:16 2010 -0800
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp	Fri Feb 19 13:06:11 2010 -0800
@@ -2117,6 +2117,18 @@
 bool PhaseIdealLoop::loop_predication_impl(IdealLoopTree *loop) {
   if (!UseLoopPredicate) return false;
 
+  if (!loop->_head->is_Loop()) {
+    // Could be a simple region when irreducible loops are present.
+    return false;
+  }
+
+  CountedLoopNode *cl = NULL;
+  if (loop->_head->is_CountedLoop()) {
+    cl = loop->_head->as_CountedLoop();
+    // do nothing for iteration-splitted loops
+    if (!cl->is_normal_loop()) return false;
+  }
+
   // Too many traps seen?
   bool tmt = C->too_many_traps(C->method(), 0, Deoptimization::Reason_predicate);
   int tc = C->trap_count(Deoptimization::Reason_predicate);
@@ -2129,13 +2141,6 @@
     return false;
   }
 
-  CountedLoopNode *cl = NULL;
-  if (loop->_head->is_CountedLoop()) {
-    cl = loop->_head->as_CountedLoop();
-    // do nothing for iteration-splitted loops
-    if(!cl->is_normal_loop()) return false;
-  }
-
   LoopNode *lpn  = loop->_head->as_Loop();
   Node* entry = lpn->in(LoopNode::EntryControl);