summaryrefslogtreecommitdiff
path: root/compiler/optimizing/dead_code_elimination.cc
diff options
context:
space:
mode:
author Alexandre Rames <alexandre.rames@linaro.org> 2015-08-12 13:43:29 +0100
committer Alexandre Rames <alexandre.rames@linaro.org> 2015-08-12 13:43:29 +0100
commit78e3ef6bc5f8aa149f2f8bf0c78ce854c2f910fa (patch)
treeb8aa83bef462e20e2e7e09650e6c15d3a8d97fa6 /compiler/optimizing/dead_code_elimination.cc
parent6a5037eb3340e4c981fd7de3ff45167ee5b7fc82 (diff)
Add a GVN dependency 'GC' for garbage collection.
This will be used by incoming architecture specific optimizations. The dependencies must be conservative. When an HInstruction is created we may not be sure whether it can trigger GC. In that case the 'ChangesGC' dependency must be set. We control at code-generation time that HInstructions that can call have the 'ChangesGC' dependency set. Change-Id: Iea6a7f430009f37a9599b0a0039207049906e45d
Diffstat (limited to 'compiler/optimizing/dead_code_elimination.cc')
-rw-r--r--compiler/optimizing/dead_code_elimination.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/optimizing/dead_code_elimination.cc b/compiler/optimizing/dead_code_elimination.cc
index 6269d1628e..5de629d605 100644
--- a/compiler/optimizing/dead_code_elimination.cc
+++ b/compiler/optimizing/dead_code_elimination.cc
@@ -128,7 +128,7 @@ void HDeadCodeElimination::RemoveDeadInstructions() {
for (i.Advance(); !i.Done(); i.Advance()) {
HInstruction* inst = i.Current();
DCHECK(!inst->IsControlFlow());
- if (!inst->DoesAnyWrite()
+ if (!inst->HasSideEffects()
&& !inst->CanThrow()
&& !inst->IsSuspendCheck()
// If we added an explicit barrier then we should keep it.