Lines Matching refs:instr

28   void Add(HInstruction* instr, Zone* zone) {
29 present_depends_on_.Add(side_effects_tracker_->ComputeDependsOn(instr));
30 Insert(instr, zone);
33 HInstruction* Lookup(HInstruction* instr) const;
44 HInstruction* instr;
56 void Insert(HInstruction* instr, Zone* zone);
81 void Store(SideEffects side_effects, HInstruction* instr);
154 HInstruction* instr = array_[i].instr;
155 if (instr != NULL) {
161 HInstruction* instr = lists_[current].instr;
162 SideEffects depends_on = side_effects_tracker_->ComputeDependsOn(instr);
178 instr = array_[i].instr;
179 SideEffects depends_on = side_effects_tracker_->ComputeDependsOn(instr);
184 array_[i].instr = NULL;
186 array_[i].instr = lists_[head].instr;
199 HInstruction* HInstructionMap::Lookup(HInstruction* instr) const {
200 uint32_t hash = static_cast<uint32_t>(instr->Hashcode());
202 if (array_[pos].instr != NULL) {
203 if (array_[pos].instr->Equals(instr)) return array_[pos].instr;
206 if (lists_[next].instr->Equals(instr)) return lists_[next].instr;
240 if (old_array[i].instr != NULL) {
243 Insert(lists_[current].instr, zone);
250 Insert(old_array[i].instr, zone);
282 void HInstructionMap::Insert(HInstruction* instr, Zone* zone) {
283 DCHECK(instr != NULL);
288 uint32_t pos = Bound(static_cast<uint32_t>(instr->Hashcode()));
289 if (array_[pos].instr == NULL) {
290 array_[pos].instr = instr;
299 lists_[new_element_pos].instr = instr;
301 DCHECK(array_[pos].next == kNil || lists_[array_[pos].next].instr != NULL);
335 void HSideEffectMap::Store(SideEffects side_effects, HInstruction* instr) {
339 data_[i] = instr;
345 SideEffects SideEffectsTracker::ComputeChanges(HInstruction* instr) {
347 SideEffects result(instr->ChangesFlags());
349 if (instr->IsStoreGlobalCell() &&
350 ComputeGlobalVar(HStoreGlobalCell::cast(instr)->cell(), &index)) {
360 if (instr->IsStoreNamedField() &&
361 ComputeInobjectField(HStoreNamedField::cast(instr)->access(), &index)) {
374 SideEffects SideEffectsTracker::ComputeDependsOn(HInstruction* instr) {
376 SideEffects result(instr->DependsOnFlags());
378 if (instr->IsLoadGlobalCell() &&
379 ComputeGlobalVar(HLoadGlobalCell::cast(instr)->cell(), &index)) {
389 if (instr->IsLoadNamedField() &&
390 ComputeInobjectField(HLoadNamedField::cast(instr)->access(), &index)) {
535 HInstruction* instr = it.Current();
536 side_effects.Add(side_effects_tracker_.ComputeChanges(instr));
591 HInstruction* instr = block->first();
592 while (instr != NULL) {
593 HInstruction* next = instr->next();
594 if (instr->CheckFlag(HValue::kUseGVN)) {
595 SideEffects changes = side_effects_tracker_.ComputeChanges(instr);
596 SideEffects depends_on = side_effects_tracker_.ComputeDependsOn(instr);
599 os << "Checking instruction i" << instr->id() << " ("
600 << instr->Mnemonic() << ") changes " << Print(changes)
611 for (int i = 0; i < instr->OperandCount(); ++i) {
612 if (instr->OperandAt(i)->IsDefinedAfter(pre_header)) {
617 if (inputs_loop_invariant && ShouldMove(instr, loop_header)) {
619 instr->id(), pre_header->block_id());
621 instr->Unlink();
622 instr->InsertBefore(pre_header->end());
623 if (instr->HasSideEffects()) removed_side_effects_ = true;
627 instr = next;
637 bool HGlobalValueNumberingPhase::ShouldMove(HInstruction* instr,
641 return AllowCodeMotion() && !instr->block()->IsDeoptimizing() &&
642 instr->block()->IsReachable();
809 HInstruction* instr = it.Current();
810 if (instr->CheckFlag(HValue::kTrackSideEffectDominators)) {
814 if (instr->DependsOnFlags().Contains(flag) && other != NULL) {
817 instr->id(),
818 instr->Mnemonic(),
821 if (instr->HandleSideEffectDominator(flag, other)) {
828 if (!instr->IsLinked()) continue;
830 SideEffects changes = side_effects_tracker_.ComputeChanges(instr);
835 dominators->Store(changes, instr);
838 os << "Instruction i" << instr->id() << " changes " << Print(changes)
842 if (instr->CheckFlag(HValue::kUseGVN) &&
843 !instr->CheckFlag(HValue::kCantBeReplaced)) {
844 DCHECK(!instr->HasObservableSideEffects());
845 HInstruction* other = map->Lookup(instr);
847 DCHECK(instr->Equals(other) && other->Equals(instr));
849 instr->id(),
850 instr->Mnemonic(),
853 if (instr->HasSideEffects()) removed_side_effects_ = true;
854 instr->DeleteAndReplaceWith(other);
856 map->Add(instr, zone());