summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use hasDefinitiveInitializer() instead of testing the same thingDan Gohman2009-08-191-1/+1
| | | | | | | by hand, and fix a few places that were using hasInitializer() that appear to depend on the initializer value. llvm-svn: 79441
* Generalize ScalarEvolution to be able to analyze GEPs whenDan Gohman2009-08-181-36/+164
| | | | | | | | TargetData is not present. It still uses TargetData when available. This generalization also fixed some limitations in the TargetData case; the attached testcase covers this. llvm-svn: 79344
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-10/+12
| | | | llvm-svn: 78948
* Fix copy-pasto.Andreas Bolka2009-08-071-2/+2
| | | | llvm-svn: 78426
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-4/+4
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Move types back to the 2.5 API.Owen Anderson2009-07-291-1/+1
| | | | llvm-svn: 77516
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-6/+5
| | | | llvm-svn: 77494
* Fix wording in comments.Dan Gohman2009-07-271-1/+1
| | | | llvm-svn: 77193
* SCEV objects are no longer reference-counted.Dan Gohman2009-07-251-3/+2
| | | | llvm-svn: 77080
* When attempting to sign-extend an addrec by interpretingDan Gohman2009-07-251-2/+2
| | | | | | | the step value as unsigned, the start value and the addrec itself still need to be treated as signed. llvm-svn: 77078
* Teach ScalarEvolution to make use of no-overflow flags whenDan Gohman2009-07-251-2/+37
| | | | | | analyzing add recurrences. llvm-svn: 77034
* Instead of eagerly creating new SCEVs to replace all SCEVs that areDan Gohman2009-07-251-103/+56
| | | | | | | | | | | | affected after a PHI node has been analyzed, just remove affected SCEVs from the Scalars map, so that they'll be (lazily) recreated as needed. This avoids creating SCEV objects that aren't actually needed. Also, rewrite the associated def-use walking code to be non-recursive and to continue traversing past Instructions that don't have an entry in the Scalars map. llvm-svn: 77032
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-15/+16
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Fix whitespace.Dan Gohman2009-07-241-1/+1
| | | | llvm-svn: 76929
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-31/+32
| | | | llvm-svn: 76702
* Replace the original ad-hoc code for determining whether (v pred w) impliesDan Gohman2009-07-211-104/+197
| | | | | | | | (x pred y) with more thorough code that does more complete canonicalization before resorting to range checks. This helps it find more cases where the canonicalized expressions match. llvm-svn: 76671
* Make the range calculations for addrecs to be more conservative,Dan Gohman2009-07-211-3/+9
| | | | | | | as they aren't currently prepared to handle complicated overflow cases. llvm-svn: 76524
* Whitespace cleanups.Dan Gohman2009-07-211-3/+3
| | | | llvm-svn: 76523
* Minor code simplification.Dan Gohman2009-07-211-1/+1
| | | | llvm-svn: 76521
* Add a comment to clarify why there isn't any code in this spot.Dan Gohman2009-07-201-0/+2
| | | | llvm-svn: 76505
* Remove the code that tried to evaluate whether (A pred B) is knownDan Gohman2009-07-201-42/+0
| | | | | | | by determining if (B pred (B-A)) is known, as it doesn't handle overflow correctly. llvm-svn: 76504
* Minor code simplification.Dan Gohman2009-07-201-1/+1
| | | | llvm-svn: 76496
* The upper argument of ConstantRange is exclusive, not inclusive.Dan Gohman2009-07-201-1/+3
| | | | llvm-svn: 76492
* Revert the addition of hasNoPointerOverflow to GEPOperator.Dan Gohman2009-07-201-9/+4
| | | | | | | | | | | | Getelementptrs that are defined to wrap are virtually useless to optimization, and getelementptrs that are undefined on any kind of overflow are too restrictive -- it's difficult to ensure that all intermediate addresses are within bounds. I'm going to take a different approach. Remove a few optimizations that depended on this flag. llvm-svn: 76437
* Add a new Operator class, for handling Instructions and ConstantExprsDan Gohman2009-07-171-2/+3
| | | | | | | | | in a convenient manner, factoring out some common code from InstructionCombining and ValueTracking. Move the contents of BinaryOperators.h into Operator.h and use Operator to generalize them to support ConstantExprs as well as Instructions. llvm-svn: 76232
* Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a ↵Owen Anderson2009-07-161-6/+6
| | | | | | | | number of issues in our current context-passing stuff, which is also fixed here llvm-svn: 76089
* Fill in some holes in ScalarEvolution's loop iteration conditionDan Gohman2009-07-161-2/+27
| | | | | | | analysis. This allows indvars to emit a simpler loop trip count expression. llvm-svn: 76085
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-4/+5
| | | | llvm-svn: 75703
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-8/+8
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* 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
OpenPOWER on IntegriCloud