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

Unified Diff: src/IceLiveness.cpp

Issue 1746613002: Subzero: Reduce copying of Liveness bitvectors. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix memory over-allocation Created 4 years, 10 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') | no next file » | 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 2bfa624d57cf03f5c3855648871e9b30291a7e7f..d9e8e8af37d5808a06908904d8f32c2f67091d73 100644
--- a/src/IceLiveness.cpp
+++ b/src/IceLiveness.cpp
@@ -106,6 +106,7 @@ void Liveness::initInternal(NodeList::const_iterator FirstNode,
RangeMask[VarIndex] = false;
}
+ SizeT MaxLocals = 0;
// Process each node.
for (auto I = FirstNode, E = Func->getNodes().end(); I != E; ++I) {
LivenessNode &Node = Nodes[(*I)->getIndex()];
@@ -113,7 +114,9 @@ void Liveness::initInternal(NodeList::const_iterator FirstNode,
Node.LiveIn.resize(NumGlobals);
Node.LiveOut.resize(NumGlobals);
// LiveBegin and LiveEnd are reinitialized before each pass over the block.
+ MaxLocals = std::max(MaxLocals, Node.NumLocals);
}
+ ScratchBV.reserve(NumGlobals + MaxLocals);
}
void Liveness::init() {
« no previous file with comments | « src/IceLiveness.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698