summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Make SCEVCallbackVH::allUsesReplacedWith more thorough in removingDan Gohman2009-07-141-4/+8
| | | | | | users from the Scalars map. llvm-svn: 75634
* Add a comment about why ScalarEvolution doesn't recognize non-loop PHIsDan Gohman2009-07-141-0/+4
| | | | | | even when they're obvious. llvm-svn: 75632
* Move more functionality over to LLVMContext.Owen Anderson2009-07-131-1/+1
| | | | llvm-svn: 75559
* Print a newline after printing a Value, now that Value's operator<<Dan Gohman2009-07-131-1/+1
| | | | | | doesn't print a newline. llvm-svn: 75543
* Fix a few assertion strings.Dan Gohman2009-07-131-2/+2
| | | | llvm-svn: 75530
* Whitespace cleanups.Dan Gohman2009-07-131-5/+5
| | | | llvm-svn: 75525
* Fix an 80-column violation.Dan Gohman2009-07-131-4/+4
| | | | llvm-svn: 75524
* Reapply 75252, with a fix to avoid the infinite recursion case. TheDan Gohman2009-07-131-114/+527
| | | | | | | check for avoiding re-analyzing a widening cast needed to happen earlier, as getSCEV itself may result in a isLoopGuardedByCond query. llvm-svn: 75511
* Move more functionality over to LLVMContext.Owen Anderson2009-07-131-3/+6
| | | | llvm-svn: 75497
* Move the memoization check for SCEVSignExtendExpr andDan Gohman2009-07-131-10/+22
| | | | | | | | SCEVZeroExtendExpr ahead of the most expensive analysis. This speeds up analysis and helps avoid pathologically bad behavior on the testcase in PR4534. llvm-svn: 75496
* Convert SCEV from FoldingSetNode to FastFoldingSetNode. This eliminatesDan Gohman2009-07-131-67/+33
| | | | | | | a bunch of redundent code in Profile methods, and prepares for upcoming changes to do improved memoization. llvm-svn: 75494
* Begin the painful process of tearing apart the rat'ss nest that is ↵Owen Anderson2009-07-131-5/+6
| | | | | | | | | Constants.cpp and ConstantFold.cpp. This involves temporarily hard wiring some parts to use the global context. This isn't ideal, but it's the only way I could figure out to make this process vaguely incremental. llvm-svn: 75445
* Revert r75252 which was causing some crashes at compile time.Nick Lewycky2009-07-111-521/+111
| | | | llvm-svn: 75384
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-10/+11
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
* Remove ScalarEvolution::hasSCEV, which isn't being used, and whichDan Gohman2009-07-101-8/+2
| | | | | | breaks encapsulation. Also remove a dead prototype for setSCEV. llvm-svn: 75272
* Generalize ScalarEvolution's cast-folding code to support more kindsDan Gohman2009-07-101-111/+521
| | | | | | | of loops. Add several new functions to for working with ScalarEvolution's add-hoc value-range analysis functionality. llvm-svn: 75252
* Make the code that updates ScalarEvolution's internal state in responseDan Gohman2009-07-081-30/+70
| | | | | | | | | | | | to a loop deletion more thorough. Don't prune the def-use tree search at instructions that don't have SCEVs computed, because an instruction with a user that has a computed SCEV may itself lack a computed SCEV. Also, remove loop-related values from the ValuesAtScopes and ConstantEvolutionLoopExitValues maps as well. This fixes a regression in 483.xalancbmk. llvm-svn: 75030
* Change all SCEV* to SCEV *.Dan Gohman2009-07-071-206/+206
| | | | llvm-svn: 74918
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-061-1/+1
| | | | llvm-svn: 74878
* Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's ↵Owen Anderson2009-07-061-10/+18
| | | | | | through the ValueTracking API. llvm-svn: 74873
* Thread LLVMContext through the constant folding APIs, which touches a lot of ↵Owen Anderson2009-07-061-4/+8
| | | | | | files. llvm-svn: 74844
* When comparing constants, consider a less wide constant to be "less complex"Nick Lewycky2009-07-041-0/+2
| | | | | | | than a wider one, before trying to compare their contents which will crash if their sizes are different. llvm-svn: 74792
* Minor code cleanups.Dan Gohman2009-06-301-2/+6
| | | | llvm-svn: 74551
* Use getSCEV instead of getUnknown to create a SCEV for aDan Gohman2009-06-291-3/+3
| | | | | | | | | | Constant. This lets ConstantInts be handled as SCEVConstant instead of SCEVUnknown, as getUnknown no longer has special-case code for ConstantInt and friends. This usually doesn't affect the final output, since the constants end up getting folded later, but it does make intermediate expressions more obvious in many cases. llvm-svn: 74459
* Don't cache PHI exit values from exhaustive evaluations, becauseDan Gohman2009-06-291-1/+0
| | | | | | | | an individual exhaustive evaluation reflects only the exit value implied by an individual exit, which may differ from the actual exit value of the loop if there are other exits. This fixes PR4477. llvm-svn: 74447
* Simplify this code, and avoid using APInt(). This fixesDan Gohman2009-06-291-4/+2
| | | | | | | (otherwise harmless) uninitialized value warnings that Duncan found with gcc-4.4. llvm-svn: 74437
* Convert ScalarEvolution to use BumpPtrAllocator and FoldingSet, insteadDan Gohman2009-06-271-141/+222
| | | | | | of a team of individual allocations and a team of std::maps. llvm-svn: 74393
* Fix ScalarEvolution::getAddRecExpr's code which canonicalized theDan Gohman2009-06-261-2/+23
| | | | | | | | nesting order of nested AddRec expressions to skip the transformation if it would introduce an AddRec with operands not loop-invariant with respect to its loop. llvm-svn: 74343
* Fix SCEVAddRecExpr::isLoopInvariant to test if all of its operandsDan Gohman2009-06-261-5/+15
| | | | | | are loop invariant, not just the start operand. llvm-svn: 74338
* Minor whitespace cleanups.Dan Gohman2009-06-241-16/+16
| | | | llvm-svn: 74074
* Simplify [su]max(MAX, n) to MAX. This comes up in loop tripcountDan Gohman2009-06-241-2/+10
| | | | | | | | | computations in loops with multiple exits. Adjust the testcase for PR4436 so that the relevant portion isn't optimized away. llvm-svn: 74073
* Delete some orphaned comments, fix some 80-column violations,Dan Gohman2009-06-241-95/+80
| | | | | | and tidy up a few other formatting issues. llvm-svn: 74060
* Extend ScalarEvolution's multiple-exit support to compute exactDan Gohman2009-06-241-97/+105
| | | | | | | | | | | | | | | trip counts in more cases. Generalize ScalarEvolution's isLoopGuardedByCond code to recognize And and Or conditions, splitting the code out into an isNecessaryCond helper function so that it can evaluate Ands and Ors recursively, and make SCEVExpander be much more aggressive about hoisting instructions out of loops. test/CodeGen/X86/pr3495.ll has an additional instruction now, but it appears to be due to an arbitrary register allocation difference. llvm-svn: 74048
* Teach GetMinSignBits about SCEVAddExprs.Dan Gohman2009-06-241-0/+32
| | | | llvm-svn: 74045
* Move the special cases for constants out of getUnknown and intoDan Gohman2009-06-241-15/+14
| | | | | | | | | createSCEV. Also, recognize UndefValue in createSCEV. Change getIntegerSCEV's comment to avoid mentioning FP types, and re-implement it in terms of getConstant instead of getUnknown. llvm-svn: 74041
* Use ScalarEvolution::getConstant instead of getUnknown to createDan Gohman2009-06-241-7/+8
| | | | | | | SCEVConstants. This cleanup is a step toward letting getUnknown be simpler. llvm-svn: 74037
* Include the maximum trip count expression in ScalarEvolution's print output.Dan Gohman2009-06-241-0/+9
| | | | llvm-svn: 74035
* Add an isAllOnesValue utility function, similar to isZero and isOne.Dan Gohman2009-06-241-0/+6
| | | | llvm-svn: 74032
* Fix a bug in the trip-count computation with And/Or. If either of theDan Gohman2009-06-221-8/+4
| | | | | | sides is CouldNotCompute, the resulting exact count must be CouldNotCompute. llvm-svn: 73920
* Remove the parent pointer from SCEV, since it did not end up being needed.Owen Anderson2009-06-221-30/+22
| | | | llvm-svn: 73907
* SCEVHandle is no more!Owen Anderson2009-06-221-256/+255
| | | | llvm-svn: 73906
* Fix some typos that Duncan noticed.Dan Gohman2009-06-221-2/+2
| | | | llvm-svn: 73903
* Banish global state from ScalarEvolution! SCEV uniquing is now done by ↵Owen Anderson2009-06-221-58/+50
| | | | | | | | | | | tables attached to the ScalarEvolution pass. This also throws out the SCEV reference counting scheme, as the the SCEVs now have a lifetime controlled by the ScalarEvolution pass. Note that SCEVHandle is now a no-op, and will be remove in a future commit. llvm-svn: 73892
* Make use of getUMinFromMismatchedTypes when computing backedge-takenDan Gohman2009-06-221-14/+14
| | | | | | | | | | | | counts for loops with multiple exits, replacing more conservative code which only handled constants. This is derived from a patch by Nick Lewycky. This also fixes llc aborts in ClamAV and others, as getUMinFromMismatchedTypes takes care of balancing the types before working with them. llvm-svn: 73884
* Add a getUMinFromMismatchedTypes helper function.Dan Gohman2009-06-221-0/+16
| | | | llvm-svn: 73883
* Factor out code for computing umin and smin for SCEV expressions intoDan Gohman2009-06-221-7/+14
| | | | | | helper functions. Based on a patch by Nick Lewycky. llvm-svn: 73869
* Teach ScalarEvolution how to analyze loops with multiple exitDan Gohman2009-06-221-27/+221
| | | | | | | | | blocks, and also exit blocks with multiple conditions (combined with (bitwise) ands and ors). It's often infeasible to compute an exact trip count in such cases, but a useful upper bound can often be found. llvm-svn: 73866
* Delete an unused variable.Dan Gohman2009-06-221-1/+0
| | | | llvm-svn: 73865
* Fix ScalarEvolution's backedge-taken count computations to check forDan Gohman2009-06-211-7/+29
| | | | | | | | overflow when computing a integer division to round up. Thanks to Nick Lewycky for noticing this! llvm-svn: 73862
* Generalize isLoopGuardedByCond's checking to consider twoDan Gohman2009-06-201-3/+27
| | | | | | | | | | SCEVUnknowns with identical Instructions to be equal. This allows it to analze cases such as the attached testcase, where the front-end has cloned the loop controlling expression. Along with r73805, this lets IndVarSimplify eliminate all the sign-extend casts in the loop in the attached testcase. llvm-svn: 73807
OpenPOWER on IntegriCloud