Mercurial > hg > truffle
diff src/share/vm/opto/macro.cpp @ 3788:e3cbc9ddd434
7044738: Loop unroll optimization causes incorrect result
Summary: take into account memory dependencies when clonning nodes in clone_up_backedge_goo().
Reviewed-by: never
author | kvn |
---|---|
date | Tue, 28 Jun 2011 15:24:29 -0700 |
parents | 642c68c75db9 |
children | f1c12354c3f7 |
line wrap: on
line diff
--- a/src/share/vm/opto/macro.cpp Tue Jun 28 15:04:39 2011 -0700 +++ b/src/share/vm/opto/macro.cpp Tue Jun 28 15:24:29 2011 -0700 @@ -391,13 +391,9 @@ } } // Check if an appropriate new value phi already exists. - Node* new_phi = NULL; - uint size = value_phis->size(); - for (uint i=0; i < size; i++) { - if ( mem->_idx == value_phis->index_at(i) ) { - return value_phis->node_at(i); - } - } + Node* new_phi = value_phis->find(mem->_idx); + if (new_phi != NULL) + return new_phi; if (level <= 0) { return NULL; // Give up: phi tree too deep