summaryrefslogtreecommitdiffstats
path: root/compiler/dex/local_value_numbering_test.cc
diff options
context:
space:
mode:
authorVladimir Marko <vmarko@google.com>2015-02-17 22:25:06 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-02-17 22:25:06 +0000
commitafba696823ec7c019de72f17cd198e91edd3bf4f (patch)
tree4f9ccb44e2d7ae83e685ea139e1c5124b2280622 /compiler/dex/local_value_numbering_test.cc
parent17609db47537ea6da03db1be530ad13e67cf24db (diff)
parent7a01dc2107d4255b445c32867d15d45fcebb3acd (diff)
downloadart-afba696823ec7c019de72f17cd198e91edd3bf4f.tar.gz
art-afba696823ec7c019de72f17cd198e91edd3bf4f.tar.bz2
art-afba696823ec7c019de72f17cd198e91edd3bf4f.zip
Merge "Dead code elimination based on GVN results."
Diffstat (limited to 'compiler/dex/local_value_numbering_test.cc')
-rw-r--r--compiler/dex/local_value_numbering_test.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/compiler/dex/local_value_numbering_test.cc b/compiler/dex/local_value_numbering_test.cc
index a5cbb5f10d..4490f0657b 100644
--- a/compiler/dex/local_value_numbering_test.cc
+++ b/compiler/dex/local_value_numbering_test.cc
@@ -185,9 +185,9 @@ class LocalValueNumberingTest : public testing::Test {
}
void PerformLVN() {
- cu_.mir_graph->temp_.gvn.ifield_ids_ = GlobalValueNumbering::PrepareGvnFieldIds(
+ cu_.mir_graph->temp_.gvn.ifield_ids = GlobalValueNumbering::PrepareGvnFieldIds(
allocator_.get(), cu_.mir_graph->ifield_lowering_infos_);
- cu_.mir_graph->temp_.gvn.sfield_ids_ = GlobalValueNumbering::PrepareGvnFieldIds(
+ cu_.mir_graph->temp_.gvn.sfield_ids = GlobalValueNumbering::PrepareGvnFieldIds(
allocator_.get(), cu_.mir_graph->sfield_lowering_infos_);
gvn_.reset(new (allocator_.get()) GlobalValueNumbering(&cu_, allocator_.get(),
GlobalValueNumbering::kModeLvn));
@@ -211,8 +211,14 @@ class LocalValueNumberingTest : public testing::Test {
value_names_() {
cu_.mir_graph.reset(new MIRGraph(&cu_, &cu_.arena));
allocator_.reset(ScopedArenaAllocator::Create(&cu_.arena_stack));
+ // By default, the zero-initialized reg_location_[.] with ref == false tells LVN that
+ // 0 constants are integral, not references. Nothing else is used by LVN/GVN.
+ cu_.mir_graph->reg_location_ = static_cast<RegLocation*>(cu_.arena.Alloc(
+ kMaxSsaRegs * sizeof(cu_.mir_graph->reg_location_[0]), kArenaAllocRegAlloc));
}
+ static constexpr size_t kMaxSsaRegs = 16384u;
+
ArenaPool pool_;
CompilationUnit cu_;
size_t mir_count_;