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; |