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

Unified Diff: src/IceLiveness.cpp

Issue 1844713004: Subzero: Ignore variables with no actual uses. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Also ignore rematerializable variables Created 4 years, 9 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/IceLiveness.h ('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 d9e8e8af37d5808a06908904d8f32c2f67091d73..46c834b77c8a9134c5f94baea3c52cc60553cc78 100644
--- a/src/IceLiveness.cpp
+++ b/src/IceLiveness.cpp
@@ -50,7 +50,7 @@ void Liveness::initInternal(NodeList::const_iterator FirstNode,
Variable *Var = *I;
if (VMetadata->isMultiBlock(Var)) {
++TmpNumGlobals;
- } else {
+ } else if (VMetadata->isSingleBlock(Var)) {
SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex();
++Nodes[Index].NumLocals;
}
@@ -81,18 +81,18 @@ void Liveness::initInternal(NodeList::const_iterator FirstNode,
for (auto I = FirstVar, E = Func->getVariables().end(); I != E; ++I) {
Variable *Var = *I;
SizeT VarIndex = Var->getIndex();
- SizeT LiveIndex;
+ SizeT LiveIndex = InvalidLiveIndex;
if (VMetadata->isMultiBlock(Var)) {
LiveIndex = TmpNumGlobals++;
LiveToVarMap[LiveIndex] = Var;
- } else {
+ } else if (VMetadata->isSingleBlock(Var)) {
SizeT NodeIndex = VMetadata->getLocalUseNode(Var)->getIndex();
LiveIndex = Nodes[NodeIndex].NumLocals++;
Nodes[NodeIndex].LiveToVarMap[LiveIndex] = Var;
LiveIndex += NumGlobals;
}
VarToLiveMap[VarIndex] = LiveIndex;
- if (Var->getIgnoreLiveness())
+ if (LiveIndex == InvalidLiveIndex || Var->getIgnoreLiveness())
RangeMask[VarIndex] = false;
}
assert(TmpNumGlobals == (IsFullInit ? NumGlobals : 0));
« no previous file with comments | « src/IceLiveness.h ('k') | src/IceOperand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698