summaryrefslogtreecommitdiffstats
path: root/compiler/dex/global_value_numbering.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2014-10-22 17:15:53 +0100
committerVladimir Marko <vmarko@google.com>2014-10-23 17:17:09 +0100
commita4426cff8a81e6af05aa8cc44c162110ccf2d397 (patch)
tree66545e7d173808b5f0182c35b58eae78484f7341 /compiler/dex/global_value_numbering.cc
parentb08f4dcf90215ed49e0b796ab3e609bd605be8ba (diff)
downloadart-a4426cff8a81e6af05aa8cc44c162110ccf2d397.zip
art-a4426cff8a81e6af05aa8cc44c162110ccf2d397.tar.gz
art-a4426cff8a81e6af05aa8cc44c162110ccf2d397.tar.bz2
Quick: Fix wide Phi detection in GVN, clean up INVOKEs.
The detection of a wide Phi has been incorrectly looking at the current LVN's wide sreg value map but we only intersect live values and thus very often lose the information. This results in failure to identify identical values, i.e. potential missed optimizations. It also caused the bloating of the global value map with values we would not use. Rewrite the wide Phi detection to use the first merged LVN's notion of wide sreg. For this to work we also need to use the method's shorty to mark wide arguments. Also clean up INVOKEs' processing to avoid another source of bloating the global value map. Bug: 16398693 Change-Id: I76718af7d62a8c6883ef43e4f47058f7eaf479e1
Diffstat (limited to 'compiler/dex/global_value_numbering.cc')
-rw-r--r--compiler/dex/global_value_numbering.cc13
1 files changed, 1 insertions, 12 deletions
diff --git a/compiler/dex/global_value_numbering.cc b/compiler/dex/global_value_numbering.cc
index f0f7a70..d311bc7 100644
--- a/compiler/dex/global_value_numbering.cc
+++ b/compiler/dex/global_value_numbering.cc
@@ -70,12 +70,7 @@ LocalValueNumbering* GlobalValueNumbering::PrepareBasicBlock(BasicBlock* bb,
DCHECK(work_lvn_.get() == nullptr);
work_lvn_.reset(new (allocator) LocalValueNumbering(this, bb->id, allocator));
if (bb->block_type == kEntryBlock) {
- if ((cu_->access_flags & kAccStatic) == 0) {
- // If non-static method, mark "this" as non-null
- int this_reg = cu_->mir_graph->GetFirstInVR();
- uint16_t value_name = work_lvn_->GetSRegValueName(this_reg);
- work_lvn_->SetValueNameNullChecked(value_name);
- }
+ work_lvn_->PrepareEntryBlock();
DCHECK(bb->first_mir_insn == nullptr); // modifications_allowed_ is irrelevant.
} else {
// To avoid repeated allocation on the ArenaStack, reuse a single vector kept as a member.
@@ -127,12 +122,6 @@ LocalValueNumbering* GlobalValueNumbering::PrepareBasicBlock(BasicBlock* bb,
CHECK(!merge_lvns_.empty());
if (merge_lvns_.size() == 1u) {
work_lvn_->MergeOne(*merge_lvns_[0], merge_type);
- BasicBlock* pred_bb = mir_graph_->GetBasicBlock(merge_lvns_[0]->Id());
- if (HasNullCheckLastInsn(pred_bb, bb->id)) {
- int s_reg = pred_bb->last_mir_insn->ssa_rep->uses[0];
- uint16_t value_name = merge_lvns_[0]->GetSRegValueName(s_reg);
- work_lvn_->SetValueNameNullChecked(value_name);
- }
} else {
work_lvn_->Merge(merge_type);
}