summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Add a comment.Dan Gohman2010-01-211-1/+2
| | | | llvm-svn: 94104
* Re-implement the main strength-reduction portion of LoopStrengthReduction.Dan Gohman2010-01-211-2269/+2305
| | | | | | | | | | | | | | 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
* Remove dump routine and the associated Debug.h from a header. Patch upDavid Greene2009-12-231-36/+36
| | | | | | other files to compensate. llvm-svn: 92075
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-181-13/+13
| | | | | | | | 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
* Minor code simplification.Dan Gohman2009-12-181-4/+1
| | | | llvm-svn: 91653
* Don't pass const pointers by reference.Dan Gohman2009-12-181-13/+13
| | | | llvm-svn: 91647
* Reapply LoopStrengthReduce and IVUsers cleanups, excluding the partDan Gohman2009-12-181-70/+30
| | | | | | | | of 91296 that caused trouble -- the Processed list needs to be preserved for the livetime of the pass, as AddUsersIfInteresting is called from other passes. llvm-svn: 91641
* Revert 91280-91283, 91286-91289, 91291, 91293, 91295-91296. It apparently ↵Evan Cheng2009-12-171-30/+70
| | | | | | introduced a non-deterministic behavior in the optimizer somewhere. llvm-svn: 91598
* Delete an unused function.Dan Gohman2009-12-151-38/+0
| | | | llvm-svn: 91432
* Fix a thinko; isNotAlreadyContainedIn had a built-in negative, so theDan Gohman2009-12-141-1/+1
| | | | | | condition was inverted when the code was converted to contains(). llvm-svn: 91295
* Remove unnecessary #includes.Dan Gohman2009-12-141-2/+0
| | | | llvm-svn: 91293
* Instead of having a ScalarEvolution pointer member in BasedUser, just passDan Gohman2009-12-141-12/+13
| | | | | | the ScalarEvolution pointer into the functions which need it. llvm-svn: 91289
* Don't bother cleaning up if there's nothing to clean up.Dan Gohman2009-12-141-6/+6
| | | | llvm-svn: 91288
* Delete an unused variable.Dan Gohman2009-12-141-10/+1
| | | | llvm-svn: 91287
* LSR itself doesn't need LoopInfo.Dan Gohman2009-12-141-6/+2
| | | | llvm-svn: 91283
* LSR itself doesn't need DominatorTree.Dan Gohman2009-12-141-6/+2
| | | | llvm-svn: 91282
* Remove the code in LSR that manually hoists expansions out of loops;Dan Gohman2009-12-141-29/+9
| | | | | | SCEVExpander does this automatically. llvm-svn: 91281
* Minor code cleanups.Dan Gohman2009-12-141-4/+2
| | | | llvm-svn: 91280
* grammarJim Grosbach2009-11-171-2/+2
| | | | llvm-svn: 89145
* 80-column violationsJim Grosbach2009-11-171-8/+11
| | | | llvm-svn: 89123
* Generalize OptimizeLoopTermCond to optimize more loop terminating icmp to ↵Evan Cheng2009-11-171-87/+99
| | | | | | use postinc iv. llvm-svn: 89116
* Remove trailing whitespaceJim Grosbach2009-11-171-74/+74
| | | | llvm-svn: 89110
* - Teach LSR to avoid changing cmp iv stride if it will create an immediate thatEvan Cheng2009-11-121-209/+355
| | | | | | | | | | | | | | cannot be folded into target cmp instruction. - Avoid a phase ordering issue where early cmp optimization would prevent the later count-to-zero optimization. - Add missing checks which could cause LSR to reuse stride that does not have users. - Fix a bug in count-to-zero optimization code which failed to find the pre-inc iv's phi node. - Remove, tighten, loosen some incorrect checks disable valid transformations. - Quite a bit of code clean up. llvm-svn: 86969
* Block terminator may be a switch.Evan Cheng2009-11-111-1/+1
| | | | llvm-svn: 86761
* Generalize lsr code that optimize loop to count down towards zero.Evan Cheng2009-11-101-80/+126
| | | | llvm-svn: 86715
* Teach LSR to avoid calling SplitCriticalEdge on edges with indirectbr.Dan Gohman2009-11-051-0/+1
| | | | llvm-svn: 86193
* Update various Loop optimization passes to cope with the possibility thatDan Gohman2009-11-051-0/+4
| | | | | | LoopSimplify form may not be available. llvm-svn: 86175
* Make LSR's OptimizeShadowIV ignore induction variables with negativeDan Gohman2009-10-261-0/+4
| | | | | | | | | | strides for now, because it doesn't handle them correctly. This fixes a miscompile of SingleSource/Benchmarks/Misc-C++/ray. This problem was usually hidden because indvars transforms such induction variables into negations of canonical induction variables. llvm-svn: 85118
* Remove ICmpInst::isSignedPredicate which was a reimplementationNick Lewycky2009-10-251-2/+2
| | | | | | CmpInst::isSigned. llvm-svn: 85037
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-271-3/+1
| | | | | | update all the callers. llvm-svn: 82889
* Re-apply r80926, with fixes: keep the domtree informed of new blocksDan Gohman2009-09-081-7/+8
| | | | | | | | | | | | | | | that get created during loop unswitching, and fix SplitBlockPredecessors' LCSSA updating code to create new PHIs instead of trying to just move existing ones. Also, optimize Loop::verifyLoop, since it gets called a lot. Use searches on a sorted list of blocks instead of calling the "contains" function, as is done in other places in the Loop class, since "contains" does a linear search. Also, don't call verifyLoop from LoopSimplify or LCSSA, as the PassManager is already calling verifyLoop as part of LoopInfo's verifyAnalysis. llvm-svn: 81221
* Revert r80926. It causes loop unswitch assertion and slow down some JIT ↵Evan Cheng2009-09-061-8/+7
| | | | | | tests significantly. llvm-svn: 81101
* Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verifyDan Gohman2009-09-031-7/+8
| | | | | | | | | that these passes are properly preserved. Fix several transformation passes that claimed to preserve LoopSimplify form but weren't. llvm-svn: 80926
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-021-4/+3
| | | | llvm-svn: 80766
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-231-29/+31
| | | | | | This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-7/+14
| | | | llvm-svn: 78948
* Rename MVT to EVT, in preparation for splitting SimpleValueType out into its ↵Owen Anderson2009-08-101-1/+1
| | | | | | own struct type. llvm-svn: 78610
* Check for !isa<Constant> instead of isa<Instruction>. ThisDan Gohman2009-08-041-1/+1
| | | | | | | matches what the comment says, and it avoids spurious BitCast instructions for Argument values. llvm-svn: 78121
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-3/+1
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Eliminate a few unused-variable warningsDouglas Gregor2009-07-291-2/+0
| | | | llvm-svn: 77519
* Move types back to the 2.5 API.Owen Anderson2009-07-291-1/+1
| | | | llvm-svn: 77516
* Move ConstantExpr to 2.5 API.Owen Anderson2009-07-291-1/+1
| | | | llvm-svn: 77494
* Move ConstantFP construction back to the 2.5-ish API.Owen Anderson2009-07-271-4/+2
| | | | llvm-svn: 77247
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-261-5/+4
| | | | llvm-svn: 77152
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-5/+3
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-9/+19
| | | | llvm-svn: 76702
* Make Loop and MachineLoop be subclasses of LoopBase, rather than typedefs,Dan Gohman2009-07-131-1/+1
| | | | | | | | | | using the Curiously Recurring Template Pattern with LoopBase. This will help further refactoring, and future functionality for Loop. Also, Headers can now foward-declare Loop, instead of pulling in LoopInfo.h or doing tricks. llvm-svn: 75519
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-091-5/+4
| | | | | | the [I|F]CmpInst constructors. Who knew!? llvm-svn: 75200
* Change all SCEV* to SCEV *.Dan Gohman2009-07-071-103/+103
| | | | llvm-svn: 74918
OpenPOWER on IntegriCloud