diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-25 16:33:42 +0100 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-09-25 16:33:42 +0100 |
commit | 9ebc72c99e6b703bda611d7c918c9cf3dfb43e55 (patch) | |
tree | 6696e6e51dbe2606d2b2e0c0c60dfec06af97e60 /compiler/optimizing | |
parent | a72cb229d555a8ca86dca748733ea3791eaeec14 (diff) | |
download | art-9ebc72c99e6b703bda611d7c918c9cf3dfb43e55.zip art-9ebc72c99e6b703bda611d7c918c9cf3dfb43e55.tar.gz art-9ebc72c99e6b703bda611d7c918c9cf3dfb43e55.tar.bz2 |
Make suspend checks note have side effects.
Also adjust gtests.
Change-Id: I5e1a3e53115812b45ec7f4b6f50ba468fa7ac6b1
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/dead_code_elimination.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/live_ranges_test.cc | 1 | ||||
-rw-r--r-- | compiler/optimizing/nodes.h | 2 | ||||
-rw-r--r-- | compiler/optimizing/ssa_test.cc | 2 |
4 files changed, 4 insertions, 3 deletions
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc index 2f881d1..fe2adc7 100644 --- a/compiler/optimizing/dead_code_elimination.cc +++ b/compiler/optimizing/dead_code_elimination.cc @@ -35,7 +35,7 @@ void DeadCodeElimination::Run() { for (i.Advance(); !i.Done(); i.Advance()) { HInstruction* inst = i.Current(); DCHECK(!inst->IsControlFlow()); - if (!inst->HasSideEffects() && !inst->HasUses()) { + if (!inst->HasSideEffects() && !inst->HasUses() && !inst->IsSuspendCheck()) { block->RemoveInstruction(inst); } } diff --git a/compiler/optimizing/live_ranges_test.cc b/compiler/optimizing/live_ranges_test.cc index a81a30e..6184897 100644 --- a/compiler/optimizing/live_ranges_test.cc +++ b/compiler/optimizing/live_ranges_test.cc @@ -233,6 +233,7 @@ TEST(LiveRangesTest, Loop) { ArenaPool pool; ArenaAllocator allocator(&pool); HGraph* graph = BuildGraph(data, &allocator); + RemoveSuspendChecks(graph); x86::CodeGeneratorX86 codegen(graph); SsaLivenessAnalysis liveness(*graph, &codegen); liveness.Analyze(); diff --git a/compiler/optimizing/nodes.h b/compiler/optimizing/nodes.h index faed1ef..944e803 100644 --- a/compiler/optimizing/nodes.h +++ b/compiler/optimizing/nodes.h @@ -1796,7 +1796,7 @@ class HTemporary : public HTemplateInstruction<0> { class HSuspendCheck : public HTemplateInstruction<0> { public: explicit HSuspendCheck(uint32_t dex_pc) - : HTemplateInstruction(SideEffects::ChangesSomething()), dex_pc_(dex_pc) {} + : HTemplateInstruction(SideEffects::None()), dex_pc_(dex_pc) {} virtual bool NeedsEnvironment() const { return true; diff --git a/compiler/optimizing/ssa_test.cc b/compiler/optimizing/ssa_test.cc index ad3b205..fffe5c2 100644 --- a/compiler/optimizing/ssa_test.cc +++ b/compiler/optimizing/ssa_test.cc @@ -83,10 +83,10 @@ static void TestCode(const uint16_t* data, const char* expected) { HGraph* graph = builder.BuildGraph(*item); ASSERT_NE(graph, nullptr); + graph->BuildDominatorTree(); // Suspend checks implementation may change in the future, and this test relies // on how instructions are ordered. RemoveSuspendChecks(graph); - graph->BuildDominatorTree(); graph->TransformToSSA(); ReNumberInstructions(graph); |