summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* When creating a ConstantRange for [n,UINT_MAX], special case n == 0, becauseDan Gohman2010-04-111-3/+4
| | | | | | ConstantRange(0, 0) creates an empty range rather than a full one. llvm-svn: 100993
* Rename isLoopGuardedByCond to isLoopEntryGuardedByCond, to emphasiseDan Gohman2010-04-111-12/+12
| | | | | | | that it's only testing for the entry condition, not full loop-invariant conditions. llvm-svn: 100979
* Add variants of ult, ule, etc. which take a uint64_t RHS, for convenience.Dan Gohman2010-04-081-1/+1
| | | | llvm-svn: 100824
* Revert this change from a while ago; ScalarEvolution shouldn't analyzeDan Gohman2010-04-081-2/+0
| | | | | | | undef as 0, since it can't force other analyses to intepret the undef in the same way. llvm-svn: 100749
* Define placement new wrappers for BumpPtrAllocator andDan Gohman2010-03-181-22/+20
| | | | | | | RecyclingAllocator to allow client code to be simpler, and simplify several clients. llvm-svn: 98847
* Add the ability to "intern" FoldingSetNodeID data into aDan Gohman2010-03-181-16/+16
| | | | | | | | | | | | BumpPtrAllocator-allocated region to allow it to be stored in a more compact form and to avoid the need for a non-trivial destructor call. Use this new mechanism in ScalarEvolution instead of FastFoldingSetNode to avoid leaking memory in the case where a FoldingSetNodeID uses heap storage, and to reduce overall memory usage. llvm-svn: 98829
* Reapply r98755 with a thinko which miscompiled gengtype fixed.Dan Gohman2010-03-181-16/+25
| | | | llvm-svn: 98793
* Revert 98755, which may be causing trouble.Dan Gohman2010-03-171-25/+16
| | | | llvm-svn: 98762
* Change SCEVNAryExpr's operand array from a SmallVector to a plainDan Gohman2010-03-171-16/+25
| | | | | | | | | | pointer and length, and allocate the arrays in ScalarEvolution's BumpPtrAllocator, so that they get released when their owning SCEV gets released. SCEVs are immutable, so they don't need to worry about operand array resizing. This fixes a memory leak reported in PR6637. llvm-svn: 98755
* Avoid analyzing instructions in blocks not reachable from the entry block.Dan Gohman2010-03-091-2/+9
| | | | | | They are lots of trouble, and they don't matter. This fixes PR6559. llvm-svn: 98103
* Spelling fixes.Dan Gohman2010-03-011-14/+14
| | | | llvm-svn: 97453
* Make LoopSimplify change conditional branches in loop exiting blocksDan Gohman2010-02-251-13/+28
| | | | | | | | | | | | which branch on undef to branch on a boolean constant for the edge exiting the loop. This helps ScalarEvolution compute trip counts for loops. Teach ScalarEvolution to recognize single-value PHIs, when safe, and ForgetSymbolicName to forget such single-value PHI nodes as apprpriate in ForgetSymbolicName. llvm-svn: 97126
* ConstantFoldInstOperands can theoretically return null if itDan Gohman2010-02-241-2/+3
| | | | | | didn't fold anything. llvm-svn: 97049
* Simplify this code; these casts aren't necessary.Dan Gohman2010-02-241-12/+4
| | | | llvm-svn: 97048
* Convert a few more backedge-taken count functions to use BackedgeTakenInfo.Dan Gohman2010-02-241-14/+13
| | | | llvm-svn: 97042
* Remove unused variables and parameters.Dan Gohman2010-02-221-3/+2
| | | | llvm-svn: 96780
* Add a comment.Dan Gohman2010-02-191-0/+6
| | | | llvm-svn: 96688
* Teach ScalarEvolution how to compute a tripcount for a loop withDan Gohman2010-02-191-0/+13
| | | | | | | | true or false as its exit condition. These are usually eliminated by SimplifyCFG, but the may be left around during a pass which wishes to preserve the CFG. llvm-svn: 96683
* recommit 96626, evidence that it broke things appearsDale Johannesen2010-02-191-0/+29
| | | | | | to be spurious llvm-svn: 96662
* 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
OpenPOWER on IntegriCloud