summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Temporarily disable this assert. Looks like it found a similar issue whenRafael Espindola2012-02-181-1/+3
| | | | | | building bullet. llvm-svn: 150885
* Don't skip debug instructions when looking for the insertion point ofRafael Espindola2012-02-181-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the cast. If we do, we can end up with inst1 --------------- < Insertion point dbg inst new inst instead of the desired inst1 new inst --------------- < Insertion point dbg inst Another option would be for InsertNoopCastOfTo (or its callers) to move the insertion point and we would end up with inst1 dbg inst new inst --------------- < Insertion point but that complicates the callers. This fixes PR12018 (and firefox's build). llvm-svn: 150884
* More dead code removal (using -Wunreachable-code)David Blaikie2012-01-201-1/+0
| | | | llvm-svn: 148578
* SCEVExpander fixes. Affects LSR and indvars.Andrew Trick2012-01-201-115/+114
| | | | | | | | | | | | | | | | LSR has gradually been improved to more aggressively reuse existing code, particularly existing phi cycles. This exposed problems with the SCEVExpander's sloppy treatment of its insertion point. I applied some rigor to the insertion point problem that will hopefully avoid an endless bug cycle in this area. Changes: - Always used properlyDominates to check safe code hoisting. - The insertion point provided to SCEV is now considered a lower bound. This is usually a block terminator or the use itself. Under no cirumstance may SCEVExpander insert below this point. - LSR is reponsible for finding a "canonical" insertion point across expansion of different expressions. - Robust logic to determine whether IV increments are in "expanded" form and/or can be safely hoisted above some insertion point. Fixes PR11783: SCEVExpander assert. llvm-svn: 148535
* Fix a corner case hit by redundant phi elimination running after LSR.Andrew Trick2012-01-141-1/+11
| | | | | | Fixes PR11761: bad IR w/ redundant Phi elim llvm-svn: 148177
* Enable LSR IV Chains with sufficient heuristics.Andrew Trick2012-01-101-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | These heuristics are sufficient for enabling IV chains by default. Performance analysis has been done for i386, x86_64, and thumbv7. The optimization is rarely important, but can significantly speed up certain cases by eliminating spill code within the loop. Unrolled loops are prime candidates for IV chains. In many cases, the final code could still be improved with more target specific optimization following LSR. The goal of this feature is for LSR to make the best choice of induction variables. Instruction selection may not completely take advantage of this feature yet. As a result, there could be cases of slight code size increase. Code size can be worse on x86 because it doesn't support postincrement addressing. In fact, when chains are formed, you may see redundant address plus stride addition in the addressing mode. GenerateIVChains tries to compensate for the common cases. On ARM, code size increase can be mitigated by using postincrement addressing, but downstream codegen currently misses some opportunities. llvm-svn: 147826
* Cleanup comments and argument types related to my previous ↵Andrew Trick2012-01-071-4/+5
| | | | | | replaceCongruentPhis checkin. llvm-svn: 147709
* Extended replaceCongruentPhis to handle mixed phi types.Andrew Trick2012-01-071-13/+61
| | | | llvm-svn: 147707
* Expose isNonConstantNegative to users of ScalarEvolution.Andrew Trick2012-01-071-20/+6
| | | | llvm-svn: 147700
* SCEVExpander: hoistStep should check strict dominance.Andrew Trick2012-01-061-1/+1
| | | | llvm-svn: 147683
* Fix SCEVExpander to handle loops with no preheader when LSR gives it aAndrew Trick2012-01-021-0/+6
| | | | | | | | "phony" insertion point. Fixes rdar://10619599: "SelectionDAGBuilder shouldn't visit PHI nodes!" assert llvm-svn: 147439
* 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
OpenPOWER on IntegriCloud