summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Use A.append(...) instead of A.insert(A.end(), ...) when A is aDan Gohman2010-06-211-4/+4
| | | | | | SmallVector, and other SmallVector simplifications. llvm-svn: 106452
* Restore a call to rememberInstruction which was accidentally droppedDan Gohman2010-06-191-0/+1
| | | | | | in refactoring. llvm-svn: 106398
* Factor out duplicated code for reusing and inserting casts intoDan Gohman2010-06-191-54/+46
| | | | | | a helper function. llvm-svn: 106388
* A few more places where SCEVExpander bits need to skip over debug intrinsicsJim Grosbach2010-06-161-3/+4
| | | | | | when iterating through instructions. Yet more work for rdar://7797940 llvm-svn: 106149
* LSR needs to remember inserted instructions even in postinc mode, becauseDan Gohman2010-06-051-1/+3
| | | | | | | there could be multiple subexpressions within a single expansion which require insert point adjustment. This fixes PR7306. llvm-svn: 105510
* 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
* When checking whether the special handling for an addrec increment whichDan Gohman2010-04-261-2/+1
| | | | | | | | | doesn't dominate the header is needed, don't check whether the increment expression has computable loop evolution. While the operands of an addrec are required to be loop-invariant, they're not required to dominate any part of the loop. This fixes PR6914. llvm-svn: 102389
* Fix a bunch of namespace polution.Dan Gohman2010-04-151-0/+4
| | | | llvm-svn: 101376
* When emitting code for an add, don't force a SCEVUnknown wrapper aroundDan Gohman2010-04-091-3/+4
| | | | | | | a hoisted intermediate result if the intermediate result isn't an Instruction. llvm-svn: 100884
* Add a comment.Dan Gohman2010-04-091-1/+2
| | | | llvm-svn: 100874
* Generalize IVUsers to track arbitrary expressions rather than expressionsDan Gohman2010-04-071-7/+10
| | | | | | | | | | | | | | | explicitly split into stride-and-offset pairs. Also, add the ability to track multiple post-increment loops on the same expression. This refines the concept of "normalizing" SCEV expressions used for to post-increment uses, and introduces a dedicated utility routine for normalizing and denormalizing expressions. This fixes the expansion of expressions which are post-increment users of more than one loop at a time. More broadly, this takes LSR another step closer to being able to reason about more than one loop at a time. llvm-svn: 100699
* Don't back past debug info intrinsics; SCEVExpander's strategyDan Gohman2010-03-231-12/+1
| | | | | | | for ignoring debug info intrinsics everywhere else is to advance past them, and it needs to be consistent. llvm-svn: 99332
* Fix more places to more thoroughly ignore debug intrinsics. This fixesDan Gohman2010-03-191-5/+13
| | | | | | | | use-before-def errors in SCEVExpander-produced code in sqlite3 when debug info with optimization is enabled, though the testcases for this are dependent on use-list order. llvm-svn: 99001
* Reapply r98755 with a thinko which miscompiled gengtype fixed.Dan Gohman2010-03-181-18/+10
| | | | llvm-svn: 98793
* Revert 98755, which may be causing trouble.Dan Gohman2010-03-171-10/+18
| | | | llvm-svn: 98762
* Change SCEVNAryExpr's operand array from a SmallVector to a plainDan Gohman2010-03-171-18/+10
| | | | | | | | | | 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
* Another place where debug info affected codegen.Dale Johannesen2010-03-091-0/+2
| | | | llvm-svn: 98026
* Fix another case where LSR was affected by debug info.Dale Johannesen2010-03-061-1/+12
| | | | llvm-svn: 97865
* Fix a case where LSR is sensitive to debug info.Dale Johannesen2010-03-051-0/+9
| | | | llvm-svn: 97830
* Make SCEVExpander and LSR more aggressive about hoisting expressions outDan Gohman2010-03-031-47/+224
| | | | | | of loops. llvm-svn: 97642
* Revert r97580; that's not the right way to fix this.Dan Gohman2010-03-031-121/+31
| | | | llvm-svn: 97639
* When expanding an expression such as (A + B + C + D), sort the operandsDan Gohman2010-03-021-31/+121
| | | | | | | by loop depth and emit loop-invariant subexpressions outside of loops. This speeds up MultiSource/Applications/viterbi and others. llvm-svn: 97580
* Non-affine post-inc SCEV expansions have more code which must beDan Gohman2010-03-021-1/+1
| | | | | | | emitted after the increment. Make sure the insert position reflects this. This fixes PR6453. llvm-svn: 97537
* Spelling fixes.Dan Gohman2010-03-011-4/+4
| | | | llvm-svn: 97453
* Fix SCEVExpander's existing PHI reuse checking to recognize theDan Gohman2010-02-171-0/+13
| | | | | | | | case where there are loop-invariant instructions somehow left inside the loop, and in a position where they won't dominate the IV increment position. llvm-svn: 96448
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-3/+3
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* When reusing an existing PHI node in a loop, be even moreDan Gohman2010-02-161-11/+39
| | | | | | strict about the requirements. llvm-svn: 96301
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-1/+1
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* When restoring a saved insert location, check to see if the savedDan Gohman2010-02-151-4/+12
| | | | | | | insert location has become an "inserted" instruction since the time it was saved. If so, advance to the first non-"inserted" instruction. llvm-svn: 96203
* In rememberInstruction, if the value being remembered is theDan Gohman2010-02-141-0/+14
| | | | | | | | | current insertion point, advance the current insertion point. This avoids a use-before-def situation in a testcase extracted from clang which is difficult to reduce to a reasonable-sized regression test. llvm-svn: 96151
* Fix a case of mismatched types in an Add that turned up in 447.dealII.Dan Gohman2010-02-121-0/+2
| | | | llvm-svn: 96007
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-121-2/+18
| | | | | | | | | | bug fixes, and with improved heuristics for analyzing foreign-loop addrecs. This change also flattens IVUsers, eliminating the stride-oriented groupings, which makes it easier to work with. llvm-svn: 95975
* Generalize target-independent folding rules for sizeof to handle moreDan Gohman2010-02-011-3/+3
| | | | | | | | | | | | | | | | | | | 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
* Check Type::isSized before calling ScalarEvolution::getAllocSizeExpr,Dan Gohman2010-01-281-21/+23
| | | | | | rather than after. llvm-svn: 94742
* Remove SCEVAllocSizeExpr and SCEVFieldOffsetExpr, and in their placeDan Gohman2010-01-281-17/+9
| | | | | | | | | | | | | | | | 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
* When re-using an existing cast for a user, it's still necessary to callDan Gohman2010-01-211-1/+3
| | | | | | | rememberInstruction so that future users of that user will be inserted in the correct position. This fixes the Darwin selfhost. llvm-svn: 94070
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-211-18/+210
| | | | | | | | | | | | | | 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
* Fix a typo and an 80-column violation in comments.Dan Gohman2010-01-191-3/+3
| | | | llvm-svn: 93931
* Fix a comment typo.Bob Wilson2009-12-041-1/+1
| | | | llvm-svn: 90511
* improve portability to avoid conflicting with std::next in c++'0x.Chris Lattner2009-12-031-2/+2
| | | | | | Patch by Howard Hinnant! llvm-svn: 90365
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-061-1/+1
| | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. llvm-svn: 83379
* When extending the operands of an addrec, iterate through allDan Gohman2009-09-281-5/+5
| | | | | | | the operands, rather than trying to partition them into a start and a step. This handles non-affine add recurrences correctly. llvm-svn: 83011
* Fix SCEVExpander's canonical addrec expansion code to work on loops thatDan Gohman2009-09-271-19/+12
| | | | | | | | aren't in canonical loop-simplify form, since it doesn't itself depend on LoopSimplify. This means handling loops without preheaders and loops with multiple backedges. llvm-svn: 82905
* Fix a case where ScalarEvolution was expanding pointer arithmeticDan Gohman2009-09-261-3/+20
| | | | | | to inttoptr/ptrtoint unnecessarily. llvm-svn: 82864
* Various comment and whitespace cleanups.Dan Gohman2009-08-201-8/+11
| | | | llvm-svn: 79533
* Generalize ScalarEvolution to be able to analyze GEPs whenDan Gohman2009-08-181-83/+230
| | | | | | | | 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-2/+3
| | | | llvm-svn: 78948
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-3/+3
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-3/+3
| | | | llvm-svn: 77494
* Teach instcombine to respect and preserve inbounds. Add inboundsDan Gohman2009-07-281-1/+3
| | | | | | to a few tests where it is required for the expected transformation. llvm-svn: 77290
OpenPOWER on IntegriCloud