History log of /external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7f07d2fbcfdbb77c013fa83f51e5ef4ee729f10b 22-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> SimplifyLibCalls: Give all safely-shrinkable libcalls the same treatment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162383 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ec7e92af95bf87d7eff70774895c32914ab3a40a 22-Aug-2012 Chad Rosier <mcrosier@apple.com> Add a few float shrinking optimizations to SimplifyLibCalls. Unsafe
optimizations are guarded by the -enable-double-float-shrink LLVM option.
Last bit of PR13574. Patch by Weiming Zhao <weimingz@codeaurora.org>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
d7e2525a6d2a7d1d7c269237df2f9de78f0bc6a2 22-Aug-2012 Chad Rosier <mcrosier@apple.com> Add a new helper function, AddOpt(F1, F1, Opt), as part of PR13574. No
functional change intended. Patch by Weiming Zhao <weimingz@codeaurora.org>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
2b749571066384109c7602153d5dc25516a71d72 18-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> SimplifyLibcalls: Add fabs and trunc to the list of libcalls that are safe to shrink from double to float.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
cd31fc79862f0bf3858bba0b5e30ddd25d8b0065 26-Jul-2012 Nuno Lopes <nunoplopes@sapo.pt> do null checks for a few more Emit*() functions.
Thanks Eli for noticing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
51004dff923259c90591621e7151408ad94e0eb8 25-Jul-2012 Nuno Lopes <nunoplopes@sapo.pt> make all Emit*() functions consult the TargetLibraryInfo information before creating a call to a library function.
Update all clients to pass the TLI information around.
Previous draft reviewed by Eli.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160733 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a94d6e87c4c49f2e81b01d66d8bfb591277f8f96 24-Jul-2012 Nadav Rotem <nadav.rotem@intel.com> Clean whitespaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
06cb8ed00696eb14d1b831921452e50ec0568ea2 29-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h

This was always part of the VMCore library out of necessity -- it deals
entirely in the IR. The .cpp file in fact was already part of the VMCore
library. This is just a mechanical move.

I've tried to go through and re-apply the coding standard's preferred
header sort, but at 40-ish files, I may have gotten some wrong. Please
let me know if so.

I'll be committing the corresponding updates to Clang and Polly, and
Duncan has DragonEgg.

Thanks to Bill and Eric for giving the green light for this bit of cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
fd99cabdc6de1eadda0e9a45d0acc8aa7c2f8f67 26-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> revert my previous commit (r159173), since as Eli pointed out, it's perfectly ok to mark realloc as noalias

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a88d0edb495212d08357550a5bcbde9e924a9969 26-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> do not set realloc() as NotAlias, since it can return the same pointer. This whole thing should be upgraded to use the MemoryBuiltin interface anyway..

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159173 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ac78266674b5eb59999fb0ad5d00dcfd22086267 15-May-2012 David Majnemer <david.majnemer@gmail.com> Teach SimplifyLibCalls about stpcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156815 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
d5bda5ec663f43710fe462f44b77ddbcf8fe9d9e 18-Apr-2012 Joe Groff <arcata@gmail.com> fix pr12559: mark unavailable win32 math libcalls
also fix SimplifyLibCalls to use TLI rather than compile-time conditionals to enable optimizations on floor, ceil, round, rint, and nearbyint

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154960 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
18c7f80b3e83ab584bd8572695a3cde8bafd9d3c 05-Feb-2012 Chris Lattner <sabre@nondot.org> reapply the patches reverted in r149470 that reenable ConstantDataArray,
but with a critical fix to the SelectionDAG code that optimizes copies
from strings into immediate stores: the previous code was stopping reading
string data at the first nul. Address this by adding a new argument to
llvm::getConstantStringInfo, preserving the behavior before the patch.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149800 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
91766fe066efe6e0969ba805a2e3726a70ed34a3 01-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert Chris' commits up to r149348 that started causing VMCoreTests unit test to fail.

These are:

r149348
r149351
r149352
r149354
r149356
r149357
r149361
r149362
r149364
r149365

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
2cf07eccff674b5157febbc4fb4f4246e47806c7 31-Jan-2012 Chris Lattner <sabre@nondot.org> eliminate the last uses of GetConstantStringInfo from this file, I didn't realize I was that close...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
90f1d8a5da6f962175af0a3ebedb76aeffa42694 31-Jan-2012 Chris Lattner <sabre@nondot.org> start moving SimplifyLibcalls over to getConstantStringInfo, which is
dramatically more efficient than GetConstantStringInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a6b21ea4ba4ef7250346c9423807415be049ebfd 27-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Turn cos(-x) into cos(x). Patch by Alexander Malyshev!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147291 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
127a669d09e21ddcd525f493c19dc399093bef35 12-Dec-2011 Joerg Sonnenberger <joerg@bec.de> Only replace fwrite with fputc, if the return value is unused.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146411 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ccbf1e36d34c2d66600748bdd8767dc122629a58 12-Dec-2011 Chandler Carruth <chandlerc@gmail.com> Switch llvm.cttz and llvm.ctlz to accept a second i1 parameter which
indicates whether the intrinsic has a defined result for a first
argument equal to zero. This will eventually allow these intrinsics to
accurately model the semantics of GCC's __builtin_ctz and __builtin_clz
and the X86 instructions (prior to AVX) which implement them.

This patch merely sets the stage by extending the signature of these
intrinsics and establishing auto-upgrade logic so that the old spelling
still works both in IR and in bitcode. The upgrade logic preserves the
existing (inefficient) semantics. This patch should not change any
behavior. CodeGen isn't updated because it can use the existing
semantics regardless of the flag's value.

Note that this will be followed by API updates to Clang and DragonEgg.

Reviewed by Nick Lewycky!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146357 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
9d434dbff3eb0501efc3457acec2401afdffef2f 17-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add support for custom names for library functions in TargetLibraryInfo. Add a custom name for fwrite and fputs on x86-32 OSX. Make SimplifyLibCalls honor the custom
names for fwrite and fputs.

Fixes <rdar://problem/9815881>.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
b5ccb25bc229f096e8bc88d2233cd96af1552eea 15-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> StringRefize and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144675 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
59e43bde289750a4683879727a9e0e41ab7000a6 29-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> SimplifyLibCalls: Use IRBuilder.CreateGlobalString when creating a string for printf->puts, which correctly sets the unnamed_addr bit on the resulting GlobalVariable.

Fixes PR11264.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
792860883e00edd8ccb55360cd22d1e131bbe396 06-Oct-2011 Eli Friedman <eli.friedman@gmail.com> PR11061: Make simplifylibcalls fold strcmp("", x) correctly.

While I'm here, fix the related issue with strncmp, add some actual tests for strcmp and strncmp, and start using StringRef::compare for constant folding instead of using strcmp/strncmp so that the optimized IR isn't dependent on the host's implementation of strcmp.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141227 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a9390a4d5f5d568059a80970d22194b165d097a7 27-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Stop emitting instructions with the name "tmp" they eat up memory and have to be uniqued, without any benefit.

If someone prefers %tmp42 to %42, run instnamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
db125cfaf57cc83e7dd7453de2d509bc8efd0e5e 18-Jul-2011 Chris Lattner <sabre@nondot.org> land David Blaikie's patch to de-constify Type, with a few tweaks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
eb9a85f09e18b3fe88499710404b38d3a9128f62 14-Jul-2011 Benjamin Kramer <benny.kra@googlemail.com> Change Intrinsic::getDeclaration and friends to take an ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
5fdd6c8793462549e3593890ec61573da06e3346 12-Jul-2011 Jay Foad <jay.foad@gmail.com> Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
2280ebd61416b73d0b6137f275b25af82e268d1f 12-Jul-2011 Bill Wendling <isanbard@gmail.com> Revert r134893 and r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
ne 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134893 into '.':
U include/llvm/Target/TargetData.h
U include/llvm/DerivedTypes.h
U tools/bugpoint/ExtractFunction.cpp
U unittests/Support/TypeBuilderTest.cpp
U lib/Target/ARM/ARMGlobalMerge.cpp
U lib/Target/TargetData.cpp
U lib/VMCore/Constants.cpp
U lib/VMCore/Type.cpp
U lib/VMCore/Core.cpp
U lib/Transforms/Utils/CodeExtractor.cpp
U lib/Transforms/Instrumentation/ProfilingUtils.cpp
U lib/Transforms/IPO/DeadArgumentElimination.cpp
U lib/CodeGen/SjLjEHPrepare.cpp
--- Reverse-merging r134888 into '.':
G include/llvm/DerivedTypes.h
U include/llvm/Support/TypeBuilder.h
U include/llvm/Intrinsics.h
U unittests/Analysis/ScalarEvolutionTest.cpp
U unittests/ExecutionEngine/JIT/JITTest.cpp
U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
U unittests/VMCore/PassManagerTest.cpp
G unittests/Support/TypeBuilderTest.cpp
U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
U lib/VMCore/IRBuilder.cpp
G lib/VMCore/Type.cpp
U lib/VMCore/Function.cpp
G lib/VMCore/Core.cpp
U lib/VMCore/Module.cpp
U lib/AsmParser/LLParser.cpp
U lib/Transforms/Utils/CloneFunction.cpp
G lib/Transforms/Utils/CodeExtractor.cpp
U lib/Transforms/Utils/InlineFunction.cpp
U lib/Transforms/Instrumentation/GCOVProfiling.cpp
U lib/Transforms/Scalar/ObjCARC.cpp
U lib/Transforms/Scalar/SimplifyLibCalls.cpp
U lib/Transforms/Scalar/MemCpyOptimizer.cpp
G lib/Transforms/IPO/DeadArgumentElimination.cpp
U lib/Transforms/IPO/ArgumentPromotion.cpp
U lib/Transforms/InstCombine/InstCombineCompares.cpp
U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
U lib/Transforms/InstCombine/InstCombineCalls.cpp
U lib/CodeGen/DwarfEHPrepare.cpp
U lib/CodeGen/IntrinsicLowering.cpp
U lib/Bitcode/Reader/BitcodeReader.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
f362affa3a695164a94d275fb44d18f44ebb855a 11-Jul-2011 Jay Foad <jay.foad@gmail.com> De-constify Types in FunctionType::get().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a2ab3999edb7c8c697271636ba1866a6d698f599 09-Mar-2011 Devang Patel <dpatel@apple.com> Preserve line number information while simplifying libcalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ea2578c63ffe09d030ed5520b6b82f7cc0026340 03-Mar-2011 Richard Osborne <richard@xmos.com> Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
022708f221e2a9ea1a42c07c7cd7817a8de881dc 03-Mar-2011 Richard Osborne <richard@xmos.com> Optimize fprintf -> iprintf if there are no floating point arguments
and siprintf is available on the target.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126940 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
419454ad3720b8cf4613d9e790669c8beaccd1a4 03-Mar-2011 Richard Osborne <richard@xmos.com> Optimize sprintf -> siprintf if there are no floating point arguments
and siprintf is available on the target.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
3649824bec09768cbdee7aa7cfbbcdd865373626 03-Mar-2011 Richard Osborne <richard@xmos.com> Optimize printf -> iprintf if there are no floating point arguments
and iprintf is available on the target. Currently iprintf is only
marked as being available on the XCore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
afbf48363aec6b660a0ea056cf2a5b342e36d950 24-Feb-2011 Chris Lattner <sabre@nondot.org> wire TargetLibraryInfo into simplify libcalls and use it in a couple of
trivial places. This pass needs a lot of work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126367 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e265ad86788f1c1542746c974f03606bd49c6a14 24-Feb-2011 Chris Lattner <sabre@nondot.org> move a massive amount of code out into its own helper function
to reduce nesting. This needs to be turned into a table.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
d02be24cadbba4754df2f3e83473b72c5de698dd 12-Feb-2011 Daniel Dunbar <daniel@zuster.org> SimplifyLibCalls: Add missing legalize check on various printf to puts and
putchar transforms, their return values are not compatible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a1bf4ca77389e0324e9d1ab6ba31a76caba0114d 27-Dec-2010 Benjamin Kramer <benny.kra@googlemail.com> SimplifyLibCalls: Use IRBuilder to simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122575 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
c32046e6eaffba890897da94ab8900d51bf9d18f 17-Dec-2010 Dan Gohman <gohman@apple.com> Revert r64460. strtol and friends cannot be marked readonly, even with
a null endptr argument, because they may write to errno.

This fixes a seflhost miscompile observed on Linux targets when TBAA
was enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122014 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
303023d9ffba419ffdd68862ea790e00c4f30cbf 30-Nov-2010 Anders Carlsson <andersca@mac.com> Add a puts optimization that converts puts() to putchar('\n').

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120398 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
081c34b725980f995be9080eaec24cd3dfaaf065 19-Oct-2010 Owen Anderson <resistor@mac.com> Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ce665bd2e2b581ab0858d1afe359192bac96b868 08-Oct-2010 Owen Anderson <resistor@mac.com> Now with fewer extraneous semicolons!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
4c75679b1c8ac0455a6496c91ac2ef5f59b6b76d 30-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> Tighten up prototype verification of strchr and strrchr to avoid a crash in the very unlikely case that someone passes an integer > i64 to strchr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115144 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
9510a2538bcf5e3b42b9ee02ff527fd6681af0ad 30-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> Add constant folding for strspn and strcspn to SimplifyLibCalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115116 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
05f585e28bc579a93c978068eb979acf98e991ff 30-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> Add strpbrk folding to SimplifyLibCalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e260990fa19e3f5f2935a922868e80b83fb87524 30-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify the loop in StrChrOptimizer. FileCheckize test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115095 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
06f25cfb334d6630fc5018260a78129f4b956bad 29-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> Teach SimplifyLibCalls how to optimize strrchr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
90c579de5a383cee278acc3f7e7b9d0a656e6a35 06-Aug-2010 Owen Anderson <resistor@mac.com> Reapply r110396, with fixes to appease the Linux buildbot gods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
1f74590e9d1b9cf0f1f81a156efea73f76546e05 06-Aug-2010 Owen Anderson <resistor@mac.com> Revert r110396 to fix buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
9ccaf53ada99c63737547c0235baeb8454b04e80 06-Aug-2010 Owen Anderson <resistor@mac.com> Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
2511bd06dea977b68f9254095afdb71782d7dda1 04-Aug-2010 Dan Gohman <gohman@apple.com> Fix a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
96f1d8ebdd33b3f9bdb3b1163f36072c68599f42 22-Jul-2010 Gabor Greif <ggreif@gmail.com> mass elimination of reliance on automatic iterator dereferencing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a399781289092fcdceb58b21174229f4373c4191 22-Jul-2010 Gabor Greif <ggreif@gmail.com> undo 80 column trespassing I caused

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109092 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
d13db2c59cc94162d6cf0a04187d408bfef6d4a7 22-Jul-2010 Owen Anderson <resistor@mac.com> Fix batch of converting RegisterPass<> to INTIALIZE_PASS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
10d2f4d01bb1732611d0647df321164bc0b6c98b 06-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Detabify this file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
8e1ebff9f122b18e9d9069ca251df9e467f37558 30-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
aee5dc19392f1378894a2dedd1b722883fe829fc 24-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106731 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e96af56a5baf1db88ba1ed6adf83084ea0a92ae5 16-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Make sure that simplify libcalls does not replace a call with one calling
convention with a new call with a different calling convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106134 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ea9ca0236d758967b40d3dd18054e90d65151674 16-Jun-2010 Benjamin Kramer <benny.kra@googlemail.com> simplify-libcalls: fold strncmp(x, y, 1) -> memcmp(x, y, 1)

The memcmp will be optimized further and even the pathological case
'strstr(x, "x") == x' generates optimal code now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106097 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
386e918438b72620e7c00ee1197bf6940bfe6cf8 15-Jun-2010 Benjamin Kramer <benny.kra@googlemail.com> simplify-libcalls: fold strstr(a, b) == a -> strncmp(a, b, strlen(b)) == 0


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
1464c1d60a33e19639b2bde5a6357af54daee6dd 26-May-2010 Benjamin Kramer <benny.kra@googlemail.com> Kill unneeded SExt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104692 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
48aefe15d08e4046b94715ea44e1f4a94af481a6 26-May-2010 Benjamin Kramer <benny.kra@googlemail.com> Properly promote operands when optimizing a single-character memcmp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104648 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
551754c4958086cc6910da7c950f2875e212f5cf 17-Apr-2010 Eric Christopher <echristo@apple.com> Revert 101465, it broke internal OpenGL testing.

Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
4ec2258ffb495d7ce00177e447740ef1123a27db 16-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
607a7ab3da72a2eb53553a520507cbb8068dd1d8 16-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101423 and r101397, they break llvm-gcc self-host on darwin10

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
2ff961f66816daab8bbc58a19025161d969821c2 15-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
9ee17208115482441953127615231c59a2f4d052 15-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101364, as it trips the linux nightlybot on some clang C++ tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
165dac08d1bb8428b32a5f39cdd3dbee2888987f 15-Apr-2010 Gabor Greif <ggreif@gmail.com> rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
20adc9dc4650313f017b27d9818eb2176238113d 04-Apr-2010 Mon P Wang <wangmp@apple.com> Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e754d3fb852abdeaf910c7331eed60f6303597c1 02-Apr-2010 Mon P Wang <wangmp@apple.com> Revert r100191 since it breaks objc in clang


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100199 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e33c848fa481b038d5ad0c7c898c33b2b27ec71e 02-Apr-2010 Mon P Wang <wangmp@apple.com> Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
100f090adde26005b9f1eca96871dff52825b27b 31-Mar-2010 Bob Wilson <bob.wilson@apple.com> Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
808bab0169ab7d2e8dfdc72dd2c991cd8ff2396d 30-Mar-2010 Mon P Wang <wangmp@apple.com> Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99928 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
eb8c6459fcfaa4fb786c3e8ed8ee2769a10d7f48 24-Mar-2010 Evan Cheng <evan.cheng@apple.com> Move OptChkCall off LibCallOptimization into StrCpyOpt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0289b419a492c207f2aaaa481c632cdcf33db5f3 23-Mar-2010 Evan Cheng <evan.cheng@apple.com> Teach simplify libcall to transform __strcpy_chk to __memcpy_chk to enable optimizations down stream.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99282 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
2d7186ae6dc5ecc82849248deb8d8f4059c150ba 16-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> str[r]chr returns its pointer argument so we cannot mark it as nocapture. Thanks to Duncan for spotting my mistake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98671 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
4446b04052da9eaeef32369712b9b560117560b0 16-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Mark str[r]chr readonly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98663 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
27ceaa13f820e33c44e29adc2095dd3e1e69d09f 06-Mar-2010 Eric Christopher <echristo@apple.com> Migrate _chk call lowering from SimplifyLibCalls to InstCombine. Stub
out the remainder of the calls that we should lower in some way and
move the tests to the new correct directory. Fix up tests that are now
optimized more than they were before by -instcombine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
b6174e3605a184df0e403d6502df1ed57cf34352 05-Mar-2010 Eric Christopher <echristo@apple.com> Move SimplifyLibCalls's LibCall builders to a separate file so they
can be used in more places. Add an argument for the TargetData that
most of them need. Update for the getInt8PtrTy() change. Should be
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a79eb387acbb7ed7eeb4cc8074efd4aeea6d1acd 05-Mar-2010 Evan Cheng <evan.cheng@apple.com> Safely turn memset_chk etc. to non-chk variant if the known object size is >= memset / memcpy / memmove size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97828 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
25ec483cfca8d3a3ba8728a4a126e04b92789069 05-Mar-2010 Eric Christopher <echristo@apple.com> Move GetStringLength and helper from SimplifyLibCalls to ValueTracking.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97793 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
1df9859c40492511b8aa4321eb76496005d3b75b 16-Feb-2010 Duncan Sands <baldrick@free.fr> There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
b0bc6c361da9009e8414efde317d9bbff755f6c0 15-Feb-2010 Duncan Sands <baldrick@free.fr> Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0c6a8f9eda4651e0f54a7edf171525d16b1ff3fa 03-Feb-2010 Eric Christopher <echristo@apple.com> Recommit this, looks like it wasn't the cause.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95165 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
9f34dd305b7d9d54904a28774e93ac8d81b211fc 03-Feb-2010 Eric Christopher <echristo@apple.com> Hopefully temporarily revert this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95154 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a6a089cd244033109a232c99cb09ac424703afff 02-Feb-2010 Eric Christopher <echristo@apple.com> Re-add strcmp and known size object size checking optimization.

Passed bootstrap and nightly test run here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
11225dd710d5cea81be4a77e56290eff6ce71863 02-Feb-2010 Eric Christopher <echristo@apple.com> Don't need to check the last argument since it'll always be bool. We also
don't use TargetData here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
3a8bb736906877dd7f251fe39ee6720d3cab8b4a 02-Feb-2010 Eric Christopher <echristo@apple.com> More indentation/tabification fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
eae6ed108426c399684266d987efb9f01bf3deb0 02-Feb-2010 Eric Christopher <echristo@apple.com> Untabify previous commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95035 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
6ddf0430e1497e3bd02d9fe41dcab65954c3b177 02-Feb-2010 Eric Christopher <echristo@apple.com> Formatting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95027 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
36664bfc7a540f1b45e80c966e36b1aea9d29aa3 29-Jan-2010 Eric Christopher <echristo@apple.com> Revert my last couple of patches. They appear to have broken bison.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
407e47c21ea201292adf978e06d6b7c1dc62cda9 29-Jan-2010 Eric Christopher <echristo@apple.com> Make strcpy_chk lower to strcpy if we have a safe size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
7672d04f770c88b7b9152327a85936c01bab8035 23-Jan-2010 Eric Christopher <echristo@apple.com> Reapply 94059 while fixing the calling convention setup
for strcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
8a23e0b07ba7eef3fd158be43f758d859b115f93 22-Jan-2010 Bob Wilson <bob.wilson@apple.com> Revert 94059. It is breaking the MultiSource/Benchmarks/Prolangs-C/bison
test on ARM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ed1a4c7eabcc504c42ed4719aa84c3ce014c6189 21-Jan-2010 Eric Christopher <echristo@apple.com> Add strcpy_chk -> strcpy support for "don't know" object size
answers. This will update as object size checking gets better information.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94059 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
130063207de67ecb36e5c80b9118f3c0817fbc6f 06-Jan-2010 Eric Christopher <echristo@apple.com> Move the object size intrinsic optimization to inst-combine and make
it work for any integer size return type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92853 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0ecbdeb14f47b2391d138b7c3644e5f937ee0553 06-Jan-2010 Mikhail Glushenkov <foldr@codedgers.com> Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92831 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
8c65f6e71c1d46d823b9a884819992a9255edd54 05-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Move remaining stuff to the isInteger predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
6a6b90ebd9aec43744de3a426912c185e47a3e29 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ed5cb593efa6faaa8ed6dca36d5d200fb832496c 04-Jan-2010 Mikhail Glushenkov <foldr@codedgers.com> 80-col violations, trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
8047d9a6be9c6261c4d3f286786be856d619ed0f 24-Dec-2009 Chris Lattner <sabre@nondot.org> move an optimization for memcmp out of simplifylibcalls and into
SDISel. This optimization was causing simplifylibcalls to
introduce type-unsafe nastiness. This is the first step, I'll be
expanding the memcmp optimizations shortly, covering things that
we really really wouldn't want simplifylibcalls to do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
98d67d7d7e8156d78b8c7d82c15ff52ed92bcc86 24-Dec-2009 Chris Lattner <sabre@nondot.org> reorder to follow a normal fall-through style, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92084 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
d060b2576ab10d463e339186bcc61860500cbce0 23-Dec-2009 Eric Christopher <echristo@apple.com> Update objectsize intrinsic and associated dependencies. Fix
lowering code and update testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
f734be2ba4b185a212f7109730cb50fe5d3d3b49 22-Dec-2009 Eric Christopher <echristo@apple.com> Whitespace fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
24604110efc862423f7b2724e93a8793eefd44b2 16-Dec-2009 Chris Lattner <sabre@nondot.org> reapply my strstr optimization. I have reproduced the x86-64 bootstrap
miscompile (i386.o miscompares) but it happens both with and without
this patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0001517d9d247cf4f6802745810ca8d3c9e9f40b 16-Dec-2009 Chris Lattner <sabre@nondot.org> revert my strstr optimization, I'm told it breaks x86-64 bootstrap.

Will reapply with a fix when I get a chance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91486 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ad6b1fdaf94ed9cf44798ed6fd9ca9ed7455d1db 15-Dec-2009 Chris Lattner <sabre@nondot.org> optimize strstr, PR5783


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
099b41f3427579717681fcbe62ac3848c071ec21 15-Dec-2009 Chris Lattner <sabre@nondot.org> add some other xforms that should be done as part of PR5783


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91428 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
bf796323b25f7760f6559fdebb16bb372546c17d 02-Dec-2009 Chris Lattner <sabre@nondot.org> tidy up, remove dependence on order of evaluation of function args from EmitMemCpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
80bf1d52789d84d774f903a1991bd62639ff9464 21-Nov-2009 Eric Christopher <echristo@apple.com> Add more optimizations for object size checking, enable handling of
object size intrinsic and verify return type is correct. Collect various
code in one place.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
f7751c134a401575f2a2c036456e6377b2de833f 20-Nov-2009 Daniel Dunbar <daniel@zuster.org> Revert "Add some rough optimizations for checking routines.", it buildeth not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
3bcaa8ac95a72487cfeab4adbc076ddf89ad5673 20-Nov-2009 Eric Christopher <echristo@apple.com> Add some rough optimizations for checking routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89479 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
f63c41033a6608f57173297d44b161efc1c3851d 16-Nov-2009 Duncan Sands <baldrick@free.fr> CreateIntCast takes an "isSigned" parameter. Pass "true" for it, rather than
a name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88908 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
74965f2279af05246a0f9fe4ab50643fea9aa9b0 09-Nov-2009 Chris Lattner <sabre@nondot.org> fix PR5104: when printing a single character, return the result of
putchar in case there is an error.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86515 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
992a63729706355c2a6b8221709fc0aa100a1e79 05-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Teach SimplifyLibCalls to fold memcmp calls with constant arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
7b5e61707a128a222e5e7ab20eb8154ca81001cb 27-Oct-2009 Eric Christopher <echristo@apple.com> Add objectsize intrinsic and hook it up through codegen. Doesn't
do anything than return "I don't know" at the moment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85189 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
37c8b86d43e0600835aa83165e21c5947384da91 07-Oct-2009 Eric Christopher <echristo@apple.com> 80-column and whitespace fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83489 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ac53a0b272452013124bfc70480aea5e41b60f40 06-Oct-2009 Duncan Sands <baldrick@free.fr> Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type. For example, to get
an i8* use getInt8PtrTy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
cf0fe8d813727383d630055bb9d1cde21b00b7e7 05-Oct-2009 Chris Lattner <sabre@nondot.org> strength reduce a ton of type equality tests to check the typeid (Through
the new predicates I added) instead of going through a context and doing a
pointer comparison. Besides being cheaper, this allows a smart compiler
to turn the if sequence into a switch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
76926b6789e72eb4864dbfc1830b138486281c1d 26-Sep-2009 Dan Gohman <gohman@apple.com> Fix SimplifyLibCalls to transfer attributes from callees rather than
calls, since direct calls don't always reflect the attributes of their
callees.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a23643d5b7cb84a465f3535ee1a685c3612d5262 26-Sep-2009 Dan Gohman <gohman@apple.com> Rename ConstantFP's getInf to getInfinity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
79cb8401363fc666289bfef1e37d1faa1e94422d 26-Sep-2009 Dan Gohman <gohman@apple.com> Transform pow(x, 0.5) to (x == -inf ? inf : fabs(sqrt(x))), which is
typically faster then doing a general pow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
83d63919bd990ce00f62e18114504b9e4a5cb35e 19-Sep-2009 Victor Hernandez <vhernandez@apple.com> Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.

Reviewed by Dan Gohman.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82300 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e9f9a7e10ef6c159e6afb9f230ce216828d3282a 03-Sep-2009 Chris Lattner <sabre@nondot.org> In C++, code is not allowed to call main. In C it is, this
simplifylibcalls optimization is thus valid for C++ but not C.
It's not important enough to worry about for C++ apps, so just
remove it.

rdar://7191924



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
3e8b6631e67e01e4960a7ba4668a50c596607473 02-Sep-2009 Chris Lattner <sabre@nondot.org> eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
107f41fad5f8df734c72cf39a016a7ea0d874388 19-Aug-2009 Dan Gohman <gohman@apple.com> Fix SimplifyLibcalls and ValueTracking to check mayBeOverridden
before performing optimizations based on constant string values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
f14d919742eee0dd2bb0808bd5ed6e1da7d4a23f 18-Aug-2009 Dan Gohman <gohman@apple.com> Make TargetData optional in SimplifyLibCalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
1d0be15f89cb5056e20e2d24faa8d6afb1573bca 13-Aug-2009 Owen Anderson <resistor@mac.com> Push LLVMContexts through the IntegerType APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
a7235ea7245028a0723e8ab7fd011386b3900777 31-Jul-2009 Owen Anderson <resistor@mac.com> Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
debcb01b0f0a15f568ca69e8f288fade4bfc7297 30-Jul-2009 Owen Anderson <resistor@mac.com> Move types back to the 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
473955f439b44eed4c5230ad6f9d51bcb62a3b21 30-Jul-2009 Daniel Dunbar <daniel@zuster.org> Fix PR4645 which was fallout from the fix for PR4641.
- Call RAUW to delete all instructions (this is a patch from Nick Lewycky).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77512 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
baf3c404409d5e47b13984a7f95bfbd6d1f2e79e 29-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantExpr to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0efa921736fefde26003aca8d182ab7eb722394b 29-Jul-2009 Nick Lewycky <nicholas@mxc.ca> Bulk erasing instructions without RAUWing them is unsafe. Instead, break them
into a new BB that has no predecessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77433 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
1fd7096407d5e598ed3366a1141548e71273f1c5 28-Jul-2009 Owen Anderson <resistor@mac.com> Change ConstantArray to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
6f83c9c6ef0e7f79825a0a8f22941815e4b684c7 27-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantFP construction back to the 2.5-ish API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77247 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
f0443c1eb44d737d9bd78962932fc80f74c6113c 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove Value::getNameLen


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
93b67e40de356569493c285b86b138a3f11b5035 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Eliminate some uses of DOUT, cerr, and getNameStart().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
03d7651c3652e1f0cc86e79b26585d86818da9cf 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove Value::{isName, getNameRef}.

Also, change MDString to use a StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
eed707b1e6097aac2bb6b3d47271f6300ace7f2e 25-Jul-2009 Owen Anderson <resistor@mac.com> Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
6316fbcb04af00fe76b6526fab09f51484014b3e 23-Jul-2009 Daniel Dunbar <daniel@zuster.org> Convert StringMap to using StringRef for its APIs.
- Yay for '-'s and simplifications!

- I kept StringMap::GetOrCreateValue for compatibility purposes, this can
eventually go away. Likewise the StringMapEntry Create functions still follow
the old style.

- NIFC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e922c0201916e0b980ab3cfe91e1413e68d55647 22-Jul-2009 Owen Anderson <resistor@mac.com> Get rid of the Pass+Context magic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
62bb4134358d0d1f8b892cf0df42d758ac8e19e7 18-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Fix simplifylibcalls memset recognition to work on 64-bit platforms
where int is 32 bits.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76293 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
001dbfebcbbded8c8e74b19e838b50da2b6c6fb5 16-Jul-2009 Owen Anderson <resistor@mac.com> Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
73c6b7127aff4499e4d6a2edb219685aee178ee1 13-Jul-2009 Owen Anderson <resistor@mac.com> Move more functionality over to LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
d1fbd142945f5ef0c273c3d756431f8cb9d25ded 08-Jul-2009 Owen Anderson <resistor@mac.com> Push LLVMContext _back_ through IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75040 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e9b11b431308f4766b73cda93e38ec930c912122 08-Jul-2009 Owen Anderson <resistor@mac.com> Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
3d29df3e8a203b167d8071ea6f805b21db18a5af 08-Jul-2009 Owen Anderson <resistor@mac.com> Push LLVMContext through GlobalVariables and IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
fa5cbd6d0fbda23fd669c8718e07b19001b2d21a 03-Jul-2009 Owen Anderson <resistor@mac.com> Even more passes being LLVMContext'd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
849832c0fb47f4e111840e0031b9129d41ffb389 19-Jun-2009 Chris Lattner <sabre@nondot.org> part of PR4405: disable a contentious optimization for
strcmp -> memcmp when the lengths of the strings are unknown.

Patch by Nick Lewycky!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
9547cdfa35a466ef16a72306531465f63b212888 18-Jun-2009 Anton Korobeynikov <asl@math.spbu.ru> Revert IRBuilder CC propagation. Fix SimplifyLibCalls instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73715 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ae3a0be92e33bc716722aa600983fc1535acb122 05-Jun-2009 Dan Gohman <gohman@apple.com> Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0e98e4d299e76ab627d53c976f0f84b449106d15 30-May-2009 Chris Lattner <sabre@nondot.org> fix PR4284, a bug in simplifylibcalls handling memcmp. Patch by
Benjamin Kramer!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72625 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
bcc2e7dc2c4d10e5b5ecab2e1201653508a3b1ef 13-May-2009 Chris Lattner <sabre@nondot.org> Fix PR4206 - crash in simplify lib calls


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71644 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
5db4cdfc56f17959d3d0d3067af1b2346bcc0120 12-Apr-2009 Chris Lattner <sabre@nondot.org> "There was a typo in my previous patch which leads to miscompilation of
strncat :(

strncat(foo, "bar", 99)
would be optimized to
memcpy(foo+strlen(foo), "bar", 100, 1)
instead of
memcpy(foo+strlen(foo), "bar", 4, 1)"

Patch by Benjamin Kramer!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68905 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
f5b6bc7f0ec90bf5312b1e65777a54bba2da3c5d 12-Apr-2009 Chris Lattner <sabre@nondot.org> add some optimizations for strncpy/strncat and factor some
code. Patch by Benjamin Kramer!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
b5e0a96a8d05b29b14ec90ba3dca0c2bd015c534 06-Apr-2009 Ed Schouten <ed@80386.nl> Let the strcat optimizer return the pointer to the start of the buffer,
instead of the place where it started to perform the string copy.

- PR3661
- Patch by Benjamin Kramer!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68443 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0582ae99ba75a556d6ff63b254da327d32ba036f 13-Mar-2009 Bill Wendling <isanbard@gmail.com> Oops...I committed too much.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
c7a09ab3110b9462ad9646cb60c22c8527491ad9 13-Mar-2009 Bill Wendling <isanbard@gmail.com> Temporarily XFAIL this test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66866 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
225f7474863a11a7baded7d6505400ce3328331e 15-Feb-2009 Nick Lewycky <nicholas@mxc.ca> Update the list of function annotations for nocapture. All of these came up
when I was looking at functions used by python.

Highlights include, better largefile support (64-bit file sizes on 32-bit
systems), fputs string is nocapture, popen/pclose added (popen being noalias
return), modf and frexp and friends. Also added some missing 'break' statements
and combined identical sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
02b6a6a75f29f59a4ea267608c6d3f6b1ebbf0d5 13-Feb-2009 Nick Lewycky <nicholas@mxc.ca> Mark strto* as readonly when the endptr is null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
4c49841f34baa3d0114ab8391403bee8b1a136e8 13-Feb-2009 Nick Lewycky <nicholas@mxc.ca> On strtod and friends, mark 'endptr' nocapture in the function prototype, and
mark the first argument nocapture if endptr=NULL for each particular call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
b7c9eeeede975251fe40e7355d0ee2c64c6df864 12-Feb-2009 Nick Lewycky <nicholas@mxc.ca> Don't mark all args to strtod and friends as nocapture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64352 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0b6679d32ff86d8fec964110e5293798369c98e6 18-Jan-2009 Nick Lewycky <nicholas@mxc.ca> Fix copy and pasted typos that prevented strtok_r, realloc, getenv, ungetc,
putc, puts, perror, vscanf and vsscanf from getting annotations.

Add annotations for eight printf functions, memalign, pread and pwrite.

On Linux, llvm-gcc sometimes renames strdup, getc, putc, strtok_r, scanf and
sscanf. Match the alternate function names.

Fix a crash annotating opendir.

Don't mark fsetpos's second parameter as nocapture. It's supposed to be
captured.

Do mark fopen's path and mode strings as nocapture. Mark ferror as readonly,
but not fileno which may set errno.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62456 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
6cd0c048b88b96f90d0dd126995f014527c36a3d 05-Jan-2009 Nick Lewycky <nicholas@mxc.ca> Move the libcall annotating part from doFinalization to doInitialization.
Finalization occurs after all the FunctionPasses in the group have run, which
is clearly not what we want.

This also means that we have to make sure that we apply the right param
attributes when creating a new function.

Also, add a missed optimization: strdup and strndup. NoCapture and
NoAlias return!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61658 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0f8df9a9ceab274a94c794ac82733c79d0f13597 04-Jan-2009 Nick Lewycky <nicholas@mxc.ca> Run a post-pass that marks known function declarations by name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
13a09e298c37df0711aeb935e0653ae51313d19a 21-Dec-2008 Nick Lewycky <nicholas@mxc.ca> Turn strcmp into memcmp, such as strcmp(P, "x") --> memcmp(P, "x", 2).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
d83ae7d698248958e157aeeaca9fb114bf1e2b60 30-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Optimize memmove and memset into the LLVM builtins. Note that these
only show up in code from front-ends besides llvm-gcc, like clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
824b958e6fb1236e92e4d07f3acf18fca107cdc0 21-Nov-2008 Chris Lattner <sabre@nondot.org> reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
dc770929cb2f97397970e2942b746839fc387992 21-Nov-2008 Bill Wendling <isanbard@gmail.com> Revert r59802. It was breaking the build of llvm-gcc:

g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic'
make[3]: *** [llvm-convert.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59809 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
219ab405e6bea993da14cf3ce7b50983c3bb7a6f 21-Nov-2008 Sanjiv Gupta <sanjiv.gupta@microchip.com> Make mem[cpy,move,set] intrinsics overloaded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
53bfbbccbfbd610a6e7970200aef868469dd556c 04-Sep-2008 Dale Johannesen <dalej@apple.com> Add intrinsic forms of pow and exp2. The non-intrinsic
forms remain to handle older IR files, but will go away soon.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55781 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ae73dc1448d25b02cabc7c64c86c64371453dda8 04-Sep-2008 Dan Gohman <gohman@apple.com> Tidy up several unbeseeming casts from pointer to intptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
7a61d701c0870642e075e90b6a1ad03a8ac9bc67 08-Aug-2008 Eric Christopher <echristo@apple.com> Have IRBuilder take a template argument on whether or not to preserve
names. This can save a lot of allocations if you aren't going to be
looking at the output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
0ff39b3feb10477c224138156941234f5fa46f58 30-Jun-2008 Evan Cheng <evan.cheng@apple.com> - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
- Correctly handle memcpy from constant string which is zero-initialized.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
6d116bc7ced56a820d33b0dd35ee36af8a810eab 29-Jun-2008 Anton Korobeynikov <asl@math.spbu.ru> Revert (52748 and friends):

Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.

This unbreaks llvm-gcc bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
872a738775ea3a78136da9914a9bbbb56326cacc 26-Jun-2008 Eric Christopher <echristo@apple.com> Remove unused function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
077707ccc0a4e829d7406645307581325dc49bb9 16-Jun-2008 Chris Lattner <sabre@nondot.org> Fix the crash on SimplifyLibCalls/2005-05-20-sprintf-crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
313f0e63f7c751e2ef6b2dbc163f1b68d2bcc4c8 09-Jun-2008 Chris Lattner <sabre@nondot.org> lower calls to abs to inline code, PR2337


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52138 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ec00fcb33d43759e638e2ebdc8657e3183077664 19-May-2008 Duncan Sands <baldrick@free.fr> Fix PR2341 - when the length is 4 use an i32 not
an i16! Cleaned up trailing whitespace while there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51240 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
ac178222067d726dafa3bf2ed1ae42e5af81911e 05-May-2008 Bill Wendling <isanbard@gmail.com> Fix: Some classes were derived from a class in an anonymous namespace, but they
themselves weren't in the anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
e818f770bb4f6617612e5b61cc067aa7da9e1395 02-May-2008 Chris Lattner <sabre@nondot.org> strength reduce exp2 into ldexp, rdar://5852514


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50586 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
56b4f2bdf6072651d44d8e48a8dce14101e70b0b 01-May-2008 Chris Lattner <sabre@nondot.org> 1) add '-debug' output
2) Return NULL instead of false in several places for tidiness.
3) fix a bug optimizing sprintf(p, "%c", x)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50521 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp
fd1cbbe9cfeddab8ec99a9325c1e87311609c0a3 01-May-2008 Chris Lattner <sabre@nondot.org> Delete the IPO simplify-libcalls and completely reimplement it as
a FunctionPass. This makes it simpler, fixes dozens of bugs, adds
a couple of minor features, and shrinks is considerably: from
2214 to 1437 lines.


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