summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
Commit message (Collapse)AuthorAgeFilesLines
* LSR: Fix another corner case in expansion of postinc users.Andrew Trick2011-12-201-0/+14
| | | | | | Fixes PR11571: Instruction does not dominate all uses llvm-svn: 146950
* LSR: Fold redundant bitcasts on-the-fly.Andrew Trick2011-12-141-3/+8
| | | | llvm-svn: 146597
* LSR: handle the expansion of phi operands that use postinc forms of the IV.Andrew Trick2011-11-301-36/+68
| | | | | | Fixes PR11431: SCEVExpander::expandAddRecExprLiterally(const llvm::SCEVAddRecExpr*): Assertion `(!isa<Instruction>(Result) || SE.DT->dominates(cast<Instruction>(Result), Builder.GetInsertPoint())) && "postinc expansion does not dominate use"' failed. llvm-svn: 145482
* Fix SCEVExpander assert during LSR: "argument of incompatible type".Andrew Trick2011-10-151-6/+5
| | | | | | | | | Just because we're dealing with a GEP doesn't mean we can assert the SCEV has a pointer type. The fix is simply to ignore the SCEV pointer type, which we really didn't need. Fixes PR11138 webkit crash. llvm-svn: 142058
* Reapply r141870, SCEV expansion of post-inc.Andrew Trick2011-10-131-2/+14
| | | | | | | Speculatively reapply to see if this test case still crashes on linux. I may have fixed it in my last checkin. llvm-svn: 141895
* Revert r141870. The test case crashes on linux with data corruption. A ↵Andrew Trick2011-10-131-14/+2
| | | | | | deeper issue was exposed. llvm-svn: 141873
* LSR: Reuse the post-inc expansion of expressions.Andrew Trick2011-10-131-2/+14
| | | | | | | | This avoids unnecessary expansion of expressions and allows the SCEV expander to work on expression DAGs, not just trees. Fixes PR11090. llvm-svn: 141870
* Move replaceCongruentIVs into SCEVExapander and bias toward "expanded"Andrew Trick2011-10-111-0/+100
| | | | | | | | | | | IVs. Indvars previously chose randomly between congruent IVs. Now it will bias the decision toward IVs that SCEVExpander likes to create. This was not done to fix any problem, it's just a welcome side effect of factoring code. llvm-svn: 141633
* Add an extra safety check in front of the optimization in r141442.Andrew Trick2011-10-081-0/+9
| | | | llvm-svn: 141470
* LSR should only reuse phis that match its formula.Andrew Trick2011-10-071-61/+113
| | | | | | Fixes rdar://problem/5064068 llvm-svn: 141442
* Stop emitting instructions with the name "tmp" they eat up memory and have ↵Benjamin Kramer2011-09-271-7/+7
| | | | | | | | to be uniqued, without any benefit. If someone prefers %tmp42 to %42, run instnamer. llvm-svn: 140634
* Skip the landingpad instruction when determining the insertion point.Bill Wendling2011-08-241-3/+7
| | | | llvm-svn: 138481
* Use the getFirstInsertionPt() method instead of getFirstNonPHI + an 'isa<>'Bill Wendling2011-08-161-5/+2
| | | | | | check for a LandingPadInst. llvm-svn: 137745
* A few places where we want to skip the landingpad instruction for insertion.Bill Wendling2011-08-161-1/+4
| | | | llvm-svn: 137712
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-221-2/+1
| | | | | | ArrayRef. llvm-svn: 135761
* Convert ConstantExpr::getGetElementPtr andJay Foad2011-07-211-1/+1
| | | | | | ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-32/+32
| | | | llvm-svn: 135375
* Silence compiler warnings.Benjamin Kramer2011-07-161-5/+4
| | | | llvm-svn: 135358
* Fix SCEVEXpander to handle arbitrary phi expansion. Includes twoAndrew Trick2011-07-161-7/+18
| | | | | | | related bug fixes and corresponding assertions for uninitialized data and missing NULL check. Test cases will be included with the new LFTR. llvm-svn: 135333
* Preserve debug loc.Devang Patel2011-07-051-1/+1
| | | | llvm-svn: 134441
* Cleanup. Fix a stupid variable name.Andrew Trick2011-06-281-3/+3
| | | | llvm-svn: 133995
* SCEVExpander: give new insts a name that identifies the reponsible pass.Andrew Trick2011-06-281-3/+4
| | | | llvm-svn: 133992
* New binops need debug loc.Devang Patel2011-06-221-1/+3
| | | | llvm-svn: 133642
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-4/+3
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-301-6/+8
| | | | llvm-svn: 128535
* Added SCEV::NoWrapFlags to manage unsigned, signed, and self wrapAndrew Trick2011-03-141-12/+25
| | | | | | | | | properties. Added the self-wrap flag for SCEV::AddRecExpr. A slew of temporary FIXMEs indicate the intention of the no-self-wrap flag without changing behavior in this revision. llvm-svn: 127590
* When decling to reuse existing expressions that involve casts, ignoreDan Gohman2011-03-041-1/+1
| | | | | | | bitcasts, which are really no-ops here. This fixes slowdowns on MultiSource/Applications/aha and others. llvm-svn: 127031
* Don't re-use existing addrec expansions if they contain casts.Dan Gohman2011-03-021-1/+2
| | | | | | This fixes PR9259. llvm-svn: 126812
* Introduce memoization for ScalarEvolution dominates and properlyDominatesDan Gohman2010-11-181-16/+27
| | | | | | queries, and SCEVExpander getRelevantLoop queries. llvm-svn: 119595
* Move SCEV::dominates and properlyDominates to ScalarEvolution.Dan Gohman2010-11-171-2/+2
| | | | llvm-svn: 119570
* Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be memberDan Gohman2010-11-171-2/+2
| | | | | | | functions of ScalarEvolution, in preparation for memoization and other optimizations. llvm-svn: 119562
* Fix SCEVExpander::visitAddRecExpr so that it remembers the induction variableDan Gohman2010-07-261-24/+21
| | | | | | | | it inserted rather than using LoopInfo::getCanonicalInductionVariable to rediscover it, since that doesn't work on non-canonical loops. This fixes infinite recurrsion on such loops; PR7562. llvm-svn: 109419
* Simplify this code; LoopInfo::getCanonicalInductionVariable will onlyDan Gohman2010-07-201-3/+6
| | | | | | find integer induction variables. llvm-svn: 108853
* Make getOrInsertCanonicalInductionVariable guarantee that itsDan Gohman2010-07-201-2/+2
| | | | | | result is a PHINode*. llvm-svn: 108852
* Fix the order that SCEVExpander considers add operands in so thatDan Gohman2010-07-151-2/+14
| | | | | | | it doesn't miss an opportunity to form a GEP, regardless of the relative loop depths of the operands. This fixes rdar://8197217. llvm-svn: 108475
* remove useless cast and fix typos in commentGabor Greif2010-07-091-3/+3
| | | | llvm-svn: 107989
* cache result of operator*Gabor Greif2010-07-091-3/+5
| | | | llvm-svn: 107988
* cache result of operator*Gabor Greif2010-07-091-5/+7
| | | | llvm-svn: 107976
* Simplify.Dan Gohman2010-06-301-2/+1
| | | | llvm-svn: 107248
* 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
OpenPOWER on IntegriCloud