changeset 4067:ba03bb58ca5a

8022783: Optimize C2 optimizations Reviewed-by: kvn, twisti
author adlertz
date Wed, 08 Oct 2014 01:45:41 +0100
parents 94d3f3cab236
children 2b7debe8a16a
files src/share/vm/opto/reg_split.cpp
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/opto/reg_split.cpp	Fri Oct 03 17:43:56 2014 +0100
+++ b/src/share/vm/opto/reg_split.cpp	Wed Oct 08 01:45:41 2014 +0100
@@ -316,10 +316,13 @@
   if( def->req() > 1 ) {
     for( uint i = 1; i < def->req(); i++ ) {
       Node *in = def->in(i);
-      // Check for single-def (LRG cannot redefined)
       uint lidx = n2lidx(in);
-      if( lidx >= _maxlrg ) continue; // Value is a recent spill-copy
-      if (lrgs(lidx).is_singledef()) continue;
+      // We do not need this for live ranges that are only defined once.
+      // However, this is not true for spill copies that are added in this
+      // Split() pass, since they might get coalesced later on in this pass.
+      if (lidx < _maxlrg && lrgs(lidx).is_singledef()) {
+         continue;
+       }
 
       Block *b_def = _cfg._bbs[def->_idx];
       int idx_def = b_def->find_node(def);