From 433be7f82e4c3433da718a739f9e738410727ca3 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Mon, 23 Feb 2015 18:02:02 +0000 Subject: Optimizing: Remove redundant hash set copy in GVN During the GVN analysis, a basic block inherits the set of movable instructions from its dominator. If the block is the only successor of the dominating block, there is no need for cloning of the parent set (a very expensive operation). Change-Id: I59e033b9e9e093984dc8e903e3a7be1cb3645cc2 --- compiler/optimizing/gvn.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/optimizing') diff --git a/compiler/optimizing/gvn.cc b/compiler/optimizing/gvn.cc index 89bba2d9f6..cb448c883f 100644 --- a/compiler/optimizing/gvn.cc +++ b/compiler/optimizing/gvn.cc @@ -270,7 +270,7 @@ void GlobalValueNumberer::VisitBasicBlock(HBasicBlock* block) { set = new (allocator_) ValueSet(allocator_); } else { HBasicBlock* dominator = block->GetDominator(); - set = sets_.Get(dominator->GetBlockId())->Copy(); + set = sets_.Get(dominator->GetBlockId()); if (dominator->GetSuccessors().Size() != 1 || dominator->GetSuccessors().Get(0) != block) { // We have to copy if the dominator has other successors, or `block` is not a successor // of the dominator. -- cgit v1.2.3-59-g8ed1b