summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r124518. It broke Linux self-host.Evan Cheng2011-01-291-105/+19
| | | | llvm-svn: 124522
* Re-commit r124462 with fixes. Tail recursion elim will now dup ret into ↵Evan Cheng2011-01-291-19/+105
| | | | | | unconditional predecessor to enable TCE on demand. llvm-svn: 124518
* Have a few places that want to simplify phi nodes use SimplifyInstructionDuncan Sands2010-11-161-1/+2
| | | | | | rather than calling hasConstantValue. No intended functionality change. llvm-svn: 119352
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-1/+1
| | | | llvm-svn: 115996
* tidy upChris Lattner2010-08-311-31/+32
| | | | llvm-svn: 112643
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-1/+1
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-1/+1
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* Fix batch of converting RegisterPass<> to INTIALIZE_PASS().Owen Anderson2010-07-211-1/+2
| | | | llvm-svn: 109045
* Handle the case of a tail recursion in which the tail call is followedDuncan Sands2010-07-131-13/+35
| | | | | | | | | by a return that returns a constant, while elsewhere in the function another return instruction returns a different constant. This is a special case of accumulator recursion, so just generalize the existing logic a bit. llvm-svn: 108241
* cache dereferenced iteratorsGabor Greif2010-07-121-3/+4
| | | | llvm-svn: 108131
* The accumulator tail recursion transform claims to work for any associativeDuncan Sands2010-07-101-14/+14
| | | | | | | | | | | | | | | | operation, but the way it's implemented requires the operation to also be commutative. So add a check for commutativity (and tweak the corresponding comments). This makes no difference in practice since every associative LLVM instruction is also commutative! Here's an example to show the need for commutativity: the accum_recursion.ll testcase calculates the factorial function. Before the transformation the result of a call is ((((1*1)*2)*3)...)*x while afterwards it is (((1*x)*(x-1))...*2)*1 which clearly requires both associativity and commutativity of * to be equal to the original. llvm-svn: 108056
* Fix PR7328: when turning a tail recursion into a loop, need to preserveDuncan Sands2010-06-261-6/+6
| | | | | | | | the returned value after the tail call if it differs from other return values. The optimal thing to do would be to introduce a phi node for the return value, but for the moment just fix the miscompile. llvm-svn: 106947
* use getNumArgOperandsGabor Greif2010-06-241-1/+1
| | | | llvm-svn: 106709
* use ArgOperand APIGabor Greif2010-06-241-2/+2
| | | | llvm-svn: 106707
* Move FindAvailableLoadedValue isSafeToLoadUnconditionally out ofDan Gohman2010-05-281-0/+1
| | | | | | | lib/Transforms/Utils and into lib/Analysis so that Analysis passes can use them. llvm-svn: 104949
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-161-2/+2
| | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
* Refine the detection of seemingly infinitely recursive calls where theDan Gohman2010-04-161-9/+21
| | | | | | | callee is expected to be expanded to something else by codegen, so that normal infinitely recursive calls are still transformed. llvm-svn: 101468
* reapply r101434Gabor Greif2010-04-161-2/+2
| | | | | | | | | | | | | with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101465
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-161-2/+2
| | | | llvm-svn: 101434
* reapply r101364, which has been backed out in r101368Gabor Greif2010-04-151-2/+2
| | | | | | | | | | | | | with a fix rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101397
* back out r101364, as it trips the linux nightlybot on some clang C++ testsGabor Greif2010-04-151-2/+2
| | | | llvm-svn: 101368
* rotate CallInst operands, i.e. move callee to the backGabor Greif2010-04-151-2/+2
| | | | | | | | | | of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary llvm-svn: 101364
* Revert 94937 and move the noreturn check to codegen.Evan Cheng2010-02-031-5/+4
| | | | llvm-svn: 95198
* Do not mark no-return calls tail calls. It'll screw up special calls like ↵Evan Cheng2010-01-311-4/+5
| | | | | | longjmp and it doesn't make much sense for performance reason. If my logic is faulty, please let me know. llvm-svn: 94937
* Check alignment of loads when deciding whether it is safe to execute themBob Wilson2010-01-301-1/+2
| | | | | | | unconditionally. Besides checking the offset, also check that the underlying object is aligned as much as the load itself. llvm-svn: 94875
* Improve tail call elimination to handle the switch statement.Nick Lewycky2009-11-071-2/+11
| | | | llvm-svn: 86403
* Oops, FunctionContainsEscapingAllocas is really used to mean two differentNick Lewycky2009-11-071-2/+10
| | | | | | things. Back out part of r86349 for a moment. llvm-svn: 86353
* Dust off tail recursion elimination. Fix a fixme by applying CaptureTrackingNick Lewycky2009-11-071-21/+8
| | | | | | and add a .ll to demo the new capability. llvm-svn: 86349
* eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861Chris Lattner2009-09-021-2/+1
| | | | llvm-svn: 80766
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-1/+1
| | | | llvm-svn: 78948
* Improve tail call elim to move loads above readonly callsChris Lattner2009-06-191-1/+15
| | | | | | | when it allows forming a tail call. Patch by Frits van Bommel. This implements PR4323. llvm-svn: 73752
* Allow readonly functions to unwind exceptions. TeachDuncan Sands2009-05-061-1/+1
| | | | | | | | the optimizers about this. For example, a readonly function with no uses cannot be removed unless it is also marked nounwind. llvm-svn: 71071
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Fix a case where tailcallelim wouldn't set the changed bit when it made a ↵Chris Lattner2008-06-141-1/+3
| | | | | | change. llvm-svn: 52267
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-1/+2
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-2/+3
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-6/+6
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
* Become multiple return value aware.Devang Patel2008-03-111-1/+5
| | | | | | | Right now, the pass does not optimize tail recursions involving multiple return values. llvm-svn: 48228
* Make Transforms to be 4.3 warnings-cleanAnton Korobeynikov2008-02-201-2/+2
| | | | llvm-svn: 47371
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Prevent tailcallelim from breaking "recursive" calls to builtins.Chris Lattner2007-09-101-0/+9
| | | | llvm-svn: 41804
* Fix typo in comment.Nick Lewycky2007-05-061-1/+1
| | | | llvm-svn: 36873
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-0/+4
| | | | llvm-svn: 36632
* Change uses of Function::front to Function::getEntryBlock for readability.Dan Gohman2007-03-221-1/+1
| | | | llvm-svn: 35265
* Simplify code by using value::takenameChris Lattner2007-02-111-2/+3
| | | | llvm-svn: 34176
* Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes inReid Spencer2007-02-051-1/+2
| | | | | | | 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. llvm-svn: 33939
OpenPOWER on IntegriCloud