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

Unified Diff: src/IceLiveness.cpp

Issue 1273823003: Subzero: Completely remove tracking of stack pointer live range. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix a condition to match previous logic. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceOperand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceLiveness.cpp
diff --git a/src/IceLiveness.cpp b/src/IceLiveness.cpp
index a1de893644c2814059079e3f856a04c6426b8389..35e12b7b20e26de689a1be5929ce3619a4a8b9b0 100644
--- a/src/IceLiveness.cpp
+++ b/src/IceLiveness.cpp
@@ -71,8 +71,12 @@ void Liveness::initInternal(NodeList::const_iterator FirstNode,
if (IsFullInit)
LiveToVarMap.assign(NumGlobals, nullptr);
- // Sort each variable into the appropriate LiveToVarMap. Also set
- // VarToLiveMap.
+ // Initialize the bitmask of which variables to track.
+ RangeMask.resize(NumVars);
+ RangeMask.set(0, NumVars); // Track all variables by default.
+
+ // Sort each variable into the appropriate LiveToVarMap. Set VarToLiveMap.
+ // Set RangeMask correctly for each variable.
TmpNumGlobals = 0;
for (auto I = FirstVar, E = Func->getVariables().end(); I != E; ++I) {
Variable *Var = *I;
@@ -88,9 +92,20 @@ void Liveness::initInternal(NodeList::const_iterator FirstNode,
LiveIndex += NumGlobals;
}
VarToLiveMap[VarIndex] = LiveIndex;
+ if (Var->getIgnoreLiveness())
+ RangeMask[VarIndex] = false;
}
assert(TmpNumGlobals == (IsFullInit ? NumGlobals : 0));
+ // Fix up RangeMask for variables before FirstVar.
+ for (auto I = Func->getVariables().begin(); I != FirstVar; ++I) {
+ Variable *Var = *I;
+ SizeT VarIndex = Var->getIndex();
+ if (Var->getIgnoreLiveness() ||
+ (!IsFullInit && !Var->hasReg() && !Var->getWeight().isInf()))
+ RangeMask[VarIndex] = false;
+ }
+
// Process each node.
for (auto I = FirstNode, E = Func->getNodes().end(); I != E; ++I) {
LivenessNode &Node = Nodes[(*I)->getIndex()];
@@ -100,17 +115,6 @@ void Liveness::initInternal(NodeList::const_iterator FirstNode,
// LiveBegin and LiveEnd are reinitialized before each pass over
// the block.
}
-
- // Initialize the bitmask of which variables to track.
- RangeMask.resize(NumVars);
- RangeMask.set(0, NumVars);
- if (!IsFullInit) {
- // Reset initial variables that are not pre-colored or infinite-weight.
- for (auto I = Func->getVariables().begin(); I != FirstVar; ++I) {
- Variable *Var = *I;
- RangeMask[Var->getIndex()] = (Var->hasReg() || Var->getWeight().isInf());
- }
- }
}
void Liveness::init() {
« no previous file with comments | « src/IceCfgNode.cpp ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698