summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-5/+4
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-10/+10
| | | | llvm-svn: 76702
* Update this comment.Dan Gohman2009-07-201-7/+5
| | | | llvm-svn: 76438
* Fix the expansion of umax and smax in the case where one or more ofDan Gohman2009-07-141-6/+26
| | | | | | | | the operands have pointer type, so that the resulting type matches the original SCEV type, and so that unnecessary ptrtoints are avoided in common cases. llvm-svn: 75680
* Change all SCEV* to SCEV *.Dan Gohman2009-07-071-29/+29
| | | | llvm-svn: 74918
* Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's ↵Owen Anderson2009-07-061-10/+12
| | | | | | through the ValueTracking API. llvm-svn: 74873
* Minor formatting, whitespace, and 80-column fixes.Dan Gohman2009-06-301-7/+7
| | | | llvm-svn: 74492
* Change SCEVExpander to use an IRBuilder to emit instructions.Dan Gohman2009-06-271-72/+70
| | | | llvm-svn: 74391
* Incorporate the insertion point into the key of SCEVExpander's CSE map.Dan Gohman2009-06-261-14/+19
| | | | | | | | | | | | | | This helps it avoid reusing an instruction that doesn't dominate all of the users, in cases where the original instruction was inserted before all of the users were known. This may result in redundant expansions of sub-expressions that depend on loop-unpredictable values in some cases, however this isn't very common, and it primarily impacts IndVarSimplify, so GVN can be expected to clean these up. This eliminates the need for IndVarSimplify's FixUsesBeforeDefs, which fixes several bugs. llvm-svn: 74352
* Extend ScalarEvolution's multiple-exit support to compute exactDan Gohman2009-06-241-46/+58
| | | | | | | | | | | | | | | 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
* Fix a few minor issues that were exposed by the removal of SCEVHandle.Dan Gohman2009-06-221-1/+1
| | | | llvm-svn: 73910
* SCEVHandle is no more!Owen Anderson2009-06-221-34/+34
| | | | llvm-svn: 73906
* Support vector casts in more places, fixing a variety of assertionDan Gohman2009-06-151-3/+1
| | | | | | | | | | | | | | | failures. To support this, add some utility functions to Type to help support vector/scalar-independent code. Change ConstantInt::get and ConstantFP::get to support vector types, and add an overload to ConstantInt::get that uses a static IntegerType type, for convenience. Introduce a new getConstant method for ScalarEvolution, to simplify common use cases. llvm-svn: 73431
* Convert several parts of the ScalarEvolution framework to useDan Gohman2009-06-141-7/+9
| | | | | | SmallVector instead of std::vector. llvm-svn: 73357
OpenPOWER on IntegriCloud