summaryrefslogtreecommitdiff
path: root/compiler/dex/mir_optimization_test.cc
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-07-23 16:53:02 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-07-23 16:53:02 +0000
commitf7efc9ef90c38212f8c4fbece99080f784a53181 (patch)
tree69543b9e11746fe1e390651a972c1045864ad549 /compiler/dex/mir_optimization_test.cc
parentbea4eb4b29aa1030aa1919dfedaa95aea2599b7a (diff)
parentd29e8487ff1774b6eb5f0e18d854415c1ee8f6b0 (diff)
Merge "ART: Fix Quick/Optimizing suspend check assumption mismatch."
Diffstat (limited to 'compiler/dex/mir_optimization_test.cc')
-rw-r--r--compiler/dex/mir_optimization_test.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/dex/mir_optimization_test.cc b/compiler/dex/mir_optimization_test.cc
index 10a4337cf5..47123ba28c 100644
--- a/compiler/dex/mir_optimization_test.cc
+++ b/compiler/dex/mir_optimization_test.cc
@@ -467,8 +467,17 @@ class SuspendCheckEliminationTest : public MirOptimizationTest {
cu_.mir_graph->ComputeDominators();
cu_.mir_graph->ComputeTopologicalSortOrder();
cu_.mir_graph->SSATransformationEnd();
+
bool gate_result = cu_.mir_graph->EliminateSuspendChecksGate();
- ASSERT_TRUE(gate_result);
+ ASSERT_NE(gate_result, kLeafOptimization);
+ if (kLeafOptimization) {
+ // Even with kLeafOptimization on and Gate() refusing to allow SCE, we want
+ // to run the SCE test to avoid bitrot, so we need to initialize explicitly.
+ cu_.mir_graph->suspend_checks_in_loops_ =
+ cu_.mir_graph->arena_->AllocArray<uint32_t>(cu_.mir_graph->GetNumBlocks(),
+ kArenaAllocMisc);
+ }
+
TopologicalSortIterator iterator(cu_.mir_graph.get());
bool change = false;
for (BasicBlock* bb = iterator.Next(change); bb != nullptr; bb = iterator.Next(change)) {