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

Unified Diff: src/IceLiveness.h

Issue 652633002: Subzero: Improve performance of liveness analysis and live range construction. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove TODO Created 6 years, 2 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 031f4e93406c30d1585050d5bbbae9e78f33d3d3..2949d568d68964f67793512cc6ba06a9b09f0499 100644
--- a/src/IceLiveness.h
+++ b/src/IceLiveness.h
@@ -37,11 +37,12 @@ public:
// LiveIn and LiveOut track the in- and out-liveness of the global
// variables. The size of each vector is
// LivenessNode::NumGlobals.
- llvm::BitVector LiveIn, LiveOut;
+ LivenessBV LiveIn, LiveOut;
// LiveBegin and LiveEnd track the instruction numbers of the start
// and end of each variable's live range within this block. The
- // size of each vector is NumLocals + Liveness::NumGlobals.
- std::vector<InstNumberT> LiveBegin, LiveEnd;
+ // index/key of each element is less than NumLocals +
+ // Liveness::NumGlobals.
+ LiveBeginEndMap LiveBegin, LiveEnd;
private:
// TODO: Disable these constructors when Liveness::Nodes is no
@@ -55,23 +56,25 @@ public:
Liveness(Cfg *Func, LivenessMode Mode)
: Func(Func), Mode(Mode), NumGlobals(0) {}
void init();
+ Cfg *getFunc() const { return Func; }
+ LivenessMode getMode() const { return Mode; }
Variable *getVariable(SizeT LiveIndex, const CfgNode *Node) const;
- SizeT getLiveIndex(const Variable *Var) const;
+ SizeT getLiveIndex(SizeT VarIndex) const { return VarToLiveMap[VarIndex]; }
SizeT getNumGlobalVars() const { return NumGlobals; }
SizeT getNumVarsInNode(const CfgNode *Node) const {
return NumGlobals + Nodes[Node->getIndex()].NumLocals;
}
- llvm::BitVector &getLiveIn(const CfgNode *Node) {
+ LivenessBV &getLiveIn(const CfgNode *Node) {
return Nodes[Node->getIndex()].LiveIn;
}
- llvm::BitVector &getLiveOut(const CfgNode *Node) {
+ LivenessBV &getLiveOut(const CfgNode *Node) {
return Nodes[Node->getIndex()].LiveOut;
}
- std::vector<InstNumberT> &getLiveBegin(const CfgNode *Node) {
- return Nodes[Node->getIndex()].LiveBegin;
+ LiveBeginEndMap *getLiveBegin(const CfgNode *Node) {
+ return &Nodes[Node->getIndex()].LiveBegin;
}
- std::vector<InstNumberT> &getLiveEnd(const CfgNode *Node) {
- return Nodes[Node->getIndex()].LiveEnd;
+ LiveBeginEndMap *getLiveEnd(const CfgNode *Node) {
+ return &Nodes[Node->getIndex()].LiveEnd;
}
LiveRange &getLiveRange(Variable *Var);
void addLiveRange(Variable *Var, InstNumberT Start, InstNumberT End,
« 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