aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
AgeCommit message (Collapse)AuthorFilesLines
2011-07-22Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad1-2/+1
ArrayRef. llvm-svn: 135761
2011-07-21Convert ConstantExpr::getGetElementPtr andJay Foad1-1/+1
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef. llvm-svn: 135673
2011-07-18land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner1-32/+32
llvm-svn: 135375
2011-07-16Silence compiler warnings.Benjamin Kramer1-5/+4
llvm-svn: 135358
2011-07-16Fix SCEVEXpander to handle arbitrary phi expansion. Includes twoAndrew Trick1-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
2011-07-05Preserve debug loc.Devang Patel1-1/+1
llvm-svn: 134441
2011-06-28Cleanup. Fix a stupid variable name.Andrew Trick1-3/+3
llvm-svn: 133995
2011-06-28SCEVExpander: give new insts a name that identifies the reponsible pass.Andrew Trick1-3/+4
llvm-svn: 133992
2011-06-22New binops need debug loc.Devang Patel1-1/+3
llvm-svn: 133642
2011-03-30Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad1-4/+3
PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
2011-03-30(Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad1-6/+8
llvm-svn: 128535
2011-03-14Added SCEV::NoWrapFlags to manage unsigned, signed, and self wrapAndrew Trick1-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
2011-03-04When decling to reuse existing expressions that involve casts, ignoreDan Gohman1-1/+1
bitcasts, which are really no-ops here. This fixes slowdowns on MultiSource/Applications/aha and others. llvm-svn: 127031
2011-03-02Don't re-use existing addrec expansions if they contain casts.Dan Gohman1-1/+2
This fixes PR9259. llvm-svn: 126812
2010-11-18Introduce memoization for ScalarEvolution dominates and properlyDominatesDan Gohman1-16/+27
queries, and SCEVExpander getRelevantLoop queries. llvm-svn: 119595
2010-11-17Move SCEV::dominates and properlyDominates to ScalarEvolution.Dan Gohman1-2/+2
llvm-svn: 119570
2010-11-17Move SCEV::isLoopInvariant and hasComputableLoopEvolution to be memberDan Gohman1-2/+2
functions of ScalarEvolution, in preparation for memoization and other optimizations. llvm-svn: 119562
2010-07-26Fix SCEVExpander::visitAddRecExpr so that it remembers the induction variableDan Gohman1-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
2010-07-20Simplify this code; LoopInfo::getCanonicalInductionVariable will onlyDan Gohman1-3/+6
find integer induction variables. llvm-svn: 108853
2010-07-20Make getOrInsertCanonicalInductionVariable guarantee that itsDan Gohman1-2/+2
result is a PHINode*. llvm-svn: 108852
2010-07-15Fix the order that SCEVExpander considers add operands in so thatDan Gohman1-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
2010-07-09remove useless cast and fix typos in commentGabor Greif1-3/+3
llvm-svn: 107989
2010-07-09cache result of operator*Gabor Greif1-3/+5
llvm-svn: 107988
2010-07-09cache result of operator*Gabor Greif1-5/+7
llvm-svn: 107976
2010-06-30Simplify.Dan Gohman1-2/+1
llvm-svn: 107248
2010-06-21Use A.append(...) instead of A.insert(A.end(), ...) when A is aDan Gohman1-4/+4
SmallVector, and other SmallVector simplifications. llvm-svn: 106452
2010-06-19Restore a call to rememberInstruction which was accidentally droppedDan Gohman1-0/+1
in refactoring. llvm-svn: 106398
2010-06-19Factor out duplicated code for reusing and inserting casts intoDan Gohman1-54/+46
a helper function. llvm-svn: 106388
2010-06-16A few more places where SCEVExpander bits need to skip over debug intrinsicsJim Grosbach1-3/+4
when iterating through instructions. Yet more work for rdar://7797940 llvm-svn: 106149
2010-06-05LSR needs to remember inserted instructions even in postinc mode, becauseDan Gohman1-1/+3
there could be multiple subexpressions within a single expansion which require insert point adjustment. This fixes PR7306. llvm-svn: 105510
2010-05-03Use getConstant instead of getIntegerSCEV. The two are basically theDan Gohman1-13/+13
same, now that getConstant has overloads consistent with ConstantInt::get. llvm-svn: 102965
2010-04-26When checking whether the special handling for an addrec increment whichDan Gohman1-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
2010-04-15Fix a bunch of namespace polution.Dan Gohman1-0/+4
llvm-svn: 101376
2010-04-09When emitting code for an add, don't force a SCEVUnknown wrapper aroundDan Gohman1-3/+4
a hoisted intermediate result if the intermediate result isn't an Instruction. llvm-svn: 100884
2010-04-09Add a comment.Dan Gohman1-1/+2
llvm-svn: 100874
2010-04-07Generalize IVUsers to track arbitrary expressions rather than expressionsDan Gohman1-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
2010-03-23Don't back past debug info intrinsics; SCEVExpander's strategyDan Gohman1-12/+1
for ignoring debug info intrinsics everywhere else is to advance past them, and it needs to be consistent. llvm-svn: 99332
2010-03-19Fix more places to more thoroughly ignore debug intrinsics. This fixesDan Gohman1-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
2010-03-18Reapply r98755 with a thinko which miscompiled gengtype fixed.Dan Gohman1-18/+10
llvm-svn: 98793
2010-03-17Revert 98755, which may be causing trouble.Dan Gohman1-10/+18
llvm-svn: 98762
2010-03-17Change SCEVNAryExpr's operand array from a SmallVector to a plainDan Gohman1-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
2010-03-09Another place where debug info affected codegen.Dale Johannesen1-0/+2
llvm-svn: 98026
2010-03-06Fix another case where LSR was affected by debug info.Dale Johannesen1-1/+12
llvm-svn: 97865
2010-03-05Fix a case where LSR is sensitive to debug info.Dale Johannesen1-0/+9
llvm-svn: 97830
2010-03-03Make SCEVExpander and LSR more aggressive about hoisting expressions outDan Gohman1-47/+224
of loops. llvm-svn: 97642
2010-03-03Revert r97580; that's not the right way to fix this.Dan Gohman1-121/+31
llvm-svn: 97639
2010-03-02When expanding an expression such as (A + B + C + D), sort the operandsDan Gohman1-31/+121
by loop depth and emit loop-invariant subexpressions outside of loops. This speeds up MultiSource/Applications/viterbi and others. llvm-svn: 97580
2010-03-02Non-affine post-inc SCEV expansions have more code which must beDan Gohman1-1/+1
emitted after the increment. Make sure the insert position reflects this. This fixes PR6453. llvm-svn: 97537
2010-03-01Spelling fixes.Dan Gohman1-4/+4
llvm-svn: 97453
2010-02-17Fix SCEVExpander's existing PHI reuse checking to recognize theDan Gohman1-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