summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopIndexSplit.cpp
Commit message (Collapse)AuthorAge
* Use do+while instead of while for loops which obviously have aDan Gohman2010-01-05
| | | | | | | non-zero trip count. Use SmallVector's pop_back_val(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92734 91177308-0d34-0410-b5e6-96231b3b80d8
* Add Loop contains utility methods for testing whether a loopDan Gohman2009-12-18
| | | | | | | | | contains another loop, or an instruction. The loop form is substantially more efficient on large loops than the typical code it replaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91654 91177308-0d34-0410-b5e6-96231b3b80d8
* Update various Loop optimization passes to cope with the possibility thatDan Gohman2009-11-05
| | | | | | | LoopSimplify form may not be available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86175 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove ICmpInst::isSignedPredicate which was a reimplementationNick Lewycky2009-10-25
| | | | | | | CmpInst::isSigned. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85037 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80766 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3913, patch by Jakub Staszak!Chris Lattner2009-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80327 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-24
| | | | | | thanks to contexts-on-types. More to come. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
* Get rid of the Pass+Context magic.Owen Anderson2009-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-09
| | | | | | the [I|F]CmpInst constructors. Who knew!? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75200 91177308-0d34-0410-b5e6-96231b3b80d8
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74878 91177308-0d34-0410-b5e6-96231b3b80d8
* Second batch of passes using LLVMContext.Owen Anderson2009-07-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74753 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't try to split a loop when the controlling icmp instructionDan Gohman2009-06-27
| | | | | | | doesn't have an IV-based operand. This fixes PR4471. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74399 91177308-0d34-0410-b5e6-96231b3b80d8
* Support vector casts in more places, fixing a variety of assertionDan Gohman2009-06-15
| | | | | | | | | | | | | | | | failures. To support this, add some utility functions to Type to help support vector/scalar-independent code. Change ConstantInt::get and ConstantFP::get to support vector types, and add an overload to ConstantInt::get that uses a static IntegerType type, for convenience. Introduce a new getConstant method for ScalarEvolution, to simplify common use cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73431 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix loop-index-split to correctly preserve dominance frontiers. Part of Eli Friedman2009-05-22
| | | | | | | | PR4238. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72244 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-06
| | | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
* Reword and tidy up some comments.Dan Gohman2009-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70416 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopIndexSplit needs to inform the loop pass manager of the instructions it isOwen Anderson2009-04-14
| | | | | | | deleting, not just the basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69011 91177308-0d34-0410-b5e6-96231b3b80d8
* Loop Index Split can eliminate a loop if it can determin if loop body is ↵Devang Patel2009-03-30
| | | | | | executed only once. There was a bug in determining IV based value of the iteration for which the loop body is executed. Fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68071 91177308-0d34-0410-b5e6-96231b3b80d8
* Before deleting a basic block, give other loop passes a chance cleanup ↵Devang Patel2009-03-25
| | | | | | analysis values, related to the instructions in the basic block. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67719 91177308-0d34-0410-b5e6-96231b3b80d8
* If branch conditions' one successor is dominating another non-latch ↵Devang Patel2009-03-02
| | | | | | successor then this loop's iteration space can not be restricted. In this example block bb5 is always executed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65902 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopIndexSplit doesn't actually use ScalarEvolution.Dan Gohman2009-02-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64811 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a utility function to LoopInfo to return the exit blockDan Gohman2009-02-12
| | | | | | | | when the loop has exactly one exit, and make use of it in LoopIndexSplit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64388 91177308-0d34-0410-b5e6-96231b3b80d8
* Ignore DbgInfoIntrinsics.Devang Patel2009-02-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63923 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spelling. Devang Patel2008-12-08
| | | | | | | Thanks Duncan! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60702 91177308-0d34-0410-b5e6-96231b3b80d8
* Rewrite code that 1) filters loops and 2) calculates new loop bounds.Devang Patel2008-12-04
| | | | | | | | | This fixes many bugs. I will add more test cases in a separate check-in. Some day, the code that manipulates CFG and updates dom. info could use refactoring help. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60554 91177308-0d34-0410-b5e6-96231b3b80d8
* If the sign of exit condition and split condition does not matchDevang Patel2008-11-10
| | | | | | | then do not split loop index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58995 91177308-0d34-0410-b5e6-96231b3b80d8
* Change create*Pass factory functions to return Pass* instead ofDaniel Dunbar2008-10-22
| | | | | | | | | | | | LoopPass*. - Although less precise, this means they can be used in clients without RTTI (who would otherwise need to include LoopPass.h, which eventually includes things using dynamic_cast). This was the simplest solution that presented itself, but I am happy to use a better one if available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58010 91177308-0d34-0410-b5e6-96231b3b80d8
* Check loop exit predicate properly while eliminating one iteration loop.Devang Patel2008-10-10
| | | | | | | This patch fixes PR 2869 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57369 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo, fix PR 2865.Devang Patel2008-10-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57221 91177308-0d34-0410-b5e6-96231b3b80d8
* splitLoop does not handle split condition EQ.Devang Patel2008-09-18
| | | | | | | Fixes PR 2805 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56321 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not ignore iv uses outside the loop.Devang Patel2008-09-17
| | | | | | | This one slipped through cracks very well. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56284 91177308-0d34-0410-b5e6-96231b3b80d8
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
* Use empty() instead of begin() == end().Dan Gohman2008-08-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54780 91177308-0d34-0410-b5e6-96231b3b80d8
* If loop induction variable's start value is less then its exit value then do ↵Devang Patel2008-07-09
| | | | | | not split the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53265 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a typo in a comment.Dan Gohman2008-06-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52687 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not erase induction variable increment if it is used outside the loop.Devang Patel2008-05-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51280 91177308-0d34-0410-b5e6-96231b3b80d8
* API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif2008-05-16
| | | | | | Legacy interfaces will be in place for some time. (Merge from use-diet branch.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-13
| | | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
* Porting r50563 from Tak to mainline.Bill Wendling2008-05-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50564 91177308-0d34-0410-b5e6-96231b3b80d8
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-06
| | | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
* Iterators folloring a SmallVector erased element are invalidated soDavid Greene2008-04-02
| | | | | | | | | don't access cached iterators from after the erased element. Re-apply 49056 with SmallVector support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49106 91177308-0d34-0410-b5e6-96231b3b80d8
* Reverting 49056 due to the build being broken.Tanya Lattner2008-04-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49060 91177308-0d34-0410-b5e6-96231b3b80d8
* Iterators folloring a SmallVector erased element are invalidated soDavid Greene2008-04-01
| | | | | | | don't access cached iterators from after the erased element. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49056 91177308-0d34-0410-b5e6-96231b3b80d8
* PHI->removeIncomingValue may remove PHInode.Devang Patel2008-03-27
| | | | | | | Increment iterator in advance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48890 91177308-0d34-0410-b5e6-96231b3b80d8
* Add incoming value from header only if phi node has any use inside the loop.Devang Patel2008-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48738 91177308-0d34-0410-b5e6-96231b3b80d8
* If loop header is also loop exiting block then OrigPN is incoming value for ↵Devang Patel2008-02-14
| | | | | | | | | | B loop header. Fixes PR 2030. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47141 91177308-0d34-0410-b5e6-96231b3b80d8
* A loop latch phi node may have uses inside loop, not just in loop header.Devang Patel2008-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47093 91177308-0d34-0410-b5e6-96231b3b80d8
* While moving exit condition, do not drop loop latch on the floor.Devang Patel2008-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47089 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep track of exit value operand number when operands are swapped.Devang Patel2008-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47082 91177308-0d34-0410-b5e6-96231b3b80d8