Owen Anderson
55f1c09e31
Push LLVMContexts through the IntegerType APIs.
...
llvm-svn: 78948
2009-08-13 21:58:54 +00:00
Chris Lattner
5ca4197829
Improve tail call elim to move loads above readonly calls
...
when it allows forming a tail call. Patch by Frits van
Bommel. This implements PR4323.
llvm-svn: 73752
2009-06-19 04:22:16 +00:00
Duncan Sands
1efabaaa2a
Allow readonly functions to unwind exceptions. Teach
...
the optimizers about this. For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.
llvm-svn: 71071
2009-05-06 06:49:50 +00:00
Dan Gohman
a79db30d28
Tidy up several unbeseeming casts from pointer to intptr_t.
...
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Chris Lattner
a88cd4ea2a
Fix a case where tailcallelim wouldn't set the changed bit when it made a change.
...
llvm-svn: 52267
2008-06-14 00:49:48 +00:00
Gabor Greif
697e94cc22
Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
...
llvm-svn: 51143
2008-05-15 10:04:30 +00:00
Dan Gohman
d78c400b5b
Clean up the use of static and anonymous namespaces. This turned up
...
several things that were neither in an anonymous namespace nor static
but not intended to be global.
llvm-svn: 51017
2008-05-13 00:00:25 +00:00
Gabor Greif
e9ecc68d8f
API changes for class Use size reduction, wave 1.
...
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.
llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Devang Patel
5663fe6613
Become multiple return value aware.
...
Right now, the pass does not optimize tail recursions
involving multiple return values.
llvm-svn: 48228
2008-03-11 17:33:32 +00:00
Anton Korobeynikov
1bfd121321
Make Transforms to be 4.3 warnings-clean
...
llvm-svn: 47371
2008-02-20 11:26:25 +00:00
Chris Lattner
f3ebc3f3d2
Remove attribution from file headers, per discussion on llvmdev.
...
llvm-svn: 45418
2007-12-29 20:36:04 +00:00
Chris Lattner
c75cbe6473
Prevent tailcallelim from breaking "recursive" calls to builtins.
...
llvm-svn: 41804
2007-09-10 20:58:55 +00:00
Nick Lewycky
e7da2d6ac3
Fix typo in comment.
...
llvm-svn: 36873
2007-05-06 13:37:16 +00:00
Devang Patel
8c78a0bff0
Drop 'const'
...
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel
e95c6ad802
Use 'static const char' instead of 'static const int'.
...
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.
llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel
09f162ca6a
Do not use typeinfo to identify pass in pass manager.
...
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Dan Gohman
dcb291faa4
Change uses of Function::front to Function::getEntryBlock for readability.
...
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Chris Lattner
6e0123b17f
Simplify code by using value::takename
...
llvm-svn: 34176
2007-02-11 01:23:03 +00:00
Reid Spencer
557ab15e71
Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
...
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
2007-02-05 23:32:05 +00:00
Chris Lattner
79a42ac941
Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic
...
converted, we lose a static initializer. This also allows GCC to emit warnings
about unused statistics.
llvm-svn: 32690
2006-12-19 21:40:18 +00:00
Chris Lattner
700b873130
Detemplatize the Statistic class. The only type it is instantiated with
...
is 'unsigned'.
llvm-svn: 32279
2006-12-06 17:46:33 +00:00
Reid Spencer
de46e48420
For PR786:
...
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.
llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Chris Lattner
250eff20da
Add a workaround for PR962, disabling the more aggressive form of this
...
transformation. This speeds up a C++ app 2.25x.
llvm-svn: 31113
2006-10-22 18:42:26 +00:00
Chris Lattner
c2d3d3112e
eliminate RegisterOpt. It does the same thing as RegisterPass.
...
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
16b29e9562
Implement Transforms/TailCallElim/return-undef.ll, a trivial case
...
that has been sitting in my inbox since May 18. :)
llvm-svn: 24194
2005-11-05 08:21:11 +00:00
Chris Lattner
9f269e40c9
Use the new 'moveBefore' method to simplify some code. Really, which is
...
easier to understand? :)
llvm-svn: 22706
2005-08-08 19:11:57 +00:00
Chris Lattner
134ebd0801
Fix typoCVS: ----------------------------------------------------------------------
...
llvm-svn: 22692
2005-08-07 07:00:52 +00:00
Chris Lattner
f4dd8c445c
* Use the new PHINode::hasConstantValue method to simplify some code
...
* 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.
llvm-svn: 22690
2005-08-07 04:27:41 +00:00
Jeff Cohen
5f4ef3c5a8
Eliminate all remaining tabs and trailing spaces.
...
llvm-svn: 22523
2005-07-27 06:12:32 +00:00
Chris Lattner
bfc796f622
If a function contains no allocas, all of the calls in it are trivially
...
suitable for tail calls.
llvm-svn: 21836
2005-05-09 23:51:13 +00:00
Misha Brukman
b1c9317bb4
Remove trailing whitespace
...
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Chris Lattner
531f9e92d4
This mega patch converts us from using Function::a{iterator|begin|end} to
...
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.
This patch is contributed by Gabor Greif, thanks!
llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Reid Spencer
7c16caa336
Changes For Bug 352
...
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/.
llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Chris Lattner
8d414ad035
Adjust to the new BasicBlock ctor, which requires a function parameter
...
llvm-svn: 11114
2004-02-04 03:58:28 +00:00
Chris Lattner
884e824534
Refactor code just a little bit, allowing us to implement TailCallElim/return_constant.ll
...
llvm-svn: 10467
2003-12-14 23:57:39 +00:00
Chris Lattner
50663a1a78
Implement: TailCallElim/accum_recursion_constant_arg.ll
...
Also make sure to clean up any PHI nodes that are inserted which are pointless.
llvm-svn: 10333
2003-12-08 23:37:35 +00:00
Chris Lattner
198e620752
Implement: test/Regression/Transforms/TailCallElim/accum_recursion.ll
...
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. :)
llvm-svn: 10332
2003-12-08 23:19:26 +00:00
Chris Lattner
a7b6f3ab9c
Cleanup and restructure the code to make it easier to read and maintain.
...
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.
llvm-svn: 10312
2003-12-08 05:34:54 +00:00
Chris Lattner
a29600046d
Minor cleanups and simplifications
...
llvm-svn: 10127
2003-11-21 16:52:05 +00:00
Chris Lattner
2af517281d
Start using the nicer terminator auto-insertion API
...
llvm-svn: 10111
2003-11-20 18:25:24 +00:00
Brian Gaeke
960707c335
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
John Criswell
482202a601
Added LLVM project notice to the top of every C++ source file.
...
Header files will be on the way.
llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Chris Lattner
5dac64f629
Rename Function::getEntryNode -> getEntryBlock
...
llvm-svn: 8625
2003-09-20 14:39:18 +00:00
Chris Lattner
b6ac976247
Fix a really obvious huge gaping bug, add a comment
...
llvm-svn: 8620
2003-09-20 05:24:00 +00:00
Chris Lattner
0016085602
Expose the TCE pass
...
llvm-svn: 8619
2003-09-20 05:14:13 +00:00
Chris Lattner
2e9014cb1b
New transformation: tail recursion elimination
...
llvm-svn: 8618
2003-09-20 05:03:31 +00:00