diff options
author | 2015-04-25 14:47:31 -0700 | |
---|---|---|
committer | 2015-04-25 15:16:10 -0700 | |
commit | 24d65cce84165c2c3b0e02e09cdb92479ee4e479 (patch) | |
tree | 2ec7af2f9315a283ba665696eaff47c1fcadb6a7 /compiler/dex/mir_optimization.cc | |
parent | 3d58dea2a9d82aed045908fd9ea68c41f3d1f63d (diff) |
ART: Fix missing dependency between GVN and other passes
The GVN may be turned off completely, or skip running when the
method is too complex. Turn off DCE in that case.
The dependent cleanup pass is not an optimization pass, so can't be
turned off that way. Check whether the GVN skipped in the gate function.
A possible follow-up is proper dependencies between passes.
Change-Id: I5b7951ecd6c74ebbfa5b23726a3d2f3ea1a23a47
Diffstat (limited to 'compiler/dex/mir_optimization.cc')
-rw-r--r-- | compiler/dex/mir_optimization.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/dex/mir_optimization.cc b/compiler/dex/mir_optimization.cc index 0d5da32d6d..3482602704 100644 --- a/compiler/dex/mir_optimization.cc +++ b/compiler/dex/mir_optimization.cc @@ -1355,8 +1355,13 @@ void MIRGraph::EliminateClassInitChecksEnd() { temp_scoped_alloc_.reset(); } +static void DisableGVNDependentOptimizations(CompilationUnit* cu) { + cu->disable_opt |= (1u << kGvnDeadCodeElimination); +} + bool MIRGraph::ApplyGlobalValueNumberingGate() { if (GlobalValueNumbering::Skip(cu_)) { + DisableGVNDependentOptimizations(cu_); return false; } @@ -1407,7 +1412,7 @@ void MIRGraph::ApplyGlobalValueNumberingEnd() { cu_->disable_opt |= (1u << kLocalValueNumbering); } else { LOG(WARNING) << "GVN failed for " << PrettyMethod(cu_->method_idx, *cu_->dex_file); - cu_->disable_opt |= (1u << kGvnDeadCodeElimination); + DisableGVNDependentOptimizations(cu_); } } |