# HG changeset patch # User neliasso # Date 1488805732 -3600 # Mon Mar 06 14:08:52 2017 +0100 # Node ID de086005215433a4c5301d649454f2ce0ba33e14 # Parent 18607b3adc857731753af321fc02ed393c9473c8 8164954: split_if creates empty phi and region nodes Summary: Don't split if all edges will be moved to new phi Reviewed-by: diff --git a/src/share/vm/opto/ifnode.cpp b/src/share/vm/opto/ifnode.cpp --- a/src/share/vm/opto/ifnode.cpp +++ b/src/share/vm/opto/ifnode.cpp @@ -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