6896370: CTW fails share/vm/opto/matcher.cpp:1475 "duplicating node that's already been matched"

Wed, 04 Nov 2009 14:16:20 -0800

author
kvn
date
Wed, 04 Nov 2009 14:16:20 -0800
changeset 1496
09572fede9d1
parent 1495
323bd24c6520
child 1497
dcdcc8c16e20

6896370: CTW fails share/vm/opto/matcher.cpp:1475 "duplicating node that's already been matched"
Summary: Move DecodeN code outside the memory nodes only code.
Reviewed-by: never

src/share/vm/opto/matcher.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/vm/opto/matcher.cpp	Mon Nov 02 11:17:55 2009 +0100
     1.2 +++ b/src/share/vm/opto/matcher.cpp	Wed Nov 04 14:16:20 2009 -0800
     1.3 @@ -1832,67 +1832,23 @@
     1.4        case Op_Binary:         // These are introduced in the Post_Visit state.
     1.5          ShouldNotReachHere();
     1.6          break;
     1.7 -      case Op_StoreB:         // Do match these, despite no ideal reg
     1.8 -      case Op_StoreC:
     1.9 -      case Op_StoreCM:
    1.10 -      case Op_StoreD:
    1.11 -      case Op_StoreF:
    1.12 -      case Op_StoreI:
    1.13 -      case Op_StoreL:
    1.14 -      case Op_StoreP:
    1.15 -      case Op_StoreN:
    1.16 -      case Op_Store16B:
    1.17 -      case Op_Store8B:
    1.18 -      case Op_Store4B:
    1.19 -      case Op_Store8C:
    1.20 -      case Op_Store4C:
    1.21 -      case Op_Store2C:
    1.22 -      case Op_Store4I:
    1.23 -      case Op_Store2I:
    1.24 -      case Op_Store2L:
    1.25 -      case Op_Store4F:
    1.26 -      case Op_Store2F:
    1.27 -      case Op_Store2D:
    1.28        case Op_ClearArray:
    1.29        case Op_SafePoint:
    1.30          mem_op = true;
    1.31          break;
    1.32 -      case Op_LoadB:
    1.33 -      case Op_LoadUS:
    1.34 -      case Op_LoadD:
    1.35 -      case Op_LoadF:
    1.36 -      case Op_LoadI:
    1.37 -      case Op_LoadKlass:
    1.38 -      case Op_LoadNKlass:
    1.39 -      case Op_LoadL:
    1.40 -      case Op_LoadS:
    1.41 -      case Op_LoadP:
    1.42 -      case Op_LoadN:
    1.43 -      case Op_LoadRange:
    1.44 -      case Op_LoadD_unaligned:
    1.45 -      case Op_LoadL_unaligned:
    1.46 -      case Op_Load16B:
    1.47 -      case Op_Load8B:
    1.48 -      case Op_Load4B:
    1.49 -      case Op_Load4C:
    1.50 -      case Op_Load2C:
    1.51 -      case Op_Load8C:
    1.52 -      case Op_Load8S:
    1.53 -      case Op_Load4S:
    1.54 -      case Op_Load2S:
    1.55 -      case Op_Load4I:
    1.56 -      case Op_Load2I:
    1.57 -      case Op_Load2L:
    1.58 -      case Op_Load4F:
    1.59 -      case Op_Load2F:
    1.60 -      case Op_Load2D:
    1.61 -        mem_op = true;
    1.62 -        // Must be root of match tree due to prior load conflict
    1.63 -        if( C->subsume_loads() == false ) {
    1.64 -          set_shared(n);
    1.65 +      default:
    1.66 +        if( n->is_Store() ) {
    1.67 +          // Do match stores, despite no ideal reg
    1.68 +          mem_op = true;
    1.69 +          break;
    1.70 +        }
    1.71 +        if( n->is_Mem() ) { // Loads and LoadStores
    1.72 +          mem_op = true;
    1.73 +          // Loads must be root of match tree due to prior load conflict
    1.74 +          if( C->subsume_loads() == false )
    1.75 +            set_shared(n);
    1.76          }
    1.77          // Fall into default case
    1.78 -      default:
    1.79          if( !n->ideal_reg() )
    1.80            set_dontcare(n);  // Unmatchable Nodes
    1.81        } // end_switch
    1.82 @@ -1913,15 +1869,15 @@
    1.83            continue; // for(int i = ...)
    1.84          }
    1.85  
    1.86 -        // Clone addressing expressions as they are "free" in most instructions
    1.87 +        if( mop == Op_AddP && m->in(AddPNode::Base)->Opcode() == Op_DecodeN ) {
    1.88 +          // Bases used in addresses must be shared but since
    1.89 +          // they are shared through a DecodeN they may appear
    1.90 +          // to have a single use so force sharing here.
    1.91 +          set_shared(m->in(AddPNode::Base)->in(1));
    1.92 +        }
    1.93 +
    1.94 +        // Clone addressing expressions as they are "free" in memory access instructions
    1.95          if( mem_op && i == MemNode::Address && mop == Op_AddP ) {
    1.96 -          if (m->in(AddPNode::Base)->Opcode() == Op_DecodeN) {
    1.97 -            // Bases used in addresses must be shared but since
    1.98 -            // they are shared through a DecodeN they may appear
    1.99 -            // to have a single use so force sharing here.
   1.100 -            set_shared(m->in(AddPNode::Base)->in(1));
   1.101 -          }
   1.102 -
   1.103            // Some inputs for address expression are not put on stack
   1.104            // to avoid marking them as shared and forcing them into register
   1.105            // if they are used only in address expressions.

mercurial