< prev index next >

src/hotspot/share/c1/c1_ValueMap.cpp

Print this page

596       instr->visit(this);
597       // perform actual value numbering
598       substitute(instr);
599     }
600 
601     // remember value map for successors
602     set_value_map_of(block, current_map());
603   }
604 
605   if (_has_substitutions) {
606     SubstitutionResolver resolver(ir);
607   }
608 
609   TRACE_VALUE_NUMBERING(tty->print("****** end of global value numbering. "); ValueMap::print_statistics());
610 }
611 
612 void GlobalValueNumbering::substitute(Instruction* instr) {
613   assert(!instr->has_subst(), "substitution already set");
614   Value subst = current_map()->find_insert(instr);
615   if (subst != instr) {


616     assert(!subst->has_subst(), "can't have a substitution");
617 
618     TRACE_VALUE_NUMBERING(tty->print_cr("substitution for %c%d set to %c%d", instr->type()->tchar(), instr->id(), subst->type()->tchar(), subst->id()));
619     instr->set_subst(subst);
620     _has_substitutions = true;
621   }
622   set_processed(instr);
623 }

596       instr->visit(this);
597       // perform actual value numbering
598       substitute(instr);
599     }
600 
601     // remember value map for successors
602     set_value_map_of(block, current_map());
603   }
604 
605   if (_has_substitutions) {
606     SubstitutionResolver resolver(ir);
607   }
608 
609   TRACE_VALUE_NUMBERING(tty->print("****** end of global value numbering. "); ValueMap::print_statistics());
610 }
611 
612 void GlobalValueNumbering::substitute(Instruction* instr) {
613   assert(!instr->has_subst(), "substitution already set");
614   Value subst = current_map()->find_insert(instr);
615   if (subst != instr) {
616     assert(instr->as_LoadIndexed() == nullptr || !instr->as_LoadIndexed()->should_profile(), "should not be optimized out");
617     assert(instr->as_StoreIndexed() == nullptr, "should not be optimized out");
618     assert(!subst->has_subst(), "can't have a substitution");
619 
620     TRACE_VALUE_NUMBERING(tty->print_cr("substitution for %c%d set to %c%d", instr->type()->tchar(), instr->id(), subst->type()->tchar(), subst->id()));
621     instr->set_subst(subst);
622     _has_substitutions = true;
623   }
624   set_processed(instr);
625 }
< prev index next >