summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Spelling fixes.Dan Gohman2010-03-011-6/+6
| | | | llvm-svn: 97453
* Make LoopSimplify change conditional branches in loop exiting blocksDan Gohman2010-02-251-12/+17
| | | | | | | | | | | | which branch on undef to branch on a boolean constant for the edge exiting the loop. This helps ScalarEvolution compute trip counts for loops. Teach ScalarEvolution to recognize single-value PHIs, when safe, and ForgetSymbolicName to forget such single-value PHI nodes as apprpriate in ForgetSymbolicName. llvm-svn: 97126
* Remove unused variables and parameters.Dan Gohman2010-02-221-9/+5
| | | | llvm-svn: 96780
* This cast<Instruction> is unnecessary.Dan Gohman2010-02-221-1/+1
| | | | llvm-svn: 96771
* recommit 96626, evidence that it broke things appearsDale Johannesen2010-02-191-0/+7
| | | | | | to be spurious llvm-svn: 96662
* Revert 96626, which causes build failure on ppc Darwin.Dale Johannesen2010-02-191-7/+0
| | | | llvm-svn: 96653
* Indvars needs to explicitly notify ScalarEvolution when it is replacingDan Gohman2010-02-181-0/+7
| | | | | | | | a loop exit value, so that if a loop gets deleted, ScalarEvolution isn't stick holding on to dangling SCEVAddRecExprs for that loop. This fixes PR6339. llvm-svn: 96626
* Hoist this loop-invariant logic out of the loop.Dan Gohman2010-02-181-4/+6
| | | | llvm-svn: 96614
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-2/+2
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Reapply the new LoopStrengthReduction code, with compile time andDan Gohman2010-02-121-74/+60
| | | | | | | | | | 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
* Fix "the the" and similar typos.Dan Gohman2010-02-101-1/+1
| | | | llvm-svn: 95781
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-211-4/+10
| | | | | | | | | | | | | | 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
* Set Changed properly after calling DeleteDeadPHIs.Dan Gohman2010-01-051-1/+1
| | | | llvm-svn: 92735
* Change errs() to dbgs().David Greene2010-01-051-4/+4
| | | | llvm-svn: 92609
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-181-1/+1
| | | | | | | | contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. llvm-svn: 91654
* Update various Loop optimization passes to cope with the possibility thatDan Gohman2009-11-051-1/+3
| | | | | | LoopSimplify form may not be available. llvm-svn: 86175
* Rename forgetLoopBackedgeTakenCount to forgetLoop, because itDan Gohman2009-10-311-1/+1
| | | | | | clears out more information than just the stored backedge taken count. llvm-svn: 85664
* Factor out redundancy from clone() implementations.Devang Patel2009-10-271-1/+1
| | | | llvm-svn: 85327
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-271-1/+1
| | | | | | update all the callers. llvm-svn: 82889
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-021-2/+1
| | | | llvm-svn: 80766
* Special-case static allocas in IndVarSimplify's loop invariantDan Gohman2009-08-251-0/+5
| | | | | | | | sinking code, since they are special. If the loop preheader happens to be the entry block of a function, don't sink static allocas out of it. This fixes PR4775. llvm-svn: 80010
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-231-11/+12
| | | | | | This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
* Fix debug output to include a newline after printing a Value, nowDan Gohman2009-08-171-4/+4
| | | | | | that Value's operator<< doesn't include one. llvm-svn: 79240
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-7/+11
| | | | llvm-svn: 78948
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-3/+1
| | | | llvm-svn: 77635
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-261-1/+1
| | | | llvm-svn: 77152
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-3/+3
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-5/+7
| | | | llvm-svn: 76702
* Switch invars away from using isTrapping when it really shouldn't be Eli Friedman2009-07-151-1/+7
| | | | | | using it. llvm-svn: 75852
* Fix indentation.Dan Gohman2009-07-151-18/+18
| | | | llvm-svn: 75723
* Require IVUsers after LCSSA, since LCSSA does not preserve IVUsers.Dan Gohman2009-07-141-3/+3
| | | | | | | This results in the pass manager running IVUsers only once for indvars, instead of twice. llvm-svn: 75633
* Fix indvars to not assume that a loop with a single unique exitDan Gohman2009-07-141-7/+5
| | | | | | block has a single unique exiting block. llvm-svn: 75579
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-4/+4
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* Change all SCEV* to SCEV *.Dan Gohman2009-07-071-12/+12
| | | | llvm-svn: 74918
* Convert the first batch of passes to use LLVMContext.Owen Anderson2009-07-031-4/+5
| | | | llvm-svn: 74748
* Request LCSSA after LoopSimplify. This fixes a problem in which theDan Gohman2009-07-011-1/+1
| | | | | | | PassManager was scheduling LCSSA before LoopSimplify, which does not preserve LCSSA. llvm-svn: 74661
* When a value is used multiple times within a single PHI, instructionsDan Gohman2009-06-271-3/+15
| | | | | | | | inserted to replace that value must dominate all of of the basic blocks associated with the uses of the value in the PHI, not just one of them. llvm-svn: 74376
* Incorporate the insertion point into the key of SCEVExpander's CSE map.Dan Gohman2009-06-261-121/+43
| | | | | | | | | | | | | | 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
* When inserting code into a loop preheader, insert it before theDan Gohman2009-06-241-3/+6
| | | | | | | | terminator, instead of after the last phi. This fixes a bug exposed by ScalarEvolution analyzing more kinds of loops. This fixes PR4436. llvm-svn: 74072
* Extend ScalarEvolution's multiple-exit support to compute exactDan Gohman2009-06-241-27/+19
| | | | | | | | | | | | | | | 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/+0
| | | | llvm-svn: 73910
* SCEVHandle is no more!Owen Anderson2009-06-221-13/+13
| | | | llvm-svn: 73906
* Fix this code to correctly handle loops with multiple exits. UntilDan Gohman2009-06-221-4/+4
| | | | | | | | now, this hasn't mattered, because ScalarEvolution hasn't been able to compute trip counts for loops with multiple exits. But it will soon. llvm-svn: 73864
* Add another item to the list of things that indvars does.Dan Gohman2009-06-141-1/+4
| | | | llvm-svn: 73355
* Teach SCEVExpander's visitAddRecExpr to reuse an existing canonicalDan Gohman2009-06-131-71/+24
| | | | | | | | | | | | | | | | | induction variable when the addrec to be expanded does not require a wider type. This eliminates the need for IndVarSimplify to micro-manage SCEV expansions, because SCEVExpander now automatically expands them in the form that IndVarSimplify considers to be canonical. (LSR still micro-manages its SCEV expansions, because it's optimizing for the target, rather than for other optimizations.) Also, this uses the new getAnyExtendExpr, which has more clever expression simplification logic than the IndVarSimplify code it replaces, and this cleans up some ugly expansions in code such as the included masked-iv.ll testcase. llvm-svn: 73294
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-041-1/+1
| | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt llvm-svn: 72897
* Don't attempt to simplify an non-affine IV expression if it can'tDan Gohman2009-06-031-12/+10
| | | | | | be simplified to a loop-invariant value. This fixes PR4315. llvm-svn: 72798
* Change ScalarEvolution::getSCEVAtScope to always return the original valueDan Gohman2009-05-241-4/+2
| | | | | | | | in the case where a loop exit value cannot be computed, instead of only in some cases while using SCEVCouldNotCompute in others. This simplifies getSCEVAtScope's callers. llvm-svn: 72375
* Move Rewriter.clear() earlier, to avoid triggerring the AssertingVH byTorok Edwin2009-05-241-2/+8
| | | | | | | one of the RecursivelyDeleteTriviallyDeadInstructions. Add a comment explaining why the cache needs to be cleared. llvm-svn: 72372
* Instead of clearing the rewriter, don't attempt to rewrite dead phi nodes.Torok Edwin2009-05-241-2/+2
| | | | | | Also fix 80 column violation. llvm-svn: 72371
OpenPOWER on IntegriCloud