summaryrefslogtreecommitdiff
path: root/compiler/optimizing/gvn.cc
diff options
context:
space:
mode:
author David Brazdil <dbrazdil@google.com> 2015-02-23 18:02:02 +0000
committer David Brazdil <dbrazdil@google.com> 2015-02-23 18:02:02 +0000
commit433be7f82e4c3433da718a739f9e738410727ca3 (patch)
treea48823f06721cefbc0ffc751acff3887eb625a55 /compiler/optimizing/gvn.cc
parent304e47467579c909a6312ef3cca5cdad1433de9c (diff)
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
Diffstat (limited to 'compiler/optimizing/gvn.cc')
-rw-r--r--compiler/optimizing/gvn.cc2
1 files changed, 1 insertions, 1 deletions
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.