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

Side by Side Diff: src/IceCfg.cpp

Issue 1271923002: Subzero: Slight improvement to phi lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/IceCfgNode.cpp » ('j') | src/IceCfgNode.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===// 1 //===- subzero/src/IceCfg.cpp - Control flow graph implementation ---------===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 // The following code does an in-place update of liveness and live ranges as 266 // The following code does an in-place update of liveness and live ranges as
267 // a result of adding the new phi edge split nodes. 267 // a result of adding the new phi edge split nodes.
268 getLiveness()->initPhiEdgeSplits(Nodes.begin() + NumNodes, 268 getLiveness()->initPhiEdgeSplits(Nodes.begin() + NumNodes,
269 Variables.begin() + NumVars); 269 Variables.begin() + NumVars);
270 TimerMarker TTT(TimerStack::TT_liveness, this); 270 TimerMarker TTT(TimerStack::TT_liveness, this);
271 // Iterate over the newly added nodes to add their liveness info. 271 // Iterate over the newly added nodes to add their liveness info.
272 for (auto I = Nodes.begin() + NumNodes, E = Nodes.end(); I != E; ++I) { 272 for (auto I = Nodes.begin() + NumNodes, E = Nodes.end(); I != E; ++I) {
273 InstNumberT FirstInstNum = getNextInstNumber(); 273 InstNumberT FirstInstNum = getNextInstNumber();
274 (*I)->renumberInstructions(); 274 (*I)->renumberInstructions();
275 InstNumberT LastInstNum = getNextInstNumber() - 1; 275 InstNumberT LastInstNum = getNextInstNumber() - 1;
276 // TODO(stichnot): May be able to speed up liveness and live range
277 // calculation by having it consider only pre-colored or infinite-weight
278 // variables. Could also simplify LinearScan::initForInfOnly() that way.
279 (*I)->liveness(getLiveness()); 276 (*I)->liveness(getLiveness());
280 (*I)->livenessAddIntervals(getLiveness(), FirstInstNum, LastInstNum); 277 (*I)->livenessAddIntervals(getLiveness(), FirstInstNum, LastInstNum);
281 } 278 }
282 } else { 279 } else {
283 // The following code does a brute-force recalculation of live ranges as a 280 // The following code does a brute-force recalculation of live ranges as a
284 // result of adding the new phi edge split nodes. The liveness calculation 281 // result of adding the new phi edge split nodes. The liveness calculation
285 // is particularly expensive because the new nodes are not yet in a proper 282 // is particularly expensive because the new nodes are not yet in a proper
286 // topological order and so convergence is slower. 283 // topological order and so convergence is slower.
287 // 284 //
288 // This code is kept here for reference and can be temporarily enabled in 285 // This code is kept here for reference and can be temporarily enabled in
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
760 } 757 }
761 } 758 }
762 // Print each basic block 759 // Print each basic block
763 for (CfgNode *Node : Nodes) 760 for (CfgNode *Node : Nodes)
764 Node->dump(this); 761 Node->dump(this);
765 if (isVerbose(IceV_Instructions)) 762 if (isVerbose(IceV_Instructions))
766 Str << "}\n"; 763 Str << "}\n";
767 } 764 }
768 765
769 } // end of namespace Ice 766 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | src/IceCfgNode.cpp » ('j') | src/IceCfgNode.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698