summaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/TailRecursionElimination.cpp
Commit message (Collapse)AuthorAge
* Improve tail call elimination to handle the switch statement.Nick Lewycky2009-11-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86403 91177308-0d34-0410-b5e6-96231b3b80d8
* Oops, FunctionContainsEscapingAllocas is really used to mean two differentNick Lewycky2009-11-07
| | | | | | | things. Back out part of r86349 for a moment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86353 91177308-0d34-0410-b5e6-96231b3b80d8
* Dust off tail recursion elimination. Fix a fixme by applying CaptureTrackingNick Lewycky2009-11-07
| | | | | | | and add a .ll to demo the new capability. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86349 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
* 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
* Improve tail call elim to move loads above readonly callsChris Lattner2009-06-19
| | | | | | | | when it allows forming a tail call. Patch by Frits van Bommel. This implements PR4323. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73752 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
* 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
* Fix a case where tailcallelim wouldn't set the changed bit when it made a ↵Chris Lattner2008-06-14
| | | | | | change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52267 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-15
| | | | | | makefile targets to find these better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 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
* 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
* Become multiple return value aware.Devang Patel2008-03-11
| | | | | | | | Right now, the pass does not optimize tail recursions involving multiple return values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48228 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Transforms to be 4.3 warnings-cleanAnton Korobeynikov2008-02-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47371 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Prevent tailcallelim from breaking "recursive" calls to builtins.Chris Lattner2007-09-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41804 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in comment.Nick Lewycky2007-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36873 91177308-0d34-0410-b5e6-96231b3b80d8
* Drop 'const'Devang Patel2007-05-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-02
| | | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
* Change uses of Function::front to Function::getEntryBlock for readability.Dan Gohman2007-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35265 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code by using value::takenameChris Lattner2007-02-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34176 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes inReid Spencer2007-02-05
| | | | | | | | the Transforms library. This reduces debug library size by 132 KB, debug binary size by 376 KB, and reduces link time for llvm tools slightly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33939 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch over Transforms/Scalar to use the STATISTIC macro. For each statisticChris Lattner2006-12-19
| | | | | | | | converted, we lose a static initializer. This also allows GCC to emit warnings about unused statistics. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32690 91177308-0d34-0410-b5e6-96231b3b80d8
* Detemplatize the Statistic class. The only type it is instantiated withChris Lattner2006-12-06
| | | | | | | is 'unsigned'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR786:Reid Spencer2006-11-02
| | | | | | | | | | | Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting fall out by removing unused variables. Remaining warnings have to do with unused functions (I didn't want to delete code without review) and unused variables in generated code. Maintainers should clean up the remaining issues when they see them. All changes pass DejaGnu tests and Olden. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a workaround for PR962, disabling the more aggressive form of thisChris Lattner2006-10-22
| | | | | | | transformation. This speeds up a C++ app 2.25x. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31113 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate RegisterOpt. It does the same thing as RegisterPass.Chris Lattner2006-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement Transforms/TailCallElim/return-undef.ll, a trivial caseChris Lattner2005-11-05
| | | | | | | that has been sitting in my inbox since May 18. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24194 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the new 'moveBefore' method to simplify some code. Really, which isChris Lattner2005-08-08
| | | | | | | easier to understand? :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22706 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typoCVS: ↵Chris Lattner2005-08-07
| | | | | | ---------------------------------------------------------------------- git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22692 91177308-0d34-0410-b5e6-96231b3b80d8
* * Use the new PHINode::hasConstantValue method to simplify some codeChris Lattner2005-08-07
| | | | | | | | | | | | * Teach this code to move allocas out of the loop when tail call eliminating a call marked 'tail'. This implements TailCallElim/move_alloca_for_tail_call.ll * Do not perform this transformation if a call is marked 'tail' and if there are allocas that we cannot move out of the loop in #2. Doing so would increase the stack usage of the function. This implements fixes PR615 and TailCallElim/dont-tce-tail-marked-call.ll. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22690 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate all remaining tabs and trailing spaces.Jeff Cohen2005-07-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
* If a function contains no allocas, all of the calls in it are triviallyChris Lattner2005-05-09
| | | | | | | suitable for tail calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21836 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
* This mega patch converts us from using Function::a{iterator|begin|end} toChris Lattner2005-03-15
| | | | | | | | | using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*. This patch is contributed by Gabor Greif, thanks! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes For Bug 352Reid Spencer2004-09-01
| | | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust to the new BasicBlock ctor, which requires a function parameterChris Lattner2004-02-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11114 91177308-0d34-0410-b5e6-96231b3b80d8
* Refactor code just a little bit, allowing us to implement ↵Chris Lattner2003-12-14
| | | | | | TailCallElim/return_constant.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10467 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement: TailCallElim/accum_recursion_constant_arg.llChris Lattner2003-12-08
| | | | | | | Also make sure to clean up any PHI nodes that are inserted which are pointless. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10333 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement: test/Regression/Transforms/TailCallElim/accum_recursion.llChris Lattner2003-12-08
| | | | | | | | | We now insert accumulator variables as necessary to eliminate tail recursion more aggressively. This is still fairly limited, but allows us to transform fib/factorial, and other functions into nice happy loops. :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10332 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup and restructure the code to make it easier to read and maintain.Chris Lattner2003-12-08
| | | | | | | | | | | | | | | The only functionality change is that we now implement: Regression/Transforms/TailCallElim/intervening-inst.ll Which is really kinda pointless, because it means that trivially dead code does not interfere with -tce, but trivially dead code probably wouldn't be around anytime when this pass is run anyway. The point of including this change it to support other more aggressive transformations when we have the analysis capabilities to do so. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10312 91177308-0d34-0410-b5e6-96231b3b80d8
* Minor cleanups and simplificationsChris Lattner2003-11-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10127 91177308-0d34-0410-b5e6-96231b3b80d8
* Start using the nicer terminator auto-insertion APIChris Lattner2003-11-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10111 91177308-0d34-0410-b5e6-96231b3b80d8
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-20
| | | | | | | Header files will be on the way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Function::getEntryNode -> getEntryBlockChris Lattner2003-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8625 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a really obvious huge gaping bug, add a commentChris Lattner2003-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8620 91177308-0d34-0410-b5e6-96231b3b80d8
* Expose the TCE passChris Lattner2003-09-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8619 91177308-0d34-0410-b5e6-96231b3b80d8
* New transformation: tail recursion eliminationChris Lattner2003-09-20
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8618 91177308-0d34-0410-b5e6-96231b3b80d8