summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantFolding.cpp
Commit message (Collapse)AuthorAgeFilesLines
* ConstantFolding.cpp/h -> ConstantFold.cpp/h to avoid confusion withChris Lattner2007-02-271-1388/+0
| | | | | | lib/Analysis/ConstantFolding. llvm-svn: 34653
* Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215Chris Lattner2007-02-241-1/+2
| | | | llvm-svn: 34548
* For PR1195:Reid Spencer2007-02-151-1/+1
| | | | | | | Change use of "packed" term to "vector" in comments, strings, variable names, etc. llvm-svn: 34300
* For PR1195:Reid Spencer2007-02-151-33/+33
| | | | | | | Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and PackedTyID -> VectorTyID. No functional changes. llvm-svn: 34293
* Fix Transforms/ConstProp/2007-02-05-BitCast.llChris Lattner2007-02-061-1/+5
| | | | llvm-svn: 33948
* Revise APIs for creating constantexpr GEPs to not require the use of vectors.Chris Lattner2007-01-311-16/+21
| | | | | | This allows us to eliminate many temporary vectors, and theirassociated malloc/free pairs. llvm-svn: 33692
* For PR1043:Reid Spencer2007-01-191-6/+1
| | | | | | | | | | | | | | This is the final patch for this PR. It implements some minor cleanup in the use of IntegerType, to wit: 1. Type::getIntegerTypeMask -> IntegerType::getBitMask 2. Type::Int*Ty changed to IntegerType* from Type* 3. ConstantInt::getType() returns IntegerType* now, not Type* This also fixes PR1120. Patch by Sheng Zhou. llvm-svn: 33370
* rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.Chris Lattner2007-01-151-7/+7
| | | | | | | | | 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
* Remove a bunch of duplicated code. Among other things, this fixesChris Lattner2007-01-121-93/+50
| | | | | | constant folding of signed comparisons of bool. llvm-svn: 33134
* For PR1064:Reid Spencer2007-01-121-16/+0
| | | | | | | | | | | | | | | | | | | | | | | 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
* Implement review feedback for the ConstantBool->ConstantInt merge. ChrisReid Spencer2007-01-121-49/+72
| | | | | | | | recommended that getBoolValue be replaced with getZExtValue and that get(bool) be replaced by get(const Type*, uint64_t). This implements those changes. llvm-svn: 33110
* Rename BoolTy as Int1Ty. Patch by Sheng Zhou.Reid Spencer2007-01-111-4/+4
| | | | llvm-svn: 33076
* For PR1043:Zhou Sheng2007-01-111-172/+168
| | | | | | | Merge ConstantIntegral and ConstantBool into ConstantInt. Remove ConstantIntegral and ConstantBool from LLVM. llvm-svn: 33073
* Implement better constant folding of unordered FCMP predicates.Reid Spencer2007-01-111-7/+27
| | | | llvm-svn: 33063
* fix typoChris Lattner2007-01-041-1/+1
| | | | llvm-svn: 32859
* fix some bugs handling vectors, avoid host-specific handling of undefined ↵Chris Lattner2007-01-041-5/+15
| | | | | | shift results. llvm-svn: 32857
* Fix a bug in comparison of GEP indices.Reid Spencer2006-12-311-4/+4
| | | | llvm-svn: 32798
* For PR950:Reid Spencer2006-12-311-20/+17
| | | | | | Change signed integer type names to unsigned equivalents. llvm-svn: 32780
* Cleanup ConstantFoldCompareInstruction:Reid Spencer2006-12-241-134/+201
| | | | | | | | | | 1. Make the arguments const like the other ConstantFold* functions. 2. Clean up evaluateFCmpRelation so it makes sense for floating point. 3. Implement the use of evaluateFCmpRelation to fold floating point CEs 4. Shorten a variable name so more things fit on one line. 5. Fix various comments. llvm-svn: 32759
* Don't overload var names.Reid Spencer2006-12-231-4/+4
| | | | llvm-svn: 32752
* For PR950:Reid Spencer2006-12-231-796/+581
| | | | | | | | 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
* Clean up ConstantFoldCastInstruction.Reid Spencer2006-12-191-53/+30
| | | | llvm-svn: 32672
* Rewrite ConstantFoldCastInstruction so that it doesn't use any of theReid Spencer2006-12-191-219/+50
| | | | | | | ConstRules. Remove the casting rules from ConstRules and subclasses. This cleans up ConstantFolding significantly. Passes all tests. llvm-svn: 32671
* Revert last patch. ConstantInt isn't quite ready for signlessness.Reid Spencer2006-12-181-2/+4
| | | | llvm-svn: 32650
* Remove the last use of getUnsignedVersion and getSignedVersion from VMCore.Reid Spencer2006-12-181-4/+2
| | | | | | | | ConstantInt doesn't care about the sign of the type it represents. It only cares about the bitwidth so there is no need to make the sign of the type match the SExt or ZExt constant expression. llvm-svn: 32646
* Replace inferred getCast(V,Ty) calls with more strict variants.Reid Spencer2006-12-121-5/+4
| | | | | | | Rename getZeroExtend and getSignExtend to getZExt and getSExt to match the the casting mnemonics in the rest of LLVM. llvm-svn: 32514
* Fix constant folding of FP->int due to cut & paste error in last commit.Reid Spencer2006-12-111-2/+3
| | | | llvm-svn: 32447
* Implement correct constant folding of bitcast. This implementsChris Lattner2006-12-111-15/+33
| | | | | | | Transforms/ConstProp/bitcast.ll and fixes SingleSource/Regression/C/2003-10-12-GlobalVarInitializers llvm-svn: 32438
* fix typoChris Lattner2006-12-111-1/+1
| | | | llvm-svn: 32428
* Fix constant folding to deal with external weak global values.Reid Spencer2006-12-061-14/+22
| | | | llvm-svn: 32247
* Can't make these fail now with just BitCast. Previous failures must haveReid Spencer2006-12-051-2/+2
| | | | | | | been in conjunction with something else. By right, they should just be BitCasts. llvm-svn: 32219
* Remove the last inferred casts from VMCore.Reid Spencer2006-12-051-10/+7
| | | | llvm-svn: 32213
* For PR950: Implement a stub for folding ICmp and FCmp instructionsReid Spencer2006-12-041-0/+7
| | | | llvm-svn: 32169
* Change inferred casts to explicit casts.Reid Spencer2006-12-041-12/+23
| | | | llvm-svn: 32165
* These should be rewritten to fold without using the 'Rules' mechanism, butChris Lattner2006-12-011-0/+3
| | | | | | | until this happens at least make sext from bool and sitofp from bool do the right thing. llvm-svn: 32087
* this logic is broken for trunc to bool, replace the folding logic for truncChris Lattner2006-12-011-5/+8
| | | | | | | completely, as it is trivial. We should probably do this for the rest of the cast operations. This fixes ConstProp/2006-12-01-TruncBoolBug.ll. llvm-svn: 32081
* Fix a typo introduced by the cast patch that horribly broke a lot of vectorChris Lattner2006-12-011-1/+1
| | | | | | code. Testcase here: Transforms/ConstProp/2006-11-30-vector-cast.ll llvm-svn: 32062
* Don't fold "ptrtoint GV to bool" since this should be doing a truncate notReid Spencer2006-12-011-7/+27
| | | | | | | a comparison against zero. Instead fold setne(GV,null) and seteq(GV,null) to ConstantBool::True or ConstantBool::False, respectively. llvm-svn: 32060
* Introducing external weak linkage. Darwin codegen should be added later.Anton Korobeynikov2006-12-011-5/+2
| | | | llvm-svn: 32052
* For PR950:Reid Spencer2006-11-271-104/+194
| | | | | | | | | | 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
* Remove redundant <cmath>.Jim Laskey2006-11-081-1/+0
| | | | llvm-svn: 31561
* For PR950:Reid Spencer2006-11-081-29/+33
| | | | | | | | This patch converts the old SHR instruction into two instructions, AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not dependent on the sign of their operands. llvm-svn: 31542
* Remove unused variables.Reid Spencer2006-11-021-6/+5
| | | | llvm-svn: 31375
* For PR950:Reid Spencer2006-11-021-34/+58
| | | | | | Replace the REM instruction with UREM, SREM and FREM. llvm-svn: 31369
* For PR950:Reid Spencer2006-10-261-26/+56
| | | | | | | | 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-139/+170
| | | | | | | | 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
* Fix another dtor issue. The function local statics in this function wereChris Lattner2006-10-131-32/+42
| | | | | | | being destroyed at inconvenient times. Switch to using non-local ManagedStatic objects, which actually also speeds up ConstRules::get. llvm-svn: 30931
* Eliminate ConstantBool::True and ConstantBool::False. Instead, ↵Chris Lattner2006-09-281-17/+15
| | | | | | provideConstantBool::getTrue() and ConstantBool::getFalse(). llvm-svn: 30664
* Add new SetCondInst::isRelational/isEquality methods. RenameChris Lattner2006-09-171-1/+1
| | | | | | Instruction::isRelational to Instruction::isComparison. llvm-svn: 30444
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29911
OpenPOWER on IntegriCloud