summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantFolding.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug that Chris asserts emphatically is a bug. The changed clauseReid Spencer2004-05-301-1/+1
| | | | | | | would always return false because the Type of a type value is always Type::TypeTY and can never be a floating point type. llvm-svn: 13902
* Add a missing break, which caused a crash in an obscure situationChris Lattner2004-04-111-0/+1
| | | | llvm-svn: 12825
* Support getelementptr instructions which use uint's to index into structureChris Lattner2004-04-051-4/+4
| | | | | | | types and can have arbitrary 32- and 64-bit integer types indexing into sequential types. llvm-svn: 12653
* Teach the constant folder how to do select instructionsChris Lattner2004-03-121-0/+11
| | | | llvm-svn: 12321
* Implement test/Regression/Assembler/2004-03-07-FunctionAddressAlignment.llxChris Lattner2004-03-081-0/+20
| | | | llvm-svn: 12218
* Get all instruction definitionsChris Lattner2004-02-221-3/+1
| | | | llvm-svn: 11706
* Move the folding of gep null, 0, 0, 0 to a place where it can be shared andChris Lattner2004-02-161-2/+15
| | | | | | enjoyed by all, fixing a fixme. Add an assert llvm-svn: 11505
* Fix a crasher bug in my constant folding rewriteChris Lattner2004-02-011-3/+10
| | | | llvm-svn: 11044
* Implement a bunch of symbolic constant folding opportunities. This implementsChris Lattner2004-01-131-21/+324
| | | | | | | | | | | | | | | testcase test/Regression/Assembler/ConstantExprFold.llx Note that these kinds of things only rarely show up in source code, but are exceedingly common in the intermediate stages of algorithms like SCCP. By folding things (especially relational operators) that use symbolic constants, we are able to speculatively fold more conditional branches, which can lead to some big simplifications. It would be easy to add a lot more special cases here, so if you notice SCCP missing anything "obvious", you know what to make smarter. :) llvm-svn: 10812
* Rearrange and comment code better. No functionality changesChris Lattner2004-01-121-160/+177
| | | | llvm-svn: 10808
* Rename ConstantHandling.* -> ConstantFolding.*Chris Lattner2004-01-121-0/+656
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. llvm-svn: 10807
OpenPOWER on IntegriCloud