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

Unified Diff: src/IceCfgNode.cpp

Issue 802003003: Subzero: Clean up live range construction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 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 | « src/IceCfgNode.h ('k') | src/IceInst.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfgNode.cpp
diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
index 1623731e5470823b03d1b48951ea71300976923e..42731adc92a15406871d9697c1a270faf8c71fd8 100644
--- a/src/IceCfgNode.cpp
+++ b/src/IceCfgNode.cpp
@@ -639,40 +639,16 @@ bool CfgNode::liveness(Liveness *Liveness) {
return Changed;
}
-// Now that basic liveness is complete, remove dead instructions that
-// were tentatively marked as dead, and compute actual live ranges.
-// It is assumed that within a single basic block, a live range begins
-// at most once and ends at most once. This is certainly true for
-// pure SSA form. It is also true once phis are lowered, since each
+// Once basic liveness is complete, compute actual live ranges. It is
+// assumed that within a single basic block, a live range begins at
+// most once and ends at most once. This is certainly true for pure
+// SSA form. It is also true once phis are lowered, since each
// assignment to the phi-based temporary is in a different basic
// block, and there is a single read that ends the live in the basic
// block that contained the actual phi instruction.
-void CfgNode::livenessPostprocess(LivenessMode Mode, Liveness *Liveness) {
- InstNumberT FirstInstNum = Inst::NumberSentinel;
- InstNumberT LastInstNum = Inst::NumberSentinel;
- // Process phis in any order. Process only Dest operands.
- for (auto I = Phis.begin(), E = Phis.end(); I != E; ++I) {
- I->deleteIfDead();
- if (I->isDeleted())
- continue;
- if (FirstInstNum == Inst::NumberSentinel)
- FirstInstNum = I->getNumber();
- assert(I->getNumber() > LastInstNum);
- LastInstNum = I->getNumber();
- }
- // Process instructions
- for (auto I = Insts.begin(), E = Insts.end(); I != E; ++I) {
- I->deleteIfDead();
- if (I->isDeleted())
- continue;
- if (FirstInstNum == Inst::NumberSentinel)
- FirstInstNum = I->getNumber();
- assert(I->getNumber() > LastInstNum);
- LastInstNum = I->getNumber();
- }
- if (Mode != Liveness_Intervals)
- return;
- TimerMarker T1(TimerStack::TT_liveRangeCtor, Func);
+void CfgNode::livenessAddIntervals(Liveness *Liveness, InstNumberT FirstInstNum,
+ InstNumberT LastInstNum) {
+ TimerMarker T1(TimerStack::TT_liveRange, Func);
SizeT NumVars = Liveness->getNumVarsInNode(this);
LivenessBV &LiveIn = Liveness->getLiveIn(this);
« no previous file with comments | « src/IceCfgNode.h ('k') | src/IceInst.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698