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

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: Fix non-debug build 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
Index: src/IceLiveness.cpp
diff --git a/src/IceLiveness.cpp b/src/IceLiveness.cpp
index 9b58b4339f38b019c4f06363f67a88559ddd3b4d..e992d2811453be480a6d78785358996faa72a6c2 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;

Powered by Google App Engine
This is Rietveld 408576698