History log of /external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
67cb638629c69ab8c896175f58b4f472de5988d9 12-Mar-2013 Meador Inge <meadori@codesourcery.com> 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
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
328d1b65002e68ae65ffef05eed19122cbf721f5 02-Mar-2013 Peter Collingbourne <peter@pcc.me.uk> Modify {Call,Invoke}Inst::addAttribute to take an AttrKind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
f26b4f05b3fdd8618f75b8784388e8415a6eea0c 27-Feb-2013 Nadav Rotem <nrotem@apple.com> For each function that we optimize we initialize a new list of lib functions. For each function name we malloc memory. This patch changes the Libcall map to use BumpPtrAllocator. Now we malloc only once. This speeds up instcombine by a few % on a large c++ program.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176170 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
143d46476cdcf5b88b9ee18ebd799e5820a2db0e 22-Feb-2013 Bill Wendling <isanbard@gmail.com> Implement the NoBuiltin attribute.

The 'nobuiltin' attribute is applied to call sites to indicate that LLVM should
not treat the callee function as a built-in function. I.e., it shouldn't try to
replace that function with different code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
df8a668e3f694abcbe55224050f2c2f242b24e1e 19-Feb-2013 Bill Wendling <isanbard@gmail.com> Temporarily revert r175470 for more review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175476 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
2af5035a1d4124881c8fe3d46354341d01374fb7 19-Feb-2013 Bill Wendling <isanbard@gmail.com> Check to see if the 'no-builtin' attribute is set before simplifying a library call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
33daeab1bb8df65273fd9ecbf1a261f96733732e 08-Feb-2013 Chad Rosier <mcrosier@apple.com> [SimplifyLibCalls] Library call simplification doen't work if the call site
isn't using the default calling convention. However, if the transformation is
from a call to inline IR, then the calling convention doesn't matter.
rdar://13157990

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174724 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
0b8c9a80f20772c3793201ab5b251d3520b9cea3 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move all of the header files which are involved in modelling the LLVM IR
into their new header subdirectory: include/llvm/IR. This matches the
directory structure of lib, and begins to correct a long standing point
of file layout clutter in LLVM.

There are still more header files to move here, but I wanted to handle
them in separate commits to make tracking what files make sense at each
layer easier.

The only really questionable files here are the target intrinsic
tablegen files. But that's a battle I'd rather not fight today.

I've updated both CMake and Makefile build systems (I think, and my
tests think, but I may have missed something).

I've also re-sorted the includes throughout the project. I'll be
committing updates to Clang, DragonEgg, and Polly momentarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
034b94b17006f51722886b0f2283fb6fb19aca1f 19-Dec-2012 Bill Wendling <isanbard@gmail.com> Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

Sooooo many of these had incorrect or strange main module includes.
I have manually inspected all of these, and fixed the main module
include to be the nearest plausible thing I could find. If you own or
care about any of these source files, I encourage you to take some time
and check that these edits were sensible. I can't have broken anything
(I strictly added headers, and reordered them, never removed), but they
may not be the headers you'd really like to identify as containing the
API being implemented.

Many forward declarations and missing includes were added to a header
files to allow them to parse cleanly when included first. The main
module rule does in fact have its merits. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
aa8cccf1292503f4a5d3fc55610f9a24f6dbee74 29-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate puts optimizations

This patch migrates the puts optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

All the simplifiers from simplify-libcalls have now been migrated to
instcombine. Yay! Just a few other bits to migrate (prototype attribute
inference and a few statistics) and simplify-libcalls can finally be put
to rest.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
5c5e230ac7ab03937f685baaf78525fd2b8154f1 29-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate fputs optimizations

This patch migrates the fputs optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168893 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
c2e331275bac0e5e16f24bdb3ae4bc39a3caba5b 29-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate fwrite optimizations

This patch migrates the fwrite optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
28d52913ab0cda3fa21a4b16ad87fea4321b5e7e 29-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate fprintf optimizations

This patch migrates the fprintf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
69ea027e045f359b48bd436d530fc443a7cbb5c9 27-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate sprintf optimizations

This patch migrates the sprintf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
d6d685985047634e1faf5460321e21d77ec6c1bf 26-Nov-2012 Meador Inge <meadori@codesourcery.com> Fix a comment bug in toascii simplifier

When I migrated the toascii simplifier in r168580 Benjamin Kramer noticed
a bug in one of the comments that I migrated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
d7aa3231f75174810a3443e6c2e1993ddefc1dd2 26-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate printf optimizations

This patch migrates the printf optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168604 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
38c4441797a9c90dee830d9b90491742ff83d42c 26-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate toascii optimizations

This patch migrates the toascii optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168580 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
017bb750ab99b2ca54771fc86a6b2fed4ad90eec 26-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate isascii optimizations

This patch migrates the isascii optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
a0798ec3774de21f3ae3a7eba237e274e4c05ac3 26-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate isdigit optimizations

This patch migrates the isdigit optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
dfb3b1a779c62c1ee41f9cddcaad0b89278052ae 26-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate *abs optimizations

This patch migrates the *abs optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168574 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
15d099a790f3fd6f8f643c4e7c50a1659f4fc92b 25-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate ffs* optimizations

This patch migrates the ffs* optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168571 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
2920a71663b96f2c33b1fee09ca5ca9f5dc1cf12 13-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate math library call simplifications

This patch migrates the math library call simplifications from the
simplify-libcalls pass into the instcombine library call simplifier.

I have typically migrated just one simplifier at a time, but the math
simplifiers are interdependent because:

1. CosOpt, PowOpt, and Exp2Opt all depend on UnaryDoubleFPOpt.
2. CosOpt, PowOpt, Exp2Opt, and UnaryDoubleFPOpt all depend on
the option -enable-double-float-shrink.

These two factors made migrating each of these simplifiers individually
more of a pain than it would be worth. So, I migrated them all together.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
30d8f0e9770db76f19273419c57fe112129b145a 12-Nov-2012 Meador Inge <meadori@codesourcery.com> Normalize memcmp constant folding results.

The library call simplifier folds memcmp calls with all constant arguments
to a constant. For example:

memcmp("foo", "foo", 3) -> 0
memcmp("hel", "foo", 3) -> 1
memcmp("foo", "hel", 3) -> -1

The folding is implemented in terms of the system memcmp that LLVM gets
linked with. It currently just blindly uses the value returned from
the system memcmp as the folded constant.

This patch normalizes the values returned from the system memcmp to
(-1, 0, 1) so that we get consistent results across multiple platforms.
The test cases were adjusted accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167726 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
26ebe398f2bddae5395b4ad8c7ffb5933b2230d1 11-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate memset optimizations

This patch migrates the memset optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167689 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
d7cb600514a1d85e88ae873633bb42357babbc68 11-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate memmove optimizations

This patch migrates the memmove optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167687 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
11b04b40f285c8dd2c9ae9b349c3877078eeee10 11-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate memcpy optimizations

This patch migrates the memcpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167686 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
bb51ec8b62c2819882b82a2510bf4df6f459bd51 11-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate memcmp optimizations

This patch migrates the memcmp optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167683 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
6e1591a5d5fba3bde66e3ffd4dd73edd6b94cecf 11-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strstr optimizations

This patch migrates the strstr optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167682 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
b69bf6be1b042a5f06a623fc546107fc6d9f46c4 11-Nov-2012 Meador Inge <meadori@codesourcery.com> Add method for replacing instructions to LibCallSimplifier

In some cases the library call simplifier may need to replace instructions
other than the library call being simplified. In those cases it may be
necessary for clients of the simplifier to override how the replacements
are actually done. As such, a new overrideable method for replacing
instructions was added to LibCallSimplifier.

A new subclass of LibCallSimplifier is also defined which overrides
the instruction replacement method. This is because the instruction
combiner defines its own replacement method which updates the worklist
when instructions are replaced.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167681 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
5464ee7eaaf490444589d8716ae529827e29aa9b 10-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strcspn optimizations

This patch migrates the strcspn optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
e29c88064fb11d630d00356ad8d340b9dca9ef77 10-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Query target library information to gate libcall simplifications

Several of the simplifiers migrated from the simplify-libcalls pass to
the instcombine pass were not correctly checking the target library
information to gate the simplifications. This patch ensures that the
check is made.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
7629de3326318e533ab969abd1b0cbc569b3f3b7 08-Nov-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strspn optimizations

This patch migrates the strspn optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167568 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
ece6c6bb6329748b92403c06ac87f45c43485911 01-Nov-2012 Chandler Carruth <chandlerc@gmail.com> Revert the series of commits starting with r166578 which introduced the
getIntPtrType support for multiple address spaces via a pointer type,
and also introduced a crasher bug in the constant folder reported in
PR14233.

These commits also contained several problems that should really be
addressed before they are re-committed. I have avoided reverting various
cleanups to the DataLayout APIs that are reasonable to have moving
forward in order to reduce the amount of churn, and minimize the number
of commits that were reverted. I've also manually updated merge
conflicts and manually arranged for the getIntPtrType function to stay
in DataLayout and to be defined in a plausible way after this revert.

Thanks to Duncan for working through this exact strategy with me, and
Nick Lewycky for tracking down the really annoying crasher this
triggered. (Test case to follow in its own commit.)

After discussing with Duncan extensively, and based on a note from
Micah, I'm going to continue to back out some more of the more
problematic patches in this series in order to ensure we go into the
LLVM 3.2 branch with a reasonable story here. I'll send a note to
llvmdev explaining what's going on and why.

Summary of reverted revisions:

r166634: Fix a compiler warning with an unused variable.
r166607: Add some cleanup to the DataLayout changes requested by
Chandler.
r166596: Revert "Back out r166591, not sure why this made it through
since I cancelled the command. Bleh, sorry about this!
r166591: Delete a directory that wasn't supposed to be checked in yet.
r166578: Add in support for getIntPtrType to get the pointer type based
on the address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
e0f1dca1c8c191db3b353b60142a574c2d1c2a54 31-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strto* optimizations

This patch migrates the strto* optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167119 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
08684d1f069711692502d091669a6031c31cdd4a 31-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strpbrk optimizations

This patch migrates the strpbrk optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
57cfd71f881ae381fa43667e003f595ffd70ea18 31-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strlen optimizations

This patch migrates the strlen optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
a0885fb8825ed362041b5cf291a007a9f9301ff8 31-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strncpy optimizations

This patch migrates the strncpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
e6d781fd3cf9aa30d1c533308d1fdb6738e4f89f 31-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate stpcpy optimizations

This patch migrates the stpcpy optimizations from the simplify-libcalls
pass into the instcombine library call simplifier. Note that the
__stpcpy_chk simplifications were migrated in a previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167083 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
fa9d1372c99e5b74406a606756ba77d620d575bb 31-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Split out the __stpcpy_chk simplifications from StrCpyChkOpt

r166198 migrated the strcpy optimization to instcombine. The strcpy
simplifier that was migrated from Transforms/Scalar/SimplifyLibCalls.cpp
was also doing some __strcpy_chk simplifications. Those fortified
simplifications were migrated as well, but introduced a bug in the
__stpcpy_chk simplifier in the process. This happened because the
__strcpy_chk and __stpcpy_chk simplifiers were both mapped to StrCpyChkOpt
which was updated with simplifications that worked for __strcpy_chk, but
not __stpcpy_chk.

This patch fixes the problem by adding proper test coverage and creating a
new simplifier for __stpcpy_chk (instead of sharing one with __strcpy_chk).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
aa76e9e2cf50af190de90bc778b7f7e42ef9ceff 24-Oct-2012 Micah Villmow <villmow@gmail.com> Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the
clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
b3394f56416df855f860a82e1f2222bcf476ac27 18-Oct-2012 Meador Inge <meadori@codesourcery.com> Cosmetic change -- move two simplifiers to the right commented statement group.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
0c41d57b09884b92f988cb88553eaa7c77819d4b 18-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strcpy optimizations

This patch migrates the strcpy optimizations from the simplify-libcalls pass
into the instcombine library call simplifier. Note also that StrCpyChkOpt
has been updated with a few simplifications that were being done in the
simplify-libcalls version of StrCpyOpt, but not in the migrated implementation
of StrCpyOpt. There is no reason to overload StrCpyOpt with fortified and
regular simplifications in the new model since there is already a dedicated
simplifier for __strcpy_chk.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
a239c2e6a7775e890bcfb0867b84e512ceb993de 15-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strcmp and strncmp optimizations

This patch migrates the strcmp and strncmp optimizations from the
simplify-libcalls pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165915 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
eb7ff058483335d2cdd8fb34a70ae04b22de52d0 13-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused private field.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
186f8d90df976349481ccf8c8e24c37c6ec5ffb4 13-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strchr and strrchr optimizations

This patch migrates the strchr and strrchr optimizations from the
simplify-libcalls pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
73d8a5864fe8c52be2b710c10ec155019738aad5 13-Oct-2012 Meador Inge <meadori@codesourcery.com> instcombine: Migrate strcat and strncat optimizations

This patch migrates the strcat and strncat optimizations from the
simplify-libcalls pass into the instcombine library call simplifier.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
5e8904576a5260cfd5b14596e338a4bb25b9817e 13-Oct-2012 Meador Inge <meadori@codesourcery.com> Implement new LibCallSimplifier class

This patch implements the new LibCallSimplifier class as outlined in [1].
In addition to providing the new base library simplification infrastructure,
all the fortified library call simplifications were moved over to the new
infrastructure. The rest of the library simplification optimizations will
be moved over with follow up patches.

NOTE: The original fortified library call simplifier located in the
SimplifyFortifiedLibCalls class was not removed because it is still
used by CodeGenPrepare. This class will eventually go away too.

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-August/052283.html

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165873 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp