summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate calls to isInteger, generalizing code and tightening checks as needed.Chris Lattner2007-01-151-5/+5
| | | | llvm-svn: 33218
* Remove over-general comparisonsChris Lattner2007-01-121-4/+6
| | | | llvm-svn: 33147
* For PR1064:Reid Spencer2007-01-121-7/+11
| | | | | | | | | | | | | | | | | | | | | | | Implement the arbitrary bit-width integer feature. The feature allows integers of any bitwidth (up to 64) to be defined instead of just 1, 8, 16, 32, and 64 bit integers. This change does several things: 1. Introduces a new Derived Type, IntegerType, to represent the number of bits in an integer. The Type classes SubclassData field is used to store the number of bits. This allows 2^23 bits in an integer type. 2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and 64-bit integers. These are replaced with just IntegerType which is not a primitive any more. 3. Adjust the rest of LLVM to account for this change. Note that while this incremental change lays the foundation for arbitrary bit-width integers, LLVM has not yet been converted to actually deal with them in any significant way. Most optimization passes, for example, will still only deal with the byte-width integer types. Future increments will rectify this situation. llvm-svn: 33113
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-1/+1
| | | | llvm-svn: 33076
* Types should be const.Reid Spencer2007-01-071-2/+2
| | | | llvm-svn: 33001
* Change the interface to Module::getOrInsertFunction to be easier to use,to ↵Chris Lattner2007-01-071-81/+49
| | | | | | | | resolve PR1088, and to help PR411. This simplifies many clients also llvm-svn: 32989
* For PR950:Reid Spencer2006-12-311-96/+95
| | | | | | | | | | | | | This patch replaces signed integer types with signless ones: 1. [US]Byte -> Int8 2. [U]Short -> Int16 3. [U]Int -> Int32 4. [U]Long -> Int64. 5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion and other methods related to signedness. In a few places this warranted identifying the signedness information from other sources. llvm-svn: 32785
* For PR950:Reid Spencer2006-12-231-21/+19
| | | | | | | | This patch removes the SetCC instructions and replaces them with the ICmp and FCmp instructions. The SetCondInst instruction has been removed and been replaced with ICmpInst and FCmpInst. llvm-svn: 32751
* Get rid of a useless if statement whose then and else blocks were identical.Reid Spencer2006-12-211-4/+1
| | | | llvm-svn: 32729
* switch statistics over to not use static ctors.Chris Lattner2006-12-191-3/+3
| | | | llvm-svn: 32709
* Eliminate static ctors due to Statistic objectsChris Lattner2006-12-191-8/+6
| | | | llvm-svn: 32693
* Fix some casts. isdigit(c) returns 0 or 1, not 0 or -1Reid Spencer2006-12-131-3/+3
| | | | llvm-svn: 32534
* Replace CastInst::createInferredCast calls with more accurate castReid Spencer2006-12-131-26/+29
| | | | | | creation calls. llvm-svn: 32521
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-061-2/+2
| | | | | | is 'unsigned'. llvm-svn: 32279
* For PR950:Reid Spencer2006-11-271-37/+50
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* For PR786:Reid Spencer2006-11-021-2/+2
| | | | | | | | | | Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting fall out by removing unused variables. Remaining warnings have to do with unused functions (I didn't want to delete code without review) and unused variables in generated code. Maintainers should clean up the remaining issues when they see them. All changes pass DejaGnu tests and Olden. llvm-svn: 31380
* For PR950:Reid Spencer2006-10-261-1/+1
| | | | | | | | Make necessary changes to support DIV -> [SUF]Div. This changes llvm to have three division instructions: signed, unsigned, floating point. The bytecode and assembler are bacwards compatible, however. llvm-svn: 31195
* For PR950:Reid Spencer2006-10-201-69/+69
| | | | | | | | This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. llvm-svn: 31063
* Adding dllimport, dllexport and external weak linkage types.Anton Korobeynikov2006-09-141-2/+4
| | | | | | | | | DLL* linkages got full (I hope) codegeneration support in C & both x86 assembler backends. External weak linkage added for future use, we don't provide any codegeneration, etc. support for it. llvm-svn: 30374
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-271-2/+2
| | | | llvm-svn: 29925
* Add missing casts. This fixed some regressions.Evan Cheng2006-06-161-2/+2
| | | | llvm-svn: 28834
* More libcall transformations:Evan Cheng2006-06-161-8/+110
| | | | | | | | printf("%s\n", str) -> puts(str) printf("%c", c) -> putchar(c) Also fixed fprintf(file, "%c", c) -> fputc(c, file) llvm-svn: 28815
* Simplify fprintf(file, "%s", str) to fputs(str, file).Evan Cheng2006-06-161-16/+36
| | | | llvm-svn: 28814
* Remove some dead variables.Chris Lattner2006-05-121-6/+2
| | | | | | Fix a nasty bug in the memcmp optimizer where we used the wrong variable! llvm-svn: 28269
* Make this work with renamed intrinsics.Chris Lattner2006-03-031-26/+25
| | | | llvm-svn: 26482
* fix a bunch of alpha regressions. see bug 709Andrew Lenharth2006-02-151-6/+6
| | | | llvm-svn: 26218
* add a bunch more optimizations for unary double math functionsChris Lattner2006-01-231-18/+78
| | | | llvm-svn: 25530
* Refactor/genericize this, no functionality changeChris Lattner2006-01-231-16/+30
| | | | llvm-svn: 25525
* Make this more efficient in the following ways:Chris Lattner2006-01-221-22/+37
| | | | | | | | | 1. Do not statically construct a map when the program starts up, this is expensive and cannot be optimized. Instead, create a list. 2. Do not insert entries for all function in the module into a hashmap that lives the full life of the compiler. llvm-svn: 25512
* Several non-functionality changing changes:Chris Lattner2006-01-221-311/+151
| | | | | | | | | 1. Use the varargs version of getOrInsertFunction to simplify code. 2. remove #include 3. Reduce the number of #ifdef's. 4. remove extraneous vertical whitespace. llvm-svn: 25508
* For PR696:Reid Spencer2006-01-191-0/+9
| | | | | | | | Don't do floor->floorf conversion if floorf is not available. This checks the compiler's host, not its target, which is incorrect for cross-compilers Not sure that's important as we don't build many cross-compilers. llvm-svn: 25456
* Clean up the FFS optimization code, and make it correctly create the appropriateChris Lattner2006-01-171-41/+43
| | | | | | | unsigned llvm.cttz.* intrinsic, fixing the 2005-05-11-Popcount-ffs-fls regression last night. llvm-svn: 25398
* When a function takes a variable number of pointer arguments, with a zeroJeff Cohen2005-10-231-2/+3
| | | | | | | | | | | | | pointer marking the end of the list, the zero *must* be cast to the pointer type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will not extend the zero to 64 bits, thus allowing the upper 32 bits to be random junk. The new END_WITH_NULL macro may be used to annotate a such a function so that GCC (version 4 or newer) will detect the use of un-casted zero at compile time. llvm-svn: 23888
* Fold isascii into a simple comparison. This speeds up 197.parser by 7.4%,Chris Lattner2005-09-291-0/+26
| | | | | | bringing the LLC time down to the CBE time. llvm-svn: 23521
* remove a bunch of unneeded stuff, or self evident commentsChris Lattner2005-09-291-45/+6
| | | | llvm-svn: 23519
* Implement a couple of memcmp folds from the todo listChris Lattner2005-09-291-3/+121
| | | | llvm-svn: 23517
* 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-271-152/+152
| | | | 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
* 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
* 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
OpenPOWER on IntegriCloud