diff options
author | Vladimir Marko <vmarko@google.com> | 2015-01-02 17:00:44 +0000 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2015-02-17 21:06:27 +0000 |
commit | 7a01dc2107d4255b445c32867d15d45fcebb3acd (patch) | |
tree | 5f25d4a2889e6fbcb5119484f2b0b6a4253f9b00 /compiler/dex/local_value_numbering_test.cc | |
parent | bce889940f10319bf67bdc5630c84dd7f6e5c246 (diff) | |
download | art-7a01dc2107d4255b445c32867d15d45fcebb3acd.tar.gz art-7a01dc2107d4255b445c32867d15d45fcebb3acd.tar.bz2 art-7a01dc2107d4255b445c32867d15d45fcebb3acd.zip |
Dead code elimination based on GVN results.
Change-Id: I5b77411a8f088f0b561da14b123cf6b0501c9db5
Diffstat (limited to 'compiler/dex/local_value_numbering_test.cc')
-rw-r--r-- | compiler/dex/local_value_numbering_test.cc | 10 |
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 9f18a3e622..ec1c39e0f9 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_; |