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

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

Issue 11361035: Fix a LICM bug where we were loop hoisting an isntruction, even though that isntruction's inputs we… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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 | tests/language/language_dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/ssa/optimize.dart
===================================================================
--- lib/compiler/implementation/ssa/optimize.dart (revision 14410)
+++ lib/compiler/implementation/ssa/optimize.dart (working copy)
@@ -890,9 +890,13 @@
if (block.isLoopHeader()) {
int changesFlags = loopChangesFlags[block.id];
HLoopInformation info = block.loopInformation;
- HBasicBlock last = info.getLastBackEdge();
- for (int j = block.id; j <= last.id; j++) {
- moveLoopInvariantCodeFromBlock(graph.blocks[j], block, changesFlags);
+ // Iterate over all blocks of this loop. Note that blocks in
+ // inner loops are not visited here, but we know they
+ // were visited before because we are iterating in post-order.
+ // So instructions that are GVN'ed in an inner loop are in their
+ // loop entry, and [info.blocks] contains this loop entry.
+ for (HBasicBlock other in info.blocks) {
+ moveLoopInvariantCodeFromBlock(other, block, changesFlags);
}
}
}
@@ -901,6 +905,7 @@
void moveLoopInvariantCodeFromBlock(HBasicBlock block,
HBasicBlock loopHeader,
int changesFlags) {
+ assert(block.parentLoopHeader == loopHeader);
HBasicBlock preheader = loopHeader.predecessors[0];
int dependsFlags = HInstruction.computeDependsOnFlags(changesFlags);
HInstruction instruction = block.first;
« no previous file with comments | « no previous file | tests/language/language_dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698