summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Delete the IPO simplify-libcalls and completely reimplement it asChris Lattner2008-05-011-2214/+0
| | | | | | | | 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. llvm-svn: 50520
* use string length computation to generalize several xforms.Chris Lattner2008-04-301-36/+39
| | | | llvm-svn: 50464
* Implement more aggressive support for analyzing string length. ThisChris Lattner2008-04-291-10/+136
| | | | | | | | | | generalizes the previous code to handle the case when the string is not an immediate to the strlen call (for example, crazy stuff like strlen(c ? "foo" : "bart"+1) -> 3). This implements gcc.c-torture/execute/builtins/strlen-2.c. I will generalize other cases in simplifylibcalls to use the same routine later. llvm-svn: 50408
* don't assume that the argument passed to fprintf("%s" is a string. This Chris Lattner2008-04-211-1/+1
| | | | | | fixes a crash in opt on 433.milc. llvm-svn: 50023
* Disable an xform we've had for a long time, pow(x,0.5) -> sqrt.Chris Lattner2008-04-101-0/+8
| | | | | | This is not safe for all inputs. llvm-svn: 49458
* Generalize getUnaryFloatFunction to handle any FP unary function, automaticallyChris Lattner2008-04-091-17/+33
| | | | | | figuring out the suffix to use. implement pow(2,x) -> exp2(x). llvm-svn: 49437
* use the new ConstantFP::get method to make this work withChris Lattner2008-04-091-11/+4
| | | | | | long double and simplify the code. llvm-svn: 49435
* many cleanups to the pow optimizer. Allow it to handle powf,Chris Lattner2008-04-091-34/+50
| | | | | | add support for pow(x, 2.0) -> x*x. llvm-svn: 49411
* Use Intrinsic::getDeclaration in more places.Duncan Sands2008-04-071-21/+7
| | | | llvm-svn: 49338
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-41/+41
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Check multiple return values.Devang Patel2008-03-121-1/+2
| | | | llvm-svn: 48267
* Get rid of hash_map. Use StringMap insteadAnton Korobeynikov2008-02-201-3/+3
| | | | llvm-svn: 47373
* Unbreak build with gcc 4.3: provide missed includes and silence most ↵Anton Korobeynikov2008-02-201-0/+1
| | | | | | annoying warnings. llvm-svn: 47367
* Use empty() instead of comparing size() with zero.Dan Gohman2008-01-291-1/+1
| | | | llvm-svn: 46514
* Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.Chris Lattner2008-01-281-0/+30
| | | | llvm-svn: 46433
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Change the PointerType api for creating pointer types. The old functionality ↵Christopher Lamb2007-12-171-26/+26
| | | | | | of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space. llvm-svn: 45082
* Fix off by 1 bug in printf->puts lowering.Dale Johannesen2007-10-241-1/+3
| | | | llvm-svn: 43309
* minor long double related changesDale Johannesen2007-09-281-4/+2
| | | | llvm-svn: 42439
* Next round of APFloat changes.Dale Johannesen2007-09-061-11/+16
| | | | | | | | | | | | | | Use APFloat in UpgradeParser and AsmParser. Change all references to ConstantFP to use the APFloat interface rather than double. Remove the ConstantFP double interfaces. Use APFloat functions for constant folding arithmetic and comparisons. (There are still way too many places APFloat is just a wrapper around host float/double, but we're getting there.) llvm-svn: 41747
* New CallInst interface to address GLIBCXX_DEBUG errors caused byDavid Greene2007-08-011-12/+20
| | | | | | | | indexing an empty std::vector. Updates to all clients. llvm-svn: 40660
* Fix typo in comment.Nick Lewycky2007-05-061-1/+1
| | | | llvm-svn: 36873
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+4
| | | | llvm-svn: 36632
* fix SimplifyLibCalls/IsDigit.llChris Lattner2007-04-151-1/+1
| | | | llvm-svn: 36047
* Implement a few missing xforms: printf("foo\n") -> puts. printf("x") -> putcharChris Lattner2007-04-141-9/+48
| | | | | | | | printf("") -> noop. Still need to do the xforms for fprintf. This implements Transforms/SimplifyLibCalls/Printf.ll llvm-svn: 35984
* Fix a typo that broke SimplifyLibCalls/SPrintF.ll (pr1315)Chris Lattner2007-04-081-1/+1
| | | | llvm-svn: 35768
* implement a fixme: move optimizations for fwrite out of fputs into a newChris Lattner2007-04-081-26/+56
| | | | | | fwrite optimizer. llvm-svn: 35758
* Significantly simplify the clients of GetConstantStringInfo, by having itChris Lattner2007-04-071-235/+154
| | | | | | just return the string itself. llvm-svn: 35755
* Fix problems in the sprintf optimizerChris Lattner2007-04-071-81/+60
| | | | llvm-svn: 35754
* Change CastToCStr to take a pointer instead of a reference.Chris Lattner2007-04-071-82/+76
| | | | | | Fix some miscompilations in fprintf optimizer. llvm-svn: 35753
* Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86Chris Lattner2007-04-071-1/+1
| | | | | | and Prolangs-C/cdecl llvm-svn: 35749
* fix a miscompilation in printf optimizer.Chris Lattner2007-04-071-38/+36
| | | | llvm-svn: 35713
* trunc to bool no longer compares against zeroChris Lattner2007-04-071-10/+5
| | | | llvm-svn: 35712
* cleanups for strlen optimizerChris Lattner2007-04-071-34/+21
| | | | llvm-svn: 35711
* Introduce a new ReplaceCallWith method, which simplifies a lot of code.Chris Lattner2007-04-071-186/+86
| | | | llvm-svn: 35710
* fixes for strcpy optimizerChris Lattner2007-04-071-53/+42
| | | | llvm-svn: 35709
* Fix bugs in strncmp.Chris Lattner2007-04-071-62/+52
| | | | llvm-svn: 35708
* fix 3 miscompilations and several compielr crashes in strcmp optimizer.Chris Lattner2007-04-071-44/+35
| | | | llvm-svn: 35707
* Fix several nasty bugs in the strchr optimizer, this fixesChris Lattner2007-04-061-48/+54
| | | | | | SimplifyLibCalls/2007-04-06-strchr-miscompile.ll and PR1307 llvm-svn: 35706
* clean up strcat optimizer, no functionality change.Chris Lattner2007-04-061-28/+21
| | | | llvm-svn: 35704
* rename getConstantStringLength -> GetConstantStringInfo. Make it returnChris Lattner2007-04-061-74/+83
| | | | | | the start index of the array as well as the length. No functionality change. llvm-svn: 35703
* Prefer non-virtual calls to ConstantInt::isZero over virtual calls toReid Spencer2007-03-021-3/+3
| | | | | | Constant::isNullValue() in situations where it is possible. llvm-svn: 34821
* eliminate a bunch of vector-related heap trafficChris Lattner2007-02-131-47/+53
| | | | llvm-svn: 34222
* Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes inReid Spencer2007-02-051-32/+35
| | | | | | | the Transforms library. This reduces debug library size by 132 KB, debug binary size by 376 KB, and reduces link time for llvm tools slightly. llvm-svn: 33939
* eliminate temporary vectorsChris Lattner2007-01-311-6/+3
| | | | llvm-svn: 33712
* For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoidReid Spencer2007-01-301-1/+1
| | | | | | confusion with external linkage types. llvm-svn: 33663
* Correct a comment.Owen Anderson2007-01-201-1/+1
| | | | llvm-svn: 33397
* rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.Chris Lattner2007-01-151-5/+5
| | | | | | | | | rename Type::getIntegralTypeMask to Type::getIntegerTypeMask. This makes naming much more consistent. For example, there are now no longer any instances of IntegerType that are not considered isInteger! :) llvm-svn: 33225
OpenPOWER on IntegriCloud