diff src/share/vm/opto/cfgnode.cpp @ 3845:c96c3eb1efae

7068051: SIGSEGV in PhaseIdealLoop::build_loop_late_post Summary: Removed predicate cloning from loop peeling optimization and from split fall-in paths. Reviewed-by: never
author kvn
date Fri, 29 Jul 2011 09:16:29 -0700
parents b55f5bd7ec66
children 8c57262447d3
line wrap: on
line diff
--- a/src/share/vm/opto/cfgnode.cpp	Thu Jul 28 13:03:39 2011 -0700
+++ b/src/share/vm/opto/cfgnode.cpp	Fri Jul 29 09:16:29 2011 -0700
@@ -1349,17 +1349,9 @@
 static void split_once(PhaseIterGVN *igvn, Node *phi, Node *val, Node *n, Node *newn) {
   igvn->hash_delete(n);         // Remove from hash before hacking edges
 
-  Node* predicate_proj = NULL;
   uint j = 1;
   for (uint i = phi->req()-1; i > 0; i--) {
     if (phi->in(i) == val) {   // Found a path with val?
-      if (n->is_Region()) {
-        Node* proj = PhaseIdealLoop::find_predicate(n->in(i));
-        if (proj != NULL) {
-          assert(predicate_proj == NULL, "only one predicate entry expected");
-          predicate_proj = proj;
-        }
-      }
       // Add to NEW Region/Phi, no DU info
       newn->set_req( j++, n->in(i) );
       // Remove from OLD Region/Phi
@@ -1371,11 +1363,6 @@
   // entire Region/Phi conglomerate has been hacked as a single huge transform.
   igvn->register_new_node_with_optimizer( newn );
 
-  // Clone loop predicates
-  if (predicate_proj != NULL) {
-    newn = igvn->clone_loop_predicates(predicate_proj, newn, !n->is_CountedLoop());
-  }
-
   // Now I can point to the new node.
   n->add_req(newn);
   igvn->_worklist.push(n);
@@ -1404,13 +1391,18 @@
 
   Node *val = phi->in(i);       // Constant to split for
   uint hit = 0;                 // Number of times it occurs
+  Node *r = phi->region();
 
   for( ; i < phi->req(); i++ ){ // Count occurrences of constant
     Node *n = phi->in(i);
     if( !n ) return NULL;
     if( phase->type(n) == Type::TOP ) return NULL;
-    if( phi->in(i) == val )
+    if( phi->in(i) == val ) {
       hit++;
+      if (PhaseIdealLoop::find_predicate(r->in(i)) != NULL) {
+        return NULL;            // don't split loop entry path
+      }
+    }
   }
 
   if( hit <= 1 ||               // Make sure we find 2 or more
@@ -1420,7 +1412,6 @@
   // Now start splitting out the flow paths that merge the same value.
   // Split first the RegionNode.
   PhaseIterGVN *igvn = phase->is_IterGVN();
-  Node *r = phi->region();
   RegionNode *newr = new (phase->C, hit+1) RegionNode(hit+1);
   split_once(igvn, phi, val, r, newr);