From a4426cff8a81e6af05aa8cc44c162110ccf2d397 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 22 Oct 2014 17:15:53 +0100 Subject: 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 --- compiler/dex/global_value_numbering.cc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'compiler/dex/global_value_numbering.cc') diff --git a/compiler/dex/global_value_numbering.cc b/compiler/dex/global_value_numbering.cc index f0f7a7051b..d311bc76ff 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); } -- cgit v1.2.3-59-g8ed1b