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

Unified Diff: src/IceLiveness.cpp

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/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 9b58b4339f38b019c4f06363f67a88559ddd3b4d..0960bd860d2ffdfd471a14d02db4fc38500972b6 100644
--- a/src/IceLiveness.cpp
+++ b/src/IceLiveness.cpp
@@ -32,6 +32,7 @@ void Liveness::init() {
// Initialize most of the container sizes.
SizeT NumVars = Func->getVariables().size();
SizeT NumNodes = Func->getNumNodes();
+ VariablesMetadata *VMetadata = Func->getVMetadata();
Nodes.resize(NumNodes);
VarToLiveMap.resize(NumVars);
if (Mode == Liveness_Intervals)
@@ -41,10 +42,10 @@ void Liveness::init() {
// block.
for (SizeT i = 0; i < NumVars; ++i) {
Variable *Var = Func->getVariables()[i];
- if (Func->getVMetadata()->isMultiBlock(Var)) {
+ if (VMetadata->isMultiBlock(Var)) {
++NumGlobals;
} else {
- SizeT Index = Func->getVMetadata()->getLocalUseNode(Var)->getIndex();
+ SizeT Index = VMetadata->getLocalUseNode(Var)->getIndex();
++Nodes[Index].NumLocals;
}
}
@@ -64,11 +65,11 @@ void Liveness::init() {
Variable *Var = Func->getVariables()[i];
SizeT VarIndex = Var->getIndex();
SizeT LiveIndex;
- if (Func->getVMetadata()->isMultiBlock(Var)) {
+ if (VMetadata->isMultiBlock(Var)) {
LiveIndex = TmpNumGlobals++;
LiveToVarMap[LiveIndex] = Var;
} else {
- SizeT NodeIndex = Func->getVMetadata()->getLocalUseNode(Var)->getIndex();
+ SizeT NodeIndex = VMetadata->getLocalUseNode(Var)->getIndex();
LiveIndex = Nodes[NodeIndex].NumLocals++;
Nodes[NodeIndex].LiveToVarMap[LiveIndex] = Var;
LiveIndex += NumGlobals;
@@ -97,10 +98,6 @@ Variable *Liveness::getVariable(SizeT LiveIndex, const CfgNode *Node) const {
return Nodes[NodeIndex].LiveToVarMap[LiveIndex - NumGlobals];
}
-SizeT Liveness::getLiveIndex(const Variable *Var) const {
- return VarToLiveMap[Var->getIndex()];
-}
-
void Liveness::addLiveRange(Variable *Var, InstNumberT Start, InstNumberT End,
uint32_t WeightDelta) {
LiveRange &LiveRange = LiveRanges[Var->getIndex()];
« 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