hotspot/src/share/vm/opto/ifnode.cpp
changeset 44241 99010d3fcc97
parent 37248 11a660dbbb8e
child 44314 30ae899b9eca
--- a/hotspot/src/share/vm/opto/ifnode.cpp	Mon Mar 06 21:28:33 2017 +0100
+++ b/hotspot/src/share/vm/opto/ifnode.cpp	Mon Mar 06 14:08:52 2017 +0100
@@ -249,6 +249,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;
+  }
+
   if (nb_predicate_proj > 1) {
     // Can happen in case of loop unswitching and when the loop is
     // optimized out: it's not a loop anymore so we don't care about