[lld] r176842 - [Pass][Layout] Make algorithm not n^2.
Michael J. Spencer
bigcheesegs at gmail.com
Mon Mar 11 17:10:00 PDT 2013
Author: mspencer
Date: Mon Mar 11 19:10:00 2013
New Revision: 176842
URL: http://llvm.org/viewvc/llvm-project?rev=176842&view=rev
Log:
[Pass][Layout] Make algorithm not n^2.
This reduces the time spent in this function while linking ASTMatchersTests
from %43 to %2.4 of total link time.
Modified:
lld/trunk/lib/Passes/LayoutPass.cpp
Modified: lld/trunk/lib/Passes/LayoutPass.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Passes/LayoutPass.cpp?rev=176842&r1=176841&r2=176842&view=diff
==============================================================================
--- lld/trunk/lib/Passes/LayoutPass.cpp (original)
+++ lld/trunk/lib/Passes/LayoutPass.cpp Mon Mar 11 19:10:00 2013
@@ -390,6 +390,8 @@ void LayoutPass::buildOrdinalOverrideMap
uint64_t index = 0;
for (auto ai : range) {
const DefinedAtom *atom = ai;
+ if (_ordinalOverrideMap.find(atom) != _ordinalOverrideMap.end())
+ continue;
AtomToAtomT::iterator start = _followOnRoots.find(atom);
if (start != _followOnRoots.end()) {
for (const DefinedAtom *nextAtom = start->second; nextAtom != NULL;
More information about the llvm-commits
mailing list