aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/ConstantFold.h
Commit message (Collapse)AuthorAgeFilesLines
* Add shufflevector support, todo, implement better constant folding.Chris Lattner2006-04-081-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27510 91177308-0d34-0410-b5e6-96231b3b80d8
* VMCore support for the insertelement operation.Robert Bocchino2006-01-171-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25408 91177308-0d34-0410-b5e6-96231b3b80d8
* Added constant folding support for the extractelement operation.Robert Bocchino2006-01-101-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25187 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-211-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert 'struct' to 'class' in various places to adhere to the coding standardsChris Lattner2004-10-271-1/+1
| | | | | | | and work better with VC++. Patch contributed by Morten Ofstad! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17281 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow creation of GEP constantexprs with a vector of value* operands asChris Lattner2004-10-111-1/+2
| | | | | | | | well as a vector of constant*'s. It turns out that this is more efficient and all of the clients want to do that, so we should cater to them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16923 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a link error using VS8.0Chris Lattner2004-06-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14071 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new functionChris Lattner2004-03-121-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12322 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ConstantHandling.* -> ConstantFolding.*Chris Lattner2004-01-121-62/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Move a bunch of (now) private stuff from ConstantFolding.h into ConstantFolding.cpp. This _finally_ gets us to a place where we have a sane constant folder. The rules are: 1. LLVM clients now use ConstantExpr::get* methods to fold constants. If they cannot be folded, a constantexpr is created, so these methods always return valid Constant*'s. 2. The implementation of ConstantExpr::get* uses the functions exposed by ConstantFolding.h to try to fold constants. If they cannot be folded, they should return a null pointer. 3. The implementation of ConstantFolding can do whatever it wants, and only has one client (Constants.cpp) This cuts down on the wierd dependencies, and eliminates the two interfaces. The old constanthandling interface was especially bad for clients to use because almost none of them took the failure condition into consideration, thus leading to obscure problems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10807 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a whole bunch more ugliness. This is actually getting to the point ofChris Lattner2004-01-121-40/+20
| | | | | | | | this whole refactoring: allow constant folding methods to return something other than predefined classes, allow them to return generic Constant*'s. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10806 91177308-0d34-0410-b5e6-96231b3b80d8
* Move ConstantHandling.h into lib/VMCore and out of include/llvmChris Lattner2004-01-121-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10805 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate a lot of out-of-date comments, and all of the wierd overloadedChris Lattner2004-01-121-136/+1
| | | | | | | operator constant folding stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10803 91177308-0d34-0410-b5e6-96231b3b80d8
* Move prototype of llvm::ConstantFoldInstructionChris Lattner2004-01-121-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10786 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement == and != correctly. Before they would incorrectly return !=Chris Lattner2003-11-171-13/+12
| | | | | | | for some constant exprs when they could really be the same value git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10058 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant folding shalt not be built on annotationsChris Lattner2003-11-171-29/+18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10052 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixes for PR114: Thanks to Reid Spencer!Chris Lattner2003-11-161-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10029 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelloChris Lattner2003-11-041-1/+5
| | | | | | | Add negate overload git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9709 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM copyright header (for lack of a better term).John Criswell2003-10-201-0/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9304 91177308-0d34-0410-b5e6-96231b3b80d8
* Standardize header file commentsChris Lattner2003-09-301-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8782 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for ~ operator on constantsChris Lattner2003-07-231-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7258 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a ton of extraneous #includesChris Lattner2003-06-221-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6842 91177308-0d34-0410-b5e6-96231b3b80d8
* Included assert.h so that the code compiles under newer versions of GCC.John Criswell2003-06-111-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6682 91177308-0d34-0410-b5e6-96231b3b80d8
* *** Huge: Make constantexprs be handled correctly, conservativelyChris Lattner2003-04-251-15/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5923 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't force a ConstantPointer to be returnedChris Lattner2003-04-171-8/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5799 91177308-0d34-0410-b5e6-96231b3b80d8
* - Renamed Type::isIntegral() to Type::isInteger()Chris Lattner2002-09-031-2/+2
| | | | | | | | | - Added new method Type::isIntegral() that is the same as isInteger, but also accepts bool. SCVS: ---------------------------------------------------------------------- git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3572 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove constant propogation support for NOT instructionChris Lattner2002-08-141-9/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3321 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement constant propogation of logical (and, or, xor) expressions.Chris Lattner2002-07-301-1/+21
| | | | | | | Fixes testcase: test/Regression/Transforms/ConstProp/logicaltest.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3153 91177308-0d34-0410-b5e6-96231b3b80d8
* Move a bunch of code to a .cpp file, don't #include Instruction.hChris Lattner2002-05-061-43/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2499 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement constant propogation of shift instructionsChris Lattner2002-05-061-0/+22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2471 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement remainderChris Lattner2002-05-031-11/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2463 91177308-0d34-0410-b5e6-96231b3b80d8
* Split ConstantVals.h into Constant.h and Constants.hChris Lattner2002-04-281-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor change to reflect that ConstantHandling is now part of VMCoreChris Lattner2002-04-081-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2163 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement constant propogation of multiply and divide instructions!!Chris Lattner2002-04-071-0/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2134 91177308-0d34-0410-b5e6-96231b3b80d8
* Pull stuff out of opt namespaceChris Lattner2002-01-211-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1511 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ConstPoolVal -> ConstantChris Lattner2001-12-031-53/+53
| | | | | | | | Rename ConstPool* -> Constant* Rename ConstPoolVals.h -> ConstantVals.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more const correctChris Lattner2001-11-261-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1332 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement constant propogation of null pointer values.Chris Lattner2001-11-011-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1078 91177308-0d34-0410-b5e6-96231b3b80d8
* Implemented constant propogation of cast instructionsChris Lattner2001-10-311-0/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1064 91177308-0d34-0410-b5e6-96231b3b80d8
* not is a keyword in Ansi C++. Avoid itChris Lattner2001-10-131-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@748 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert ConstRules to use annotations to clean it up.Chris Lattner2001-09-091-6/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@514 91177308-0d34-0410-b5e6-96231b3b80d8
* You no longer have to delete constants! They are located in a globalChris Lattner2001-09-071-19/+11
| | | | | | | | | constant pool instead of in local ones. Change bool handling to prevent modification of bool values git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@436 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for casting operatorsChris Lattner2001-07-211-0/+30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243 91177308-0d34-0410-b5e6-96231b3b80d8
* Add multiply as a supported constant propogation operationChris Lattner2001-07-201-0/+7
| | | | | | | Include the LevelChange.h header in AllOpts.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211 91177308-0d34-0410-b5e6-96231b3b80d8
* Neg instruction removed. Cast instruction implemented.Chris Lattner2001-07-081-6/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156 91177308-0d34-0410-b5e6-96231b3b80d8
* Split AllOpts.h into lots of little .h files.Chris Lattner2001-06-301-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108 91177308-0d34-0410-b5e6-96231b3b80d8
* Add instructions to fold unary and binary instructions.Chris Lattner2001-06-271-0/+32
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial revisionChris Lattner2001-06-061-0/+145
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2 91177308-0d34-0410-b5e6-96231b3b80d8