summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/LoopUnroll.cpp
Commit message (Collapse)AuthorAge
* Don't #include heavy Dominators.h file in LoopInfo.h. This change reducesJakub Staszak2013-12-07
| | | | | | | overall time of LLVM compilation by ~1%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196667 91177308-0d34-0410-b5e6-96231b3b80d8
* Utils/LoopUnroll.cpp: Tweak (StringRef)OldName to be valid until it is used, ↵NAKAMURA Takumi2013-11-17
| | | | | | | | since r194601. eraseFromParent() invalidates OldName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194970 91177308-0d34-0410-b5e6-96231b3b80d8
* Use StringRef instead of std::stringJakub Staszak2013-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194601 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace some unnecessary vector copies with references.Benjamin Kramer2013-09-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190770 91177308-0d34-0410-b5e6-96231b3b80d8
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-02
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-03
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopUnroll: always check for NULL LoopPassManagerAndrew Trick2012-06-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158007 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow NULL LoopPassManager argument in UnrollLoop. PR12734.Andrew Trick2012-05-08
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156358 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix 12513: Loop unrolling breaks with indirect branches.Andrew Trick2012-04-10
| | | | | | | | Take this opportunity to generalize the indirectbr bailout logic for loop transformations. CFG transformations will never get indirectbr right, and there's no point trying. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154386 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid a confusing assert for silly options: -unroll-runtime -unroll-count=1.Andrew Trick2011-12-16
| | | | | | | No need for an explicit test case for an unsupported combination of options. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146721 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -unroll-runtime for unrolling loops with run-time trip counts.Andrew Trick2011-12-09
| | | | | | | | | | | | | | Patch by Brendon Cahoon! This extends the existing LoopUnroll and LoopUnrollPass. Brendon measured no regressions in the llvm test suite with -unroll-runtime enabled. This implementation works by using the existing loop unrolling code to unroll the loop by a power-of-two (default 8). It generates an if-then-else sequence of code prior to the loop to execute the extra iterations before entering the unrolled loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146245 91177308-0d34-0410-b5e6-96231b3b80d8
* Comments. Thanks for the spell check Nick!Andrew Trick2011-08-10
| | | | | | | Also, my apologies for spoiling the autocomplete on SimplifyInstructions.cpp. I couldn't think of a better filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137229 91177308-0d34-0410-b5e6-96231b3b80d8
* Invoke SimplifyIndVar when we partially unroll a loop. Fixes PR10534.Andrew Trick2011-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137203 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup. Added LoopBlocksDFS::perform for simple clients.Andrew Trick2011-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137195 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix the LoopUnroller to handle nontrivial loops and partial unrolling.Andrew Trick2011-08-10
| | | | | | | | | | | These are not individual bug fixes. I had to rewrite a good chunk of the unroller to make it sane. I think it was getting lucky on trivial completely unrolled loops with no early exits. I included some fairly simple unit tests for partial unrolling. I didn't do much stress testing, so it may not be perfect, but should be usable now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137190 91177308-0d34-0410-b5e6-96231b3b80d8
* LoopUnroll looks like it has some stale code. Remove it to prove my sanity ↵Andrew Trick2011-08-09
| | | | | | and avoid further confusion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137106 91177308-0d34-0410-b5e6-96231b3b80d8
* SCEV: Use AssertingVH to catch dangling BasicBlock* when passes forgetAndrew Trick2011-08-03
| | | | | | | to notify SCEV of a change. Add forgetLoop in a couple of those places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136797 91177308-0d34-0410-b5e6-96231b3b80d8
* Add clarifying comments for the new arguments to UnrollLoop.Andrew Trick2011-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135988 91177308-0d34-0410-b5e6-96231b3b80d8
* Move trip count discovery outside of the generic LoopUnroll helper. ThisAndrew Trick2011-07-23
| | | | | | | removes its dependence on canonical induction variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135829 91177308-0d34-0410-b5e6-96231b3b80d8
* whitespaceAndrew Trick2011-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135828 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r133513 (reverted in r133700) with an additional fix for aJay Foad2011-06-23
| | | | | | | -Wshorten-64-to-32 warning in Instructions.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133708 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r133513:Eric Christopher2011-06-23
| | | | | | | | | | | "Reinstate r133435 and r133449 (reverted in r133499) now that the clang self-hosted build failure has been fixed (r133512)." Due to some additional warnings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133700 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused variables.Benjamin Kramer2011-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133514 91177308-0d34-0410-b5e6-96231b3b80d8
* Reinstate r133435 and r133449 (reverted in r133499) now that the clangJay Foad2011-06-21
| | | | | | self-hosted build failure has been fixed (r133512). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133513 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r133435 and r133449 to appease buildbots.Chad Rosier2011-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133499 91177308-0d34-0410-b5e6-96231b3b80d8
* Change how PHINodes store their operands.Jay Foad2011-06-20
| | | | | | | | | | | | | | | | | | | | Change PHINodes to store simple pointers to their incoming basic blocks, instead of full-blown Uses. Note that this loses an optimization in SplitCriticalEdge(), because we can no longer walk the use list of a BasicBlock to find phi nodes. See the comment I removed starting "However, the foreach loop is slow for blocks with lots of predecessors". Extend replaceAllUsesWith() on a BasicBlock to also update any phi nodes in the block's successors. This mimics what would have happened when PHINodes were proper Users of their incoming blocks. (Note that this only works if OldBB->replaceAllUsesWith(NewBB) is called when OldBB still has a terminator instruction, so it still has some successors.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133435 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't unroll loops whose header block's address is taken.Chris Lattner2011-02-18
| | | | | | | | | | | | | | | | | | | This is part of a futile attempt to not "break" bizzaro code like this: l1: printf("l1: %p\n", &&l1); ++x; if( x < 3 ) goto l1; Previously we'd fold &&l1 to 1, which is fine per our semantics but not helpful to the user. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125827 91177308-0d34-0410-b5e6-96231b3b80d8
* random cleanupsChris Lattner2011-01-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123221 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all uses of the "ugly" method BranchInst::setUnconditionalDest().Jay Foad2011-01-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123025 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace calls to ConstantFoldInstruction with calls to SimplifyInstructionDuncan Sands2010-11-23
| | | | | | | | in two places that are really interested in simplified instructions, not constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120044 91177308-0d34-0410-b5e6-96231b3b80d8
* Be more consistent in using ValueToValueMapTy.Rafael Espindola2010-10-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116387 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve ScalarEvolution in the loop unroller.Dan Gohman2010-07-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109412 91177308-0d34-0410-b5e6-96231b3b80d8
* Use ValueMap instead of DenseMap.Devang Patel2010-06-24
| | | | | | | The ValueMapper used by various cloning utility maps MDNodes also. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106706 91177308-0d34-0410-b5e6-96231b3b80d8
* Cosmetic change.Devang Patel2010-06-23
| | | | | | | Do not use "ValueMap" as a name for a local variable or an argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106698 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename ValueMapTy as ValueToValueMapTy to clearly indicate that this has no ↵Devang Patel2010-04-20
| | | | | | replationship with ADT/ValueMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101950 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a DominatorTree argument to isLCSSA so that it doesn't have toDan Gohman2010-03-10
| | | | | | | | compute a set of reachable blocks for itself each time it is called, which is fairly frequently. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98179 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't bother with sprintf, just pass the Twine through.Benjamin Kramer2010-01-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94684 91177308-0d34-0410-b5e6-96231b3b80d8
* Change errs() to dbgs().David Greene2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92600 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
* remove a bunch of extraneous LLVMContext argumentsChris Lattner2009-11-06
| | | | | | | from various APIs, addressing PR5325. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86231 91177308-0d34-0410-b5e6-96231b3b80d8
* Teach LoopUnroll how to bail if LoopSimplify can't give it what it needs.Dan Gohman2009-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86164 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r85667. LoopUnroll currently can't call utility functions whichDan Gohman2009-10-31
| | | | | | | | auto-update the DominatorTree because it doesn't keep the DominatorTree current while it works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85670 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge the enhancements from LoopUnroll's FoldBlockIntoPredecessor intoDan Gohman2009-10-31
| | | | | | | | MergeBlockIntoPredecessor. This makes SimplifyCFG slightly more aggressive, and makes it unnecessary for LoopUnroll to have its own copy of this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85667 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify this code.Dan Gohman2009-10-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85662 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename UnrollLoop.cpp to LoopUnroll.cpp, and LoopUnroll.cpp toDan Gohman2009-10-31
LoopUnrollPass.cpp, for consistency with other passes which are similarly split. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85659 91177308-0d34-0410-b5e6-96231b3b80d8