1 /* |
1 /* |
2 * Copyright 1998-2009 Sun Microsystems, Inc. All Rights Reserved. |
2 * Copyright 1998-2010 Sun Microsystems, Inc. All Rights Reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
734 // they also def flags; if that flag def is unused the |
734 // they also def flags; if that flag def is unused the |
735 // allocator sees a flag-setting instruction with no use of |
735 // allocator sees a flag-setting instruction with no use of |
736 // the flags and assumes it's dead. This keeps the (useless) |
736 // the flags and assumes it's dead. This keeps the (useless) |
737 // flag-setting behavior alive while also keeping the (useful) |
737 // flag-setting behavior alive while also keeping the (useful) |
738 // memory update effect. |
738 // memory update effect. |
739 for( uint k = ((n->Opcode() == Op_SCMemProj) ? 0:1); k < n->req(); k++ ) { |
739 uint begin = 1; |
|
740 uint end = n->req(); |
|
741 if (n->Opcode() == Op_SCMemProj) { |
|
742 begin = 0; |
|
743 } else if (n->is_Mach()) { |
|
744 switch (n->as_Mach()->ideal_Opcode()) { |
|
745 case Op_MemBarAcquire: |
|
746 case Op_MemBarVolatile: |
|
747 if (n->len() >= MemBarNode::Precedent + 1 && |
|
748 n->in(MemBarNode::Precedent) != NULL && |
|
749 n->in(MemBarNode::Precedent)->outcnt() == 1) { |
|
750 // This membar node is the single user of it's input |
|
751 // so the input won't be considered live and this node |
|
752 // would get deleted during copy elimination so force |
|
753 // it to be live. |
|
754 end = MemBarNode::Precedent + 1; |
|
755 } |
|
756 break; |
|
757 } |
|
758 } |
|
759 |
|
760 for( uint k = begin; k < end; k++ ) { |
740 Node *def = n->in(k); |
761 Node *def = n->in(k); |
741 uint x = n2lidx(def); |
762 uint x = n2lidx(def); |
742 if( !x ) continue; |
763 if( !x ) continue; |
743 LRG &lrg = lrgs(x); |
764 LRG &lrg = lrgs(x); |
744 // No use-side cost for spilling debug info |
765 // No use-side cost for spilling debug info |