summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* teach SCEV analysis of PHI nodes that PHI recurences formedChris Lattner2011-01-091-0/+5
| | | | | | | with GEP instructions are always NUW, because PHIs cannot wrap the end of the address space. llvm-svn: 123105
* reduce indentation. Print <nuw> and <nsw> when dumping SCEV AddRec'sChris Lattner2011-01-091-49/+54
| | | | | | that have the bit set. llvm-svn: 123104
* PR5207: Change APInt methods trunc(), sext(), zext(), sextOrTrunc() andJay Foad2010-12-071-2/+2
| | | | | | | | zextOrTrunc(), and APSInt methods extend(), extOrTrunc() and new method trunc(), to be const and to return a new value instead of modifying the object in place. llvm-svn: 121120
* PR5207: Rename overloaded APInt methods set(), clear(), flip() toJay Foad2010-12-011-1/+1
| | | | | | setAllBits(), setBit(unsigned), etc. llvm-svn: 120564
* Simplify code. No change in functionality.Benjamin Kramer2010-11-201-2/+2
| | | | llvm-svn: 119908
* Silence warning about an uninitialized variable.Benjamin Kramer2010-11-191-1/+1
| | | | llvm-svn: 119800
* Factor code for testing whether replacing one value with anotherDuncan Sands2010-11-181-17/+2
| | | | | | | | preserves LCSSA form out of ScalarEvolution and into the LoopInfo class. Use it to check that SimplifyInstruction simplifications are not breaking LCSSA form. Fixes PR8622. llvm-svn: 119727
* Introduce memoization for ScalarEvolution dominates and properlyDominatesDan Gohman2010-11-181-58/+56
| | | | | | queries, and SCEVExpander getRelevantLoop queries. llvm-svn: 119595
* Factor out the code for purging a SCEV from all the various memoization maps.Dan Gohman2010-11-171-26/+13
| | | | | | | Some of these maps may merge in the future, but for now it's convenient to have a utility function for them. llvm-svn: 119587
* Merge the implementations of isLoopInvariant and hasComputableLoopEvolution, andDan Gohman2010-11-171-71/+58
| | | | | | | memoize the results. This improves compile time in code which highly complex expressions which get queried many times. llvm-svn: 119584
* Make SCEV::getType() and SCEV::print non-virtual. Move SCEV::hasOperandDan Gohman2010-11-171-105/+167
| | | | | | to ScalarEvolution. Delete SCEV::~SCEV. SCEV is no longer virtual. llvm-svn: 119578
* Move SCEV::dominates and properlyDominates to ScalarEvolution.Dan Gohman2010-11-171-58/+91
| | | | llvm-svn: 119570
* Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be memberDan Gohman2010-11-171-81/+135
| | | | | | | functions of ScalarEvolution, in preparation for memoization and other optimizations. llvm-svn: 119562
* Before replacing a phi node with a different value, itDuncan Sands2010-11-171-11/+15
| | | | | | | | | | needs to be checked that this won't break LCSSA form. Change the existing checking method to a more direct one: rather than seeing if all predecessors belong to the loop, check that the replacing value is either not in any loop or is in a loop that contains the phi node. llvm-svn: 119556
* Verify SCEVAddRecExpr's invariant in ScalarEvolution::getAddRecExprDan Gohman2010-11-171-0/+3
| | | | | | | instead of in SCEVAddRecExpr's constructor, in preparation for an upcoming change. llvm-svn: 119554
* Fix ScalarEvolution's range memoization to avoid using aDan Gohman2010-11-171-44/+43
| | | | | | default ctor with ConstantRange. llvm-svn: 119550
* Have ScalarEvolution use SimplifyInstruction rather than hasConstantValue.Duncan Sands2010-11-171-1/+5
| | | | | | While there, add a note about an inefficiency I noticed. llvm-svn: 119458
* Memoize results from ScalarEvolution's getUnsignedRange and getSignedRange.Dan Gohman2010-11-171-43/+80
| | | | | | This fixes some extreme compile times on unrolled sha512 code. llvm-svn: 119455
* Make ScalarEvolution::forgetLoop forget all contained loops too, becauseDan Gohman2010-10-291-0/+5
| | | | | | | they may have ValuesAtScopes map entries referencing their outer loops. This fixes a user-after-free reported in PR8471. llvm-svn: 117698
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-0/+1
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Begin adding static dependence information to passes, which will allow us toOwen Anderson2010-10-121-1/+5
| | | | | | | | | perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* Don't add the operand count to SCEV uniquing data; FoldingSetNodeIDDan Gohman2010-10-041-5/+0
| | | | | | already knows its own length, so this is redundant. llvm-svn: 115521
* Reapply r112432, now that the real problem is addressed.Dan Gohman2010-08-311-4/+9
| | | | llvm-svn: 112667
* Reapply r112433, now that the real problem is addressed.Dan Gohman2010-08-311-21/+24
| | | | llvm-svn: 112666
* Revert r110916. This patch is buggy because the code inside theDan Gohman2010-08-311-7/+4
| | | | | | inner loop doesn't update all the variables in the outer loop. llvm-svn: 112665
* Revert r112432. It appears to be exposing a problem in the emacs build.Dan Gohman2010-08-311-9/+4
| | | | llvm-svn: 112638
* Speculatively revert r112433.Dan Gohman2010-08-311-24/+21
| | | | llvm-svn: 112608
* Restructure the {A,+,B}<L> * {C,+,D}<L> folding so that it foldsDan Gohman2010-08-291-21/+24
| | | | | | | all applicable addrecs before recursing on getMulExpr, instead of recursing on getMulExpr for each one. llvm-svn: 112433
* Batch up subtracts along with adds, when analyzing long chains ofDan Gohman2010-08-291-4/+9
| | | | | | operations. llvm-svn: 112432
* Micro-optimize GroupByComplexity.Dan Gohman2010-08-291-2/+3
| | | | llvm-svn: 112431
* Hold AddRec->getLoop() in a variable, to make the Mul code more consistentDan Gohman2010-08-291-3/+4
| | | | | | with the Add code. llvm-svn: 112430
* Rename a variable, for consistency.Dan Gohman2010-08-291-5/+8
| | | | llvm-svn: 112429
* Use iterators instead of indices.Dan Gohman2010-08-291-2/+2
| | | | llvm-svn: 112428
* Fix an index calculation thinko.Dan Gohman2010-08-281-1/+1
| | | | llvm-svn: 112337
* When merging adjacent operands, scan ahead and merge all equalDan Gohman2010-08-271-11/+14
| | | | | | adjacent operands at once, instead of just two at a time. llvm-svn: 112299
* Make the {A,+,B}<L> + {C,+,D}<L> --> Other + {A+C,+,B+D}<L>Dan Gohman2010-08-271-23/+21
| | | | | | | | transformation collect all the addrecs with the same loop add combine them at once rather than starting everything over at the first chance. llvm-svn: 112290
* Switch ScalarEvolution's main Value*->SCEV* map from std::mapDan Gohman2010-08-271-28/+26
| | | | | | to DenseMap. llvm-svn: 112281
* Optimize SCEVComplexityCompare. Use a 3-way return instead of a 2-wayDan Gohman2010-08-271-48/+82
| | | | | | | return to avoid needing two calls to test for equivalence, and sort addrecs by their degree before examining their operands. llvm-svn: 112267
* To create a copy of a SmallVector with an element removed from theDan Gohman2010-08-161-6/+7
| | | | | | | | | middle, copy the elements in two groups, rather than copying all the elements and then doing an erase on the middle of the result. These are SmallVectors, so we shouldn't expect to hit dynamic allocation in the common case. llvm-svn: 111151
* Tidy whitespace.Dan Gohman2010-08-161-5/+4
| | | | llvm-svn: 111147
* Add a comment.Dan Gohman2010-08-161-0/+5
| | | | llvm-svn: 111145
* Use const_iterator in a few places.Dan Gohman2010-08-161-3/+3
| | | | llvm-svn: 111144
* Use iterators instead of indices in a few more places.Dan Gohman2010-08-161-6/+9
| | | | llvm-svn: 111143
* Micro-optimize SCEVConstant comparison.Dan Gohman2010-08-161-4/+4
| | | | llvm-svn: 111142
* Move SCEVNAryExpr's virtual member functions out of line, and convertDan Gohman2010-08-161-0/+33
| | | | | | them to iterators. llvm-svn: 111140
* Use iterators instead of indices in simple cases.Dan Gohman2010-08-161-6/+4
| | | | llvm-svn: 111138
* Avoid gratuitous inefficiency in ifndef NDEBUG code.Dan Gohman2010-08-161-8/+8
| | | | llvm-svn: 111137
* Make one getAddExpr call when analyzing a+b+c+d+e+... instead of oneDan Gohman2010-08-161-6/+31
| | | | | | for each add instruction. Ditto for Mul. llvm-svn: 111136
* Delete an unused function.Dan Gohman2010-08-161-35/+0
| | | | llvm-svn: 111135
OpenPOWER on IntegriCloud