Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: pkg/compiler/lib/src/ssa/optimize.dart

Issue 1177603002: Include all allocations in trivial dead-store elimination (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/optimize.dart
diff --git a/pkg/compiler/lib/src/ssa/optimize.dart b/pkg/compiler/lib/src/ssa/optimize.dart
index 953a6f48f96a5881dff9bd33dfd6c001729d8e91..b18572d070f37500f62612fdd80cd67250019a0d 100644
--- a/pkg/compiler/lib/src/ssa/optimize.dart
+++ b/pkg/compiler/lib/src/ssa/optimize.dart
@@ -1142,7 +1142,8 @@ class SsaDeadCodeEliminator extends HGraphVisitor implements OptimizationPhase {
}
return false;
}
- return instruction is HForeignNew
+ return instruction.isAllocation
+ && instruction.isPure()
&& trivialDeadStoreReceivers.putIfAbsent(instruction,
() => instruction.usedBy.every(isDeadUse));
}
@@ -1156,14 +1157,14 @@ class SsaDeadCodeEliminator extends HGraphVisitor implements OptimizationPhase {
if (!instruction.usedBy.isEmpty) return false;
if (isTrivialDeadStore(instruction)) return true;
if (instruction.sideEffects.hasSideEffects()) return false;
- if (instruction.canThrow()
- && instruction.onlyThrowsNSM()
- && hasFollowingThrowingNSM(instruction)) {
+ if (instruction.canThrow() &&
+ instruction.onlyThrowsNSM() &&
+ hasFollowingThrowingNSM(instruction)) {
return true;
}
return !instruction.canThrow()
- && instruction is !HParameterValue
- && instruction is !HLocalSet;
+ && instruction is !HParameterValue
+ && instruction is !HLocalSet;
}
void visitGraph(HGraph graph) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698