llvm-6502/lib/Transforms
Meador Inge 67cb638629 LibCallSimplifier: optimize speed for short-lived instances
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176840 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 00:08:29 +00:00
..
Hello
InstCombine Simplify code. No functionality change. 2013-03-09 11:18:59 +00:00
Instrumentation Use the correct index variable. This is the meat of what was supposed to be in 2013-03-09 10:13:26 +00:00
IPO Use LLVMBool instead of 'bool' in the C API. Based on a patch by Peter Zotov! 2013-03-10 21:58:22 +00:00
ObjCARC Fixed a careless mistake. 2013-02-23 00:31:32 +00:00
Scalar Keep coding stanard. 2013-03-07 22:20:06 +00:00
Utils LibCallSimplifier: optimize speed for short-lived instances 2013-03-12 00:08:29 +00:00
Vectorize BBVectorize: Fixup debugging statements 2013-03-10 20:57:42 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile