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

Unified Diff: src/IceLiveness.h

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/IceInst.cpp ('k') | src/IceLiveness.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceLiveness.h
diff --git a/src/IceLiveness.h b/src/IceLiveness.h
index 70578d42b518dcbd9bc2698049331f683865dfa3..f1f6ad9021995849544d4cf0b31cc9e6022b8a32 100644
--- a/src/IceLiveness.h
+++ b/src/IceLiveness.h
@@ -67,7 +67,11 @@ public:
Cfg *getFunc() const { return Func; }
LivenessMode getMode() const { return Mode; }
Variable *getVariable(SizeT LiveIndex, const CfgNode *Node) const;
- SizeT getLiveIndex(SizeT VarIndex) const { return VarToLiveMap[VarIndex]; }
+ SizeT getLiveIndex(SizeT VarIndex) const {
+ const SizeT LiveIndex = VarToLiveMap[VarIndex];
+ assert(LiveIndex != InvalidLiveIndex);
+ return LiveIndex;
+ }
SizeT getNumGlobalVars() const { return NumGlobals; }
SizeT getNumVarsInNode(const CfgNode *Node) const {
return NumGlobals + Nodes[Node->getIndex()].NumLocals;
@@ -106,6 +110,7 @@ private:
if (Index >= Nodes.size())
Nodes.resize(Index + 1);
}
+ static constexpr SizeT InvalidLiveIndex = -1;
Cfg *Func;
LivenessMode Mode;
SizeT NumGlobals = 0;
« no previous file with comments | « src/IceInst.cpp ('k') | src/IceLiveness.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698