summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Optimize ScalarEvolution's SCEVComplexityCompare predicate: don't goDan Gohman2010-06-071-123/+14
| | | | | | | | | | | scrounging through SCEVUnknown contents and SCEVNAryExpr operands; instead just do a simple deterministic comparison of the precomputed hash data. Also, since this is more precise, it eliminates the need for the slow N^2 duplicate detection code. llvm-svn: 105540
* ConstantFoldConstantExpression can theoretically return null.Dan Gohman2010-05-281-4/+8
| | | | llvm-svn: 104948
* Use the SCEVAddRecExpr::getPostIncExpr utility function insteadDan Gohman2010-05-041-4/+2
| | | | | | of doing the same thing manually. llvm-svn: 102997
* Fix a copy+pasto.Dan Gohman2010-05-041-2/+2
| | | | llvm-svn: 102996
* Use getConstant instead of getIntegerSCEV. The two are basically theDan Gohman2010-05-031-13/+13
| | | | | | same, now that getConstant has overloads consistent with ConstantInt::get. llvm-svn: 102965
* Silence warnings about -1 being converted to an unsigned value.Dan Gohman2010-05-031-6/+6
| | | | | | | | Also, pass true for isSigned even when creating constants for unsigned comparisons, because the point is to create an all-ones constant, rather than UINT64_MAX, even for integers wider than 64 bits. llvm-svn: 102946
* Use isTrueWhenEqual and isFalseWhenEqual instead of assuming thatDan Gohman2010-05-031-2/+2
| | | | | | | | SimplifyICmpOperands will simplify such cases to EQ or NE. This makes the correcntess of the code independent on SimplifyICmpOperands doing certain simplifications. llvm-svn: 102927
* In ScalarEvolution::print, don't bother printing out the SCEVs forDan Gohman2010-05-031-1/+1
| | | | | | | comparison instructions, since they aren't interesting, despite having integer result types. llvm-svn: 102925
* In SimplifyICmpOperands, avoid needlessly swapping the operands in theDan Gohman2010-05-031-3/+6
| | | | | | case where both are addrecs in unrelated loops. llvm-svn: 102924
* Factor out the new <= and >= analysis code into SimplifyICmpOperands.Dan Gohman2010-05-031-51/+62
| | | | llvm-svn: 102922
* Set isSigned to true when creating an all-ones integer constant, evenDan Gohman2010-04-301-4/+4
| | | | | | | for unsigned purposes, so >64-bit integer values get a full all-ones value. llvm-svn: 102739
* Silence compiler warnings.Dan Gohman2010-04-301-4/+4
| | | | llvm-svn: 102734
* ScalarEvolution support for <= and >= loops.Dan Gohman2010-04-241-20/+107
| | | | | | | Also, generalize ScalarEvolutions's min and max recognition to handle some new forms of min and max that this change makes more common. llvm-svn: 102234
* Use SimplifyICmpOperands in isKnownPredicate too.Dan Gohman2010-04-241-0/+3
| | | | llvm-svn: 102233
* Update isImpliedCond to use the new SimplifyICmpOperands utility.Dan Gohman2010-04-241-111/+6
| | | | llvm-svn: 102232
* Add a new utility function SimplifyICmpOperands. Much of this code isDan Gohman2010-04-241-0/+198
| | | | | | | refactored out of ScalarEvolution::isImpliedCond, which will be updated to use this new utility routine soon. llvm-svn: 102229
* When it doesn't matter whether zero or sign extension is used,Dan Gohman2010-04-231-6/+2
| | | | | | use ScalarEvolutions "any" extend function. llvm-svn: 102156
* Don't attempt to analyze values which are obviously undef. This fixes someDan Gohman2010-04-221-75/+102
| | | | | | assertion failures in extreme cases. llvm-svn: 102042
* Make ScalarEvolution::getConstant support pointer types, for consistencyDan Gohman2010-04-211-2/+2
| | | | | | with ScalarEvolution's overall approach to pointer types. llvm-svn: 102003
* Fix SCEVCommutativeExpr::print to be robust in the case of improperDan Gohman2010-04-161-4/+6
| | | | | | | expression canonicalization. Its job is to print what's there, not to make judgements about it. llvm-svn: 101461
* Make getPredecessorWithUniqueSuccessorForBB return the unique successorDan Gohman2010-04-151-12/+10
| | | | | | in addition to the predecessor. llvm-svn: 101374
* Add a comment.Dan Gohman2010-04-141-0/+2
| | | | llvm-svn: 101248
* Teach ScalarEvolution to simplify smax and umax when it can proveDan Gohman2010-04-131-2/+14
| | | | | | that one operand is always greater than another. llvm-svn: 101142
* Minor code micro-optimizations.Dan Gohman2010-04-131-7/+7
| | | | llvm-svn: 101141
* Micro-optimize a few hot spots.Dan Gohman2010-04-121-10/+11
| | | | llvm-svn: 101086
* Add fast paths to ScalarEvolution::getSizeOf and getOffsetOf, asDan Gohman2010-04-121-0/+14
| | | | | | | they're used a lot by getNodeForGEP, which can be called a lot. This speeds up -iv-users by around 15% on several testcases. llvm-svn: 101083
* Generalize ScalarEvolution's PHI analysis to handle loops that don'tDan Gohman2010-04-121-14/+26
| | | | | | | have preheaders or dedicated exit blocks, as clients may not otherwise need to run LoopSimplify. llvm-svn: 101030
* Rewrite the overflow checking in the get{Signed,Unsigned}Range code forDan Gohman2010-04-121-10/+34
| | | | | | | | | AddRecs so that it checks for overflow in the computation that it is performing, rather than just checking hasNo{Signed,Unsigned}Wrap, since those flags are for a different computation. This fixes a bug that impacts an upcoming change. llvm-svn: 101028
* Fix indentation.Dan Gohman2010-04-111-1/+1
| | | | llvm-svn: 101001
* Enhance ScalarEvolution::isKnownPredicate with support forDan Gohman2010-04-111-8/+33
| | | | | | loop conditions which are invariants. llvm-svn: 100995
* Minor code simplification.Dan Gohman2010-04-111-2/+1
| | | | llvm-svn: 100994
* 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
OpenPOWER on IntegriCloud