summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert 96626, which causes build failure on ppc Darwin.Dale Johannesen2010-02-191-29/+0
| | | | llvm-svn: 96653
* Indvars needs to explicitly notify ScalarEvolution when it is replacingDan Gohman2010-02-181-0/+29
| | | | | | | | a loop exit value, so that if a loop gets deleted, ScalarEvolution isn't stick holding on to dangling SCEVAddRecExprs for that loop. This fixes PR6339. llvm-svn: 96626
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-24/+24
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-24/+24
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* When testing whether a given SCEV depends on a temporary symbolicDan Gohman2010-02-151-1/+1
| | | | | | | | name, test whether the SCEV itself is that temporary symbolic name, in addition to checking whether the symbolic name appears as a possibly-indirect operand. llvm-svn: 96216
* Override dominates and properlyDominates for SCEVAddRecExpr, as aDan Gohman2010-02-131-0/+15
| | | | | | | SCEVAddRecExpr doesn't necessarily dominate blocks merely dominated by all of its operands. This fixes an abort compiling 403.gcc. llvm-svn: 96056
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | llvm-svn: 95781
* Change the argument to getIntegerSCEV to be an int64_t, ratherDan Gohman2010-02-041-1/+1
| | | | | | | than int. This will make it more convenient for LSR, which does a lot of things with int64_t offsets. llvm-svn: 95281
* Various code simplifications.Dan Gohman2010-02-021-31/+28
| | | | llvm-svn: 95044
* Generalize target-independent folding rules for sizeof to handle moreDan Gohman2010-02-011-37/+57
| | | | | | | | | | | | | | | | | | | cases, and implement target-independent folding rules for alignof and offsetof. Also, reassociate reassociative operators when it leads to more folding. Generalize ScalarEvolution's isOffsetOf to recognize offsetof on arrays. Rename getAllocSizeExpr to getSizeOfExpr, and getFieldOffsetExpr to getOffsetOfExpr, for consistency with analagous ConstantExpr routines. Make the target-dependent folder promote GEP array indices to pointer-sized integers, to make implicit casting explicit and exposed to subsequent folding. And add a bunch of testcases for this new functionality, and a bunch of related existing functionality. llvm-svn: 94987
* Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their placeDan Gohman2010-01-281-88/+91
| | | | | | | | | | | | | | | | use plain SCEVUnknowns with ConstantExpr::getSizeOf and ConstantExpr::getOffsetOf constants. This eliminates a bunch of special-case code. Also add code for pattern-matching these expressions, for clients that want to recognize them. Move ScalarEvolution's logic for expanding array and vector sizeof expressions into an element count times the element size, to expose the multiplication to subsequent folding, into the regular constant folder. llvm-svn: 94737
* Make the unsigned-range code more consistent with the signed-range code,Dan Gohman2010-01-261-25/+29
| | | | | | and clean up some loose ends. llvm-svn: 94572
* Fix a typo in a comment that Duncan noticed.Dan Gohman2010-01-261-1/+1
| | | | llvm-svn: 94562
* Rename ItCount to BECount, since it holds a backedge-taken count ratherDan Gohman2010-01-261-9/+9
| | | | | | than an iteration count. llvm-svn: 94549
* Fix the the ceiling-division used in computing the MaxBECount so that it doesn'tDan Gohman2010-01-261-51/+72
| | | | | | | | | | | | | have trouble with an intermediate add overflowing. Also, be more conservative about the case where the induction variable in an SLT loop exit can step past the RHS of the SLT and overflow in a single step. Make getSignedRange more aggressive, to recover for some common cases which the above fixes pessimized. This addresses rdar://7561161. llvm-svn: 94512
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-211-57/+149
| | | | | | | | | | | | | | This new version is much more aggressive about doing "full" reduction in cases where it reduces register pressure, and also more aggressive about rewriting induction variables to count down (or up) to zero when doing so reduces register pressure. It currently uses fairly simplistic algorithms for finding reuse opportunities, but it introduces a new framework allows it to combine multiple strategies at once to form hybrid solutions, instead of doing all full-reduction or all base+index. llvm-svn: 94061
* Add a comment and tidy up some whitespace.Dan Gohman2010-01-191-2/+2
| | | | llvm-svn: 93932
* Give ScalarEvolution access to the DominatorTree. It'll need thisDan Gohman2010-01-191-0/+2
| | | | | | to make more intellegent AddRec folding decisions. llvm-svn: 93930
* Use WriteAsOperand instead of getName() to print loop header names,Dan Gohman2010-01-091-6/+16
| | | | | | so that unnamed blocks are handled. llvm-svn: 93059
* Remove dump routine and the associated Debug.h from a header. Patch upDavid Greene2009-12-231-0/+1
| | | | | | other files to compensate. llvm-svn: 92075
* Convert debug messages to use dbgs(). Generally this meansDavid Greene2009-12-231-7/+7
| | | | | | s/errs/dbgs/g except for certain special cases. llvm-svn: 92067
* Fix a spello in a comment that Nick spotted.Dan Gohman2009-12-191-2/+2
| | | | llvm-svn: 91742
* Make this comment more precise.Dan Gohman2009-12-181-1/+1
| | | | llvm-svn: 91722
* Revert this use of NUW/NSW also. Overflow-undefined multiplication isn'tDan Gohman2009-12-181-3/+6
| | | | | | associative either. llvm-svn: 91701
* Revert this use of NSW; this one isn't actually safe. NSW additionDan Gohman2009-12-181-4/+2
| | | | | | is not reassociative. llvm-svn: 91667
* Delete an unused variable.Dan Gohman2009-12-181-1/+0
| | | | llvm-svn: 91659
* Preserve NSW information in more places.Dan Gohman2009-12-181-8/+19
| | | | llvm-svn: 91656
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-181-4/+4
| | | | | | | | contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. llvm-svn: 91654
* Whitespace cleanups.Dan Gohman2009-12-181-12/+12
| | | | llvm-svn: 91651
* Remove dead LLVMContext argument.Nick Lewycky2009-11-231-2/+2
| | | | llvm-svn: 89641
* Pass the (optional) TargetData object to ConstantFoldInstOperandsDan Gohman2009-11-091-9/+10
| | | | | | and ConstantFoldCompareInstOperands. llvm-svn: 86626
* fix ConstantFoldCompareInstOperands to take the LHS/RHS asChris Lattner2009-11-091-6/+5
| | | | | | individual operands instead of taking a temporary array llvm-svn: 86619
* remove a bunch of extraneous LLVMContext argumentsChris Lattner2009-11-061-9/+4
| | | | | | from various APIs, addressing PR5325. llvm-svn: 86231
* Reverting 85714, 85715, 85716, which are breaking the buildDouglas Gregor2009-11-011-2/+0
| | | | llvm-svn: 85717
* Add a function to Passes.h to allow clients to create instancesDan Gohman2009-11-011-0/+2
| | | | | | of the ScalarEvolution pass without needing to #include ScalarEvolution.h. llvm-svn: 85716
* Rename forgetLoopBackedgeTakenCount to forgetLoop, because itDan Gohman2009-10-311-8/+8
| | | | | | clears out more information than just the stored backedge taken count. llvm-svn: 85664
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Revert r83606 and add comments explaining why it isn't safe.Dan Gohman2009-10-091-12/+10
| | | | llvm-svn: 83649
* Preserve HasNSW and HasNUW when constructing SCEVs for Add and MulDan Gohman2009-10-091-4/+12
| | | | | | instructions. llvm-svn: 83606
* Add the ability to track HasNSW and HasNUW on more kinds of SCEV expressions.Dan Gohman2009-10-091-12/+22
| | | | llvm-svn: 83601
* Add a properlyDominates member function to ScalarEvolution.Dan Gohman2009-09-271-0/+22
| | | | llvm-svn: 82898
* Teach ScalarEvolution how to reason about no-wrap flags on loopsDan Gohman2009-09-171-15/+37
| | | | | | | | where the induction variable has a non-unit stride, such as {0,+,2}, and there are expressions such as {1,+,2} inside the loop formed with or or add nsw operators. llvm-svn: 82151
* Remove references to expression "handles", which are no longer used.Dan Gohman2009-09-031-1/+1
| | | | llvm-svn: 80918
* Don't use an iterator which is potentially invalidated.Dan Gohman2009-08-311-1/+1
| | | | llvm-svn: 80632
* Extend the ValuesAtScope cache to cover all expressions, not justDan Gohman2009-08-311-20/+24
| | | | | | | | | | | | | | SCEVUnknowns, as the non-SCEVUnknown cases in the getSCEVAtScope code can also end up repeatedly climing through the same expression trees, which can be unusably slow when the trees are very tall. Also, add a quick check for SCEV pointer equality to the main SCEV comparison routine, as the full comparison code can be expensive in the case of large expression trees. These fix compile-time problems in some pathlogical cases. llvm-svn: 80623
* Don't assume that two identical instructions that read from memoryDan Gohman2009-08-251-1/+1
| | | | | | | | will always return the same value. This isn't currently necessary, since this code doesn't currently ever get called under circumstances where it would matter, but it may some day. llvm-svn: 80017
* Teach ScalarEvolution about GlobalAliases.Dan Gohman2009-08-251-0/+3
| | | | llvm-svn: 80014
* remove a few dead insertion methods.Chris Lattner2009-08-241-5/+0
| | | | llvm-svn: 79882
* Change Pass::print to take a raw ostream instead of std::ostream,Chris Lattner2009-08-231-4/+0
| | | | | | update all code that this affects. llvm-svn: 79830
OpenPOWER on IntegriCloud