< prev index next >

src/hotspot/share/c1/c1_ValueMap.cpp

Print this page

570       instr->visit(this);
571       // perform actual value numbering
572       substitute(instr);
573     }
574 
575     // remember value map for successors
576     set_value_map_of(block, current_map());
577   }
578 
579   if (_has_substitutions) {
580     SubstitutionResolver resolver(ir);
581   }
582 
583   TRACE_VALUE_NUMBERING(tty->print("****** end of global value numbering. "); ValueMap::print_statistics());
584 }
585 
586 void GlobalValueNumbering::substitute(Instruction* instr) {
587   assert(!instr->has_subst(), "substitution already set");
588   Value subst = current_map()->find_insert(instr);
589   if (subst != instr) {


590     assert(!subst->has_subst(), "can't have a substitution");
591 
592     TRACE_VALUE_NUMBERING(tty->print_cr("substitution for %c%d set to %c%d", instr->type()->tchar(), instr->id(), subst->type()->tchar(), subst->id()));
593     instr->set_subst(subst);
594     _has_substitutions = true;
595   }
596   set_processed(instr);
597 }

570       instr->visit(this);
571       // perform actual value numbering
572       substitute(instr);
573     }
574 
575     // remember value map for successors
576     set_value_map_of(block, current_map());
577   }
578 
579   if (_has_substitutions) {
580     SubstitutionResolver resolver(ir);
581   }
582 
583   TRACE_VALUE_NUMBERING(tty->print("****** end of global value numbering. "); ValueMap::print_statistics());
584 }
585 
586 void GlobalValueNumbering::substitute(Instruction* instr) {
587   assert(!instr->has_subst(), "substitution already set");
588   Value subst = current_map()->find_insert(instr);
589   if (subst != instr) {
590     assert(instr->as_LoadIndexed() == NULL || !instr->as_LoadIndexed()->should_profile(), "should not be optimized out");
591     assert(instr->as_StoreIndexed() == NULL, "should not be optimized out");
592     assert(!subst->has_subst(), "can't have a substitution");
593 
594     TRACE_VALUE_NUMBERING(tty->print_cr("substitution for %c%d set to %c%d", instr->type()->tchar(), instr->id(), subst->type()->tchar(), subst->id()));
595     instr->set_subst(subst);
596     _has_substitutions = true;
597   }
598   set_processed(instr);
599 }
< prev index next >