Lines Matching refs:lvn
57 static uint16_t StartMemoryVersion(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
61 lvn->global_memory_version_, lvn->unresolved_ifield_version_[type]);
75 static uint16_t LookupMergeValue(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
77 // If the base/field_id is non-aliasing in lvn, use the non-aliasing value.
79 if (lvn->IsNonAliasingIField(base, field_id, type)) {
81 auto lb = lvn->non_aliasing_ifield_value_map_.find(loc);
82 return (lb != lvn->non_aliasing_ifield_value_map_.end())
87 gvn, lvn, &lvn->aliasing_ifield_value_map_, field_id, base);
90 static bool HasNewBaseVersion(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
93 return lvn->unresolved_ifield_version_[type] == lvn->merge_new_memory_version_ ||
94 lvn->global_memory_version_ == lvn->merge_new_memory_version_;
110 static uint16_t StartMemoryVersion(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
126 static uint16_t LookupMergeValue(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
129 gvn, lvn, &lvn->non_aliasing_array_value_map_, array, index);
132 static bool HasNewBaseVersion(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
150 static uint16_t StartMemoryVersion(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
152 return gvn->LookupValue(kAliasingArrayStartVersionOp, type, lvn->global_memory_version_,
167 static uint16_t LookupMergeValue(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
169 // If the location is non-aliasing in lvn, use the non-aliasing value.
171 if (lvn->IsNonAliasingArray(array, type)) {
173 return NonAliasingArrayVersions::LookupMergeValue(gvn, lvn, array, index);
176 gvn, lvn, &lvn->aliasing_array_value_map_, type, location);
179 static bool HasNewBaseVersion(GlobalValueNumbering* gvn, const LocalValueNumbering* lvn,
181 return lvn->global_memory_version_ == lvn->merge_new_memory_version_;
226 const LocalValueNumbering* lvn,
230 // const_cast<LocalValueNumbering*>(lvn)->HandleAliasingValueGet(map. key, location)
235 uint16_t start_version = Versions::StartMemoryVersion(gvn, lvn, key);
420 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
421 if (lvn->global_memory_version_ != cmp->global_memory_version_) {
433 // Initialize with a copy of memory versions from the comparison LVN.
437 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
438 if (lvn == cmp) {
442 if (lvn->unresolved_ifield_version_[i] != cmp->unresolved_ifield_version_[i]) {
445 if (lvn->unresolved_sfield_version_[i] != cmp->unresolved_sfield_version_[i]) {
454 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
455 const BasicBlock* bb = gvn_->GetBasicBlock(lvn->Id());
469 uint16_t value_name = lvn->GetOperandValue(mir->ssa_rep->uses[i]);
481 // Find the LVN with the least entries in the set.
483 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
484 if ((lvn->*set_ptr).size() < (least_entries_lvn->*set_ptr).size()) {
485 least_entries_lvn = lvn;
492 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
493 if (lvn != least_entries_lvn && (lvn->*set_ptr).count(key) == 0u) {
520 // Find the LVN with the least entries in the set.
522 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
523 if ((lvn->*map_ptr).size() < (least_entries_lvn->*map_ptr).size()) {
524 least_entries_lvn = lvn;
534 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
535 if (lvn != least_entries_lvn) {
536 auto it = (lvn->*map_ptr).find(entry.first);
537 if (it == (lvn->*map_ptr).end() || !(it->second == entry.second)) {
572 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
574 for (const auto& entry : lvn->*set_ptr) {
622 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
623 if (lvn->non_aliasing_refs_.count(entry) == 0u &&
624 lvn->escaped_refs_.count(entry) == 0u) {
675 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
676 // Get the value name as in HandleSGet() but don't modify *lvn.
677 auto it = lvn->sfield_value_map_.find(field_id);
678 if (it != lvn->sfield_value_map_.end()) {
683 lvn->unresolved_sfield_version_[type],
684 lvn->global_memory_version_);
713 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
714 // Get the value name as in HandleIGet() but don't modify *lvn.
715 auto it = lvn->non_aliasing_ifield_value_map_.find(field_loc);
716 if (it != lvn->non_aliasing_ifield_value_map_.end()) {
756 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
757 auto it = (lvn->*map_ptr).find(key);
758 if (it != (lvn->*map_ptr).end()) {
768 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
769 auto it = (lvn->*map_ptr).find(key);
770 if (it == (lvn->*map_ptr).end()) {
797 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
798 auto it = (lvn->*map_ptr).find(key);
799 if (it == (lvn->*map_ptr).end() || it->second.load_value_map.empty()) {
814 // Calculate the locations that have been either read from or written to in each incoming LVN.
816 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
817 auto it = (lvn->*map_ptr).find(key);
818 if (it == (lvn->*map_ptr).end()) {
824 // Copy the first LVN's locations. Values will be overwritten later.
839 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
840 value_name = Versions::LookupMergeValue(gvn_, lvn, key, location);
851 // NOTE: In addition to the key and id_ which don't change on an LVN recalculation
1021 // Running LVN without a full GVN?
1039 // Iterate over *merge_lvns_ and skip incoming sregs for BBs without associated LVN.
1045 for (const LocalValueNumbering* lvn : gvn_->merge_lvns_) {
1047 while (incoming[pos] != lvn->Id()) {
1053 value_name = wide ? lvn->GetOperandValueWide(s_reg) : lvn->GetOperandValue(s_reg);