changeset 8443:9f401c01775b

8164954: split_if creates empty phi and region nodes Summary: Don't split if all edges will be moved to new phi Reviewed-by: kvn
author kevinw
date Sat, 14 Oct 2017 00:42:33 -0700
parents c89173159237
children d1b47c83a9dd
files src/share/vm/opto/ifnode.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/ifnode.cpp	Thu Sep 07 10:15:21 2017 -0400
+++ b/src/share/vm/opto/ifnode.cpp	Sat Oct 14 00:42:33 2017 -0700
@@ -234,6 +234,13 @@
       predicate_proj = proj;
     }
   }
+
+  // If all the defs of the phi are the same constant, we already have the desired end state.
+  // Skip the split that would create empty phi and region nodes.
+  if((r->req() - req_c) == 1) {
+    return NULL;
+  }
+
   Node* predicate_c = NULL;
   Node* predicate_x = NULL;
   bool counted_loop = r->is_CountedLoop();