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

Unified Diff: lib/compiler/implementation/ssa/codegen_helpers.dart

Issue 10119006: Remove restriction when computing instructions that can be generate at use site. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 8 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: lib/compiler/implementation/ssa/codegen_helpers.dart
===================================================================
--- lib/compiler/implementation/ssa/codegen_helpers.dart (revision 6682)
+++ lib/compiler/implementation/ssa/codegen_helpers.dart (working copy)
@@ -92,7 +92,7 @@
// Pop instructions from expectedInputs until instruction is found.
// Return true if it is found, or false if not.
- bool findInInputs(HInstruction instruction) {
+ bool findInInputsAndPopNonMatching(HInstruction instruction) {
while (!expectedInputs.isEmpty()) {
HInstruction nextInput = expectedInputs.removeLast();
assert(!generateAtUseSite.contains(nextInput));
@@ -134,20 +134,14 @@
generateAtUseSite.add(instruction);
continue;
}
- bool foundInInputs = false;
// See if the current instruction is the next non-trivial
- // expected input. If not, drop the expectedInputs and
- // start over.
- if (findInInputs(instruction)) {
- foundInInputs = true;
+ // expected input.
+ if (findInInputsAndPopNonMatching(instruction)) {
tryGenerateAtUseSite(instruction);
} else {
assert(expectedInputs.isEmpty());
}
- if (foundInInputs || usedOnlyByPhis(instruction)) {
- // Try merging all non-trivial inputs.
- instruction.accept(this);
- }
+ instruction.accept(this);
}
if (block.predecessors.length === 1
« 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