summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO
Commit message (Collapse)AuthorAgeFilesLines
* Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.llChris Lattner2005-09-271-1/+1
| | | | | | and PR632. llvm-svn: 23484
* Add support for external calls that we know how to constant fold. This ↵Chris Lattner2005-09-271-11/+20
| | | | | | | | implements ctor-list-opt.ll:CTOR8 llvm-svn: 23465
* Fix a bug where we would evaluate stores into linkonce objects which could beChris Lattner2005-09-271-1/+6
| | | | | | potentially replaced at link-time. llvm-svn: 23463
* Implement support for static constructors with calls in them. This is usefulChris Lattner2005-09-271-23/+54
| | | | | | | | because gccas runs globalopt before inlining. This implements ctor-list-opt.ll:CTOR7 llvm-svn: 23462
* Refactor this code a bit, no functionality changes.Chris Lattner2005-09-271-22/+40
| | | | llvm-svn: 23460
* Remove some dead code. ctor evaluation subsumes empty ctor elimChris Lattner2005-09-261-12/+0
| | | | llvm-svn: 23453
* Add support for alloca, implementing ctor-list-opt.ll:CTOR6Chris Lattner2005-09-261-17/+48
| | | | llvm-svn: 23452
* Add a debug printout, fix a crash on kc++Chris Lattner2005-09-261-1/+6
| | | | llvm-svn: 23450
* Implement loads/stores through GEP's of globals. This implementsChris Lattner2005-09-261-6/+98
| | | | | | ctor-list-opt.ll:CTOR5. llvm-svn: 23449
* Replace TraverseGEPInitializer with ConstantFoldLoadThroughGEPConstantExprChris Lattner2005-09-261-17/+5
| | | | llvm-svn: 23447
* add a commentChris Lattner2005-09-261-0/+3
| | | | llvm-svn: 23442
* Add support for getelementptr, load, and correctly reject volatile stores.Chris Lattner2005-09-261-0/+29
| | | | llvm-svn: 23441
* Add support for br/brcond/switch and phiChris Lattner2005-09-261-3/+47
| | | | llvm-svn: 23439
* Add a simple interpreter to this code, allowing us to statically evaluateChris Lattner2005-09-261-4/+110
| | | | | | global ctors that are simple enough. This implements ctor-list-opt.ll:CTOR2. llvm-svn: 23437
* factor some code into a InstallGlobalCtors method, add comments. No ↵Chris Lattner2005-09-261-35/+52
| | | | | | functionality change. llvm-svn: 23435
* Make the global opt optimizer work on modules with a null terminator, byChris Lattner2005-09-261-8/+13
| | | | | | accepting the null even with a non-65535 init prio llvm-svn: 23434
* Factor this code out into a few methods.Chris Lattner2005-09-261-33/+190
| | | | | | | | | | | | | Implement the start of global ctor optimization. It is currently smart enough to remove the global ctor for cases like this: struct foo { foo() {} } x; ... saving a bit of startup time for the program. llvm-svn: 23433
* Fix some logic I broke that caused a regression onChris Lattner2005-09-251-3/+5
| | | | | | SimplifyLibCalls/2005-05-20-sprintf-crash.ll llvm-svn: 23430
* Simplify this code a bit by relying on recursive simplification. SupportChris Lattner2005-09-241-51/+43
| | | | | | | | sprintf("%s", P)'s that have uses. s/hasNUses(0)/use_empty()/ llvm-svn: 23425
* Transform floor((double)FLT) -> (double)floorf(FLT), implementingChris Lattner2005-08-241-17/+55
| | | | | | | Regression/Transforms/SimplifyLibCalls/floor.ll. This triggers 19 times in 177.mesa. llvm-svn: 23017
* All stats are "Number of ..."Chris Lattner2005-08-071-1/+1
| | | | llvm-svn: 22694
* ConstantInt::get only works for arguments < 128.Chris Lattner2005-08-011-2/+6
| | | | | | | | | | SimplifyLibCalls probably has to be audited to make sure it does not make this mistake elsewhere. Also, if this code knows that the type will be unsigned, obviously one arm of this is dead. Reid, can you take a look into this further? llvm-svn: 22566
* Eliminate all remaining tabs and trailing spaces.Jeff Cohen2005-07-272-157/+157
| | | | llvm-svn: 22523
* Doh! Forgot to LLVMify the style.John Criswell2005-06-291-2/+0
| | | | llvm-svn: 22312
* Basic fix for PR#591; don't convert an fprintf() to an fwrite() if thereJohn Criswell2005-06-291-0/+9
| | | | | | | | | is a mismatch in their character type pointers (i.e. fprintf() prints an array of ubytes while fwrite() takes an array of sbytes). We can probably do better than this (such as casting the ubyte to an sbyte). llvm-svn: 22310
* add a debug typeChris Lattner2005-06-241-0/+1
| | | | llvm-svn: 22277
* Fix a problem with the strcmp optimization checking the wrong string andReid Spencer2005-06-181-13/+16
| | | | | | not casting to the correct type. llvm-svn: 22250
* Fix PR575, patch provided by John Mellor-Crummey. Thanks!Chris Lattner2005-06-151-0/+1
| | | | llvm-svn: 22223
* Do not promote globals only used by main to locals if there are constantexprsChris Lattner2005-06-151-3/+11
| | | | | | or other uses hanging off of them. llvm-svn: 22219
* Fix a problem on 64-bit targets where we passed (int)0 through ... instead ofChris Lattner2005-06-091-7/+7
| | | | | | (void*)0. llvm-svn: 22205
* Make the registration hash_map static. No other module needs it. Also,Reid Spencer2005-05-211-1/+5
| | | | | | document what its for a little better. llvm-svn: 22164
* Adjust the file comment to read a little easier.Reid Spencer2005-05-211-6/+7
| | | | llvm-svn: 22163
* Make sure ... arguments are casted to sbyte* where needed.Reid Spencer2005-05-211-13/+12
| | | | llvm-svn: 22162
* Add a "brief" comment for CastToCStrReid Spencer2005-05-211-0/+1
| | | | llvm-svn: 22161
* Fix mismatched type problem that crashed on cases like this:Chris Lattner2005-05-201-8/+17
| | | | | | | | sprintf(P, "%s", X); Where X is not an sbyte*. This fixes the bug JohnMC reported on llvm-bugs. llvm-svn: 22159
* teach the inliner about coldcc and noreturn functionsChris Lattner2005-05-181-0/+15
| | | | llvm-svn: 22113
* Don't look for __builtin_ffs, we'll never see it from llvm-gcc and there'sReid Spencer2005-05-151-14/+0
| | | | | | not reason to include it for other front ends. llvm-svn: 22070
* Provide this optimization as well:Reid Spencer2005-05-151-5/+45
| | | | | | ffs(x) -> (x == 0 ? 0 : 1+llvm.cttz(x)) llvm-svn: 22068
* Duh .. you actually have to #include Config/config.h before you can testReid Spencer2005-05-151-0/+1
| | | | | | for one of the values that it defines! llvm-svn: 22058
* Changes for ffs lib call simplification:Reid Spencer2005-05-141-3/+74
| | | | | | | | * Check for availability of ffsll call in configure script * Support ffs, ffsl, and ffsll conversion to constant value if the argument is constant. llvm-svn: 22027
* Preserve calling conventions when doing IPOChris Lattner2005-05-093-5/+13
| | | | llvm-svn: 21798
* Convert non-address taken functions with C calling conventions to fastcc.Chris Lattner2005-05-081-1/+41
| | | | llvm-svn: 21791
* * Add two strlen optimizations:Reid Spencer2005-05-071-23/+56
| | | | | | | | | | | | strlen(x) != 0 -> *x != 0 strlen(x) == 0 -> *x == 0 * Change nested statistics to use style of other LLVM statistics so that only the name of the optimization (simplify-libcalls) is used as the statistic name, and the description indicates which specific all is optimized. Cuts down on some redundancy and saves a few bytes of space. * Make note of stpcpy optimization that could be done. llvm-svn: 21766
* Don't increment the counter unless the debug flag is set.Reid Spencer2005-05-071-1/+1
| | | | llvm-svn: 21762
* preserve the tail markerChris Lattner2005-05-062-0/+4
| | | | llvm-svn: 21734
* Wrap long linesChris Lattner2005-05-061-6/+10
| | | | llvm-svn: 21720
* Fix a bug compimling Ruby, fixing this testcase:Chris Lattner2005-05-051-3/+11
| | | | | | LowerSetJmp/2005-05-05-OldUses.ll llvm-svn: 21696
* Implement the IsDigitOptimization for simplifying calls to the isdigitReid Spencer2005-05-041-6/+54
| | | | | | | | | | | | | library function: isdigit(chr) -> 0 or 1 if chr is constant isdigit(chr) -> chr - '0' <= 9 otherwise Although there are many calls to isdigit in llvm-test, most of them are compiled away by macros leaving only this: 2 MultiSource/Applications/hexxagon llvm-svn: 21688
* * Correct the function prototypes for some of the functions to match theReid Spencer2005-05-041-9/+172
| | | | | | | | | | | | | | | | | | | | | | actual spec (int -> uint) * Add the ability to get/cache the strlen function prototype. * Make sure generated values are appropriately named for debugging purposes * Add the SPrintFOptimiation for 4 casts of sprintf optimization: sprintf(str,cstr) -> llvm.memcpy(str,cstr) (if cstr has no %) sprintf(str,"") -> store sbyte 0, str sprintf(str,"%s",src) -> llvm.memcpy(str,src) (if src is constant) sprintf(str,"%c",chr) -> store chr, str ; store sbyte 0, str+1 The sprintf optimization didn't fire as much as I had hoped: 2 MultiSource/Applications/SPASS 5 MultiSource/Benchmarks/McCat/18-imp 22 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC 1 MultiSource/Benchmarks/Prolangs-C/assembler 6 MultiSource/Benchmarks/Prolangs-C/unix-smail 2 MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec llvm-svn: 21679
* Implement optimizations for the strchr and llvm.memset library calls.Reid Spencer2005-05-031-21/+232
| | | | | | | | | | | | | | | Neither of these activated as many times as was hoped: strchr: 9 MultiSource/Applications/siod 1 MultiSource/Applications/d 2 MultiSource/Prolangs-C/archie-client 1 External/SPEC/CINT2000/176.gcc/176.gcc llvm.memset: no hits llvm-svn: 21669
OpenPOWER on IntegriCloud