< prev index next >

src/share/vm/opto/loopopts.cpp

Print this page

        

@@ -35,10 +35,11 @@
 #include "opto/mulnode.hpp"
 #include "opto/movenode.hpp"
 #include "opto/opaquenode.hpp"
 #include "opto/rootnode.hpp"
 #include "opto/subnode.hpp"
+#include "opto/valuetypenode.hpp"
 
 //=============================================================================
 //------------------------------split_thru_phi---------------------------------
 // Split Node 'n' through merge point if there is enough win.
 Node *PhaseIdealLoop::split_thru_phi( Node *n, Node *region, int policy ) {

@@ -1357,10 +1358,15 @@
     }
   }
 
   try_move_store_after_loop(n);
 
+  // Remove multiple allocations of the same value type
+  if (n->is_ValueType() && EliminateAllocations) {
+    n->as_ValueType()->remove_redundant_allocations(&_igvn, this);
+  }
+
   // Check for Opaque2's who's loop has disappeared - who's input is in the
   // same loop nest as their output.  Remove 'em, they are no longer useful.
   if( n_op == Op_Opaque2 &&
       n->in(1) != NULL &&
       get_loop(get_ctrl(n)) == get_loop(get_ctrl(n->in(1))) ) {
< prev index next >