< prev index next >

src/hotspot/share/c1/c1_ValueMap.cpp

Print this page

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


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

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