< prev index next >

src/share/vm/opto/gcm.cpp

Print this page




 495 // only add edges to stores which might interfere.
 496 //
 497 // Return the (updated) LCA.  There will not be any possibly interfering
 498 // store between the load's "early block" and the updated LCA.
 499 // Any stores in the updated LCA will have new precedence edges
 500 // back to the load.  The caller is expected to schedule the load
 501 // in the LCA, in which case the precedence edges will make LCM
 502 // preserve anti-dependences.  The caller may also hoist the load
 503 // above the LCA, if it is not the early block.
 504 Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
 505   assert(load->needs_anti_dependence_check(), "must be a load of some sort");
 506   assert(LCA != NULL, "");
 507   DEBUG_ONLY(Block* LCA_orig = LCA);
 508 
 509   // Compute the alias index.  Loads and stores with different alias indices
 510   // do not need anti-dependence edges.
 511   int load_alias_idx = C->get_alias_index(load->adr_type());
 512 #ifdef ASSERT
 513   if (load_alias_idx == Compile::AliasIdxBot && C->AliasLevel() > 0 &&
 514       (PrintOpto || VerifyAliases ||
 515        PrintMiscellaneous && (WizardMode || Verbose))) {
 516     // Load nodes should not consume all of memory.
 517     // Reporting a bottom type indicates a bug in adlc.
 518     // If some particular type of node validly consumes all of memory,
 519     // sharpen the preceding "if" to exclude it, so we can catch bugs here.
 520     tty->print_cr("*** Possible Anti-Dependence Bug:  Load consumes all of memory.");
 521     load->dump(2);
 522     if (VerifyAliases)  assert(load_alias_idx != Compile::AliasIdxBot, "");
 523   }
 524 #endif
 525   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrComp),
 526          "String compare is only known 'load' that does not conflict with any stores");
 527   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrEquals),
 528          "String equals is a 'load' that does not conflict with any stores");
 529   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrIndexOf),
 530          "String indexOf is a 'load' that does not conflict with any stores");
 531   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrIndexOfChar),
 532          "String indexOfChar is a 'load' that does not conflict with any stores");
 533   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_AryEq),
 534          "Arrays equals is a 'load' that does not conflict with any stores");
 535   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_HasNegatives),




 495 // only add edges to stores which might interfere.
 496 //
 497 // Return the (updated) LCA.  There will not be any possibly interfering
 498 // store between the load's "early block" and the updated LCA.
 499 // Any stores in the updated LCA will have new precedence edges
 500 // back to the load.  The caller is expected to schedule the load
 501 // in the LCA, in which case the precedence edges will make LCM
 502 // preserve anti-dependences.  The caller may also hoist the load
 503 // above the LCA, if it is not the early block.
 504 Block* PhaseCFG::insert_anti_dependences(Block* LCA, Node* load, bool verify) {
 505   assert(load->needs_anti_dependence_check(), "must be a load of some sort");
 506   assert(LCA != NULL, "");
 507   DEBUG_ONLY(Block* LCA_orig = LCA);
 508 
 509   // Compute the alias index.  Loads and stores with different alias indices
 510   // do not need anti-dependence edges.
 511   int load_alias_idx = C->get_alias_index(load->adr_type());
 512 #ifdef ASSERT
 513   if (load_alias_idx == Compile::AliasIdxBot && C->AliasLevel() > 0 &&
 514       (PrintOpto || VerifyAliases ||
 515        (PrintMiscellaneous && (WizardMode || Verbose)))) {
 516     // Load nodes should not consume all of memory.
 517     // Reporting a bottom type indicates a bug in adlc.
 518     // If some particular type of node validly consumes all of memory,
 519     // sharpen the preceding "if" to exclude it, so we can catch bugs here.
 520     tty->print_cr("*** Possible Anti-Dependence Bug:  Load consumes all of memory.");
 521     load->dump(2);
 522     if (VerifyAliases)  assert(load_alias_idx != Compile::AliasIdxBot, "");
 523   }
 524 #endif
 525   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrComp),
 526          "String compare is only known 'load' that does not conflict with any stores");
 527   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrEquals),
 528          "String equals is a 'load' that does not conflict with any stores");
 529   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrIndexOf),
 530          "String indexOf is a 'load' that does not conflict with any stores");
 531   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_StrIndexOfChar),
 532          "String indexOfChar is a 'load' that does not conflict with any stores");
 533   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_AryEq),
 534          "Arrays equals is a 'load' that does not conflict with any stores");
 535   assert(load_alias_idx || (load->is_Mach() && load->as_Mach()->ideal_Opcode() == Op_HasNegatives),


< prev index next >