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

Unified Diff: frog/leg/ssa/phi_eliminator.dart

Issue 9035008: Do not generate at use site loop phis. It requires live analysis that we currently don't implement. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 9 years 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 | frog/tests/leg/src/SsaPhiEliminatorTest.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/phi_eliminator.dart
===================================================================
--- frog/leg/ssa/phi_eliminator.dart (revision 2800)
+++ frog/leg/ssa/phi_eliminator.dart (working copy)
@@ -58,16 +58,15 @@
visitBasicBlock(HBasicBlock block) {
currentBlock = block;
- List<HLoad> loads = <HLoad>[];
HPhi phi = block.phis.first;
while (phi != null) {
HPhi next = phi.next;
- visitPhi(phi, loads);
+ visitPhi(phi);
phi = next;
}
}
- visitPhi(HPhi phi, List<HLoad> loads) {
+ visitPhi(HPhi phi) {
assert(phi !== null);
if (phi.isLogicalOperator()) return;
HLocal local;
@@ -86,7 +85,6 @@
List<HBasicBlock> predecessors = currentBlock.predecessors;
- List<HStore> stores = <HStore>[];
for (int i = 0, len = predecessors.length; i < len; i++) {
HInstruction value = phi.inputs[i];
@@ -111,7 +109,6 @@
local.declaredBy = store;
}
}
- stores.add(store);
}
}
@@ -119,29 +116,10 @@
// than the local because we may end up sharing a single local
// between different phis of different types.
HLoad load = new HLoad(local, phi.type);
- loads.add(load);
-
currentBlock.addAtEntry(load);
currentBlock.rewrite(phi, load);
currentBlock.removePhi(phi);
- if (!currentBlock.isLoopHeader() || !hasLoopPhiAsInput(stores, loads)) {
- load.setGenerateAtUseSite();
- }
+ if (!currentBlock.isLoopHeader()) load.setGenerateAtUseSite();
}
-
- bool hasLoopPhiAsInput(List<HStore> stores, List<HLoad> loads) {
- // [stores] contains the stores of a specific phi.
- // [loads] contains the phis that were converted to loads.
- assert(currentBlock.isLoopHeader());
- for (HStore store in stores) {
- HInstruction value = store.value;
- if (value is HPhi && value.block == currentBlock) {
- return true;
- } else if (value is HLoad && loads.indexOf(value) != -1) {
- return true;
- }
- }
- return false;
- }
}
« no previous file with comments | « no previous file | frog/tests/leg/src/SsaPhiEliminatorTest.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698