src/share/vm/opto/postaloc.cpp

changeset 2350
2f644f85485d
parent 2314
f95d63e2154a
child 3133
8f47d8870d9a
     1.1 --- a/src/share/vm/opto/postaloc.cpp	Thu Dec 02 17:21:12 2010 -0800
     1.2 +++ b/src/share/vm/opto/postaloc.cpp	Fri Dec 03 01:34:31 2010 -0800
     1.3 @@ -200,6 +200,19 @@
     1.4    // then reloaded BUT survives in a register the whole way.
     1.5    Node *val = skip_copies(n->in(k));
     1.6  
     1.7 +  if (val == x && nk_idx != 0 &&
     1.8 +      regnd[nk_reg] != NULL && regnd[nk_reg] != x &&
     1.9 +      n2lidx(x) == n2lidx(regnd[nk_reg])) {
    1.10 +    // When rematerialzing nodes and stretching lifetimes, the
    1.11 +    // allocator will reuse the original def for multidef LRG instead
    1.12 +    // of the current reaching def because it can't know it's safe to
    1.13 +    // do so.  After allocation completes if they are in the same LRG
    1.14 +    // then it should use the current reaching def instead.
    1.15 +    n->set_req(k, regnd[nk_reg]);
    1.16 +    blk_adjust += yank_if_dead(val, current_block, &value, &regnd);
    1.17 +    val = skip_copies(n->in(k));
    1.18 +  }
    1.19 +
    1.20    if( val == x ) return blk_adjust; // No progress?
    1.21  
    1.22    bool single = is_single_register(val->ideal_reg());

mercurial