forked from OSchip/llvm-project
20255ef24d
Nadav reported a performance regression due to the work I did to merge the library call simplifier into instcombine [1]. The issue is that a new LibCallSimplifier object is being created whenever InstCombiner::runOnFunction is called. Every time a LibCallSimplifier object is used to optimize a call it creates a hash table to map from a function name to an object that optimizes functions of that name. For short-lived LibCallSimplifier instances this is quite inefficient. Especially for cases where no calls are actually simplified. This patch fixes the issue by dropping the hash table and implementing an explicit lookup function to correlate the function name to the object that optimizes functions of that name. This avoids the cost of always building and destroying the hash table in cases where the LibCallSimplifier object is short-lived and avoids the cost of building the table when no simplifications are actually preformed. On a benchmark containing 100,000 calls where none of them are simplified I noticed a 30% speedup. On a benchmark containing 100,000 calls where all of them are simplified I noticed an 8% speedup. [1] http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130304/167639.html llvm-svn: 176840 |
||
---|---|---|
.. | ||
BasicBlockUtils.cpp | ||
BreakCriticalEdges.cpp | ||
BuildLibCalls.cpp | ||
BypassSlowDivision.cpp | ||
CMakeLists.txt | ||
CloneFunction.cpp | ||
CloneModule.cpp | ||
CmpInstAnalysis.cpp | ||
CodeExtractor.cpp | ||
DemoteRegToStack.cpp | ||
InlineFunction.cpp | ||
InstructionNamer.cpp | ||
IntegerDivision.cpp | ||
LCSSA.cpp | ||
LLVMBuild.txt | ||
Local.cpp | ||
LoopSimplify.cpp | ||
LoopUnroll.cpp | ||
LoopUnrollRuntime.cpp | ||
LowerExpectIntrinsic.cpp | ||
LowerInvoke.cpp | ||
LowerSwitch.cpp | ||
Makefile | ||
Mem2Reg.cpp | ||
MetaRenamer.cpp | ||
ModuleUtils.cpp | ||
PromoteMemoryToRegister.cpp | ||
SSAUpdater.cpp | ||
SimplifyCFG.cpp | ||
SimplifyIndVar.cpp | ||
SimplifyInstructions.cpp | ||
SimplifyLibCalls.cpp | ||
UnifyFunctionExitNodes.cpp | ||
Utils.cpp | ||
ValueMapper.cpp |