Owen Anderson
6aa3d83630
Add an early implementation of a partial inlining pass. The idea behind this
...
is that, for functions whose bodies are entirely guarded by an if-statement, it
can be profitable to pull the test out of the callee and into the caller.
This code has had some cursory testing, but still has a number of known issues
on the LLVM test suite.
llvm-svn: 73338
2009-06-14 08:26:32 +00:00
Dan Gohman
c6899f6200
Add a liveness analysis pass for LLVM IR values. This computes
...
the set of blocks in which values are used, the set in which
values are live-through, and the set in which values are
killed. For the live-through and killed sets, conservative
approximations are used.
llvm-svn: 67309
2009-03-19 17:29:04 +00:00
Duncan Sands
3350448d05
Fix PR3415 (infinite loop in EscapeAnalysis) by
...
deleting the escape analysis pass.
llvm-svn: 63197
2009-01-28 11:33:59 +00:00
Duncan Sands
36db5853cb
Rename AddReadAttrs to FunctionAttrs, and teach it how
...
to work out (in a very simplistic way) which function
arguments (pointer arguments only) are only dereferenced
and so do not escape. Mark such arguments 'nocapture'.
llvm-svn: 61525
2008-12-31 16:14:43 +00:00
Torok Edwin
9562aa1742
Add -print-dbginfo pass that prints LLVM IR with comments inserted to show
...
which source/line a certain BB/instruction comes from, original variable names,
and original (unmangled) C++ name of functions.
llvm-svn: 61085
2008-12-16 09:09:19 +00:00
Devang Patel
233728e8c3
Add new helper pass that strips all symbol names except debugging information.
...
This pass makes it easier to test wheter debugging info. influences optimization passes or not.
llvm-svn: 59552
2008-11-18 21:34:39 +00:00
Devang Patel
0616706919
Undo previous check-in.
...
llvm-svn: 59092
2008-11-11 23:57:33 +00:00
Devang Patel
c9fdfd2f0b
Add utility pass to remove dbg info.
...
llvm-svn: 59068
2008-11-11 19:33:39 +00:00
Dan Gohman
c162a200ad
Add a new pass to simplify specific half_powr function calls. This is
...
a specialized pass that it not likely to be generally useful.
llvm-svn: 58732
2008-11-04 23:41:45 +00:00
Nick Lewycky
15a23d029c
Add a new MergeFunctions pass. It finds identical functions and merges them.
...
This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.
llvm-svn: 58557
2008-11-02 05:52:50 +00:00
Daniel Dunbar
919ce3c16a
Privatize PrintModulePass and PrintFunctionPass and add
...
createPrintModulePass and createPrintFunctionPass.
- So clients who compile w/o RTTI can use them.
llvm-svn: 57933
2008-10-21 23:33:38 +00:00
Owen Anderson
ec151a1875
Add EscapeAnalysis.
...
llvm-svn: 57411
2008-10-12 06:49:21 +00:00
Duncan Sands
b2b5ddfaf6
Remove the MarkModRef pass (use AddReadAttrs instead).
...
Unfortunately this means removing one regression test
of GlobalsModRef because I couldn't work out how to
perform it without MarkModRef.
llvm-svn: 56342
2008-09-19 08:23:44 +00:00
Duncan Sands
c2ff9ca568
Add a new pass AddReadAttrs which works out which functions
...
can get the readnone/readonly attributes, and gives them it.
The plan is to remove markmodref (which did the same thing
by querying GlobalsModRef) and delete the analogous
functionality from GlobalsModRef.
llvm-svn: 56341
2008-09-19 08:17:05 +00:00
Andrew Lenharth
4a69775c64
Initial version of a Partial Specialization IPO pass. It triggers a couple hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still.
...
llvm-svn: 55734
2008-09-03 21:00:28 +00:00
Devang Patel
d2fbb7aa32
Add missing decls.
...
llvm-svn: 55719
2008-09-03 20:24:05 +00:00
Duncan Sands
0338e9f60d
Add a small pass that sets the readnone/readonly
...
attributes on functions, based on the result of
alias analysis. It's not hardwired to use
GlobalsModRef even though this is the only (AFAIK)
alias analysis that results in this pass actually
doing something. Enable as follows:
opt ... -globalsmodref-aa -markmodref ...
Advantages of this pass: (1) records the result
of globalsmodref in the bitcode, meaning it is
available for use by later passes (currently
the pass manager isn't smart enough to magically
make an advanced alias analysis available to all
later passes), which may expose more optimization
opportunities; (2) hopefully speeds up compilation
when code is optimized twice, for example when a
file is compiled to bitcode, then later LTO is done
on it: marking functions readonly/readnone when
producing the initial bitcode should speed up alias
analysis during LTO; (3) good for discovering that
globalsmodref doesn't work very well :)
Not currently turned on by default.
llvm-svn: 55604
2008-09-01 11:40:11 +00:00
Chris Lattner
2f629c4b80
Add a new trivial -inst-namer pass which makes it possible to diff the
...
before/after effects of a pass, crazy!
llvm-svn: 55230
2008-08-23 06:07:02 +00:00
Owen Anderson
13498aa150
Remove GCSE, ValueNumbering, and LoadValueNumbering. These have been deprecated for almost a year; it's finally time for them to go away.
...
llvm-svn: 54822
2008-08-15 21:31:02 +00:00
Nick Lewycky
d63159dcd4
Add a value range analysis that lazily computes ranges using ScalarEvolutions.
...
llvm-svn: 52885
2008-06-30 00:04:21 +00:00
Owen Anderson
0e26c5897a
Force postdom to be linked into opt and bugpoint, even though it is no longer used by any passes.
...
llvm-svn: 51686
2008-05-29 17:00:13 +00:00
Chris Lattner
3ee18d7c51
Add a new LibCallAliasAnalysis pass, which is parameterized
...
by an instance of LibCallInfo to provide mod/ref info of
standard library functions. This is powerful enough to
say that 'sqrt' is readonly except that it modifies errno,
or that "printf doesn't store to memory unless the %n
constraint is present" etc.
llvm-svn: 50827
2008-05-07 19:53:05 +00:00
Owen Anderson
5b7928f3d2
Rename DeadLoopElimination to LoopDeletion, part 2.
...
llvm-svn: 50437
2008-04-29 20:06:54 +00:00
Owen Anderson
4cc52fd657
Add dead loop elimination, which removes dead loops for which we can compute
...
the trip count.
llvm-svn: 50382
2008-04-29 00:38:34 +00:00
Chris Lattner
c8c74f39db
Add a new Jump Threading pass, which will handle cases
...
such as those in PR2235. Right now the pass is not very
effective. :)
llvm-svn: 50000
2008-04-20 20:35:01 +00:00
Owen Anderson
ca7e0e21f3
Factor a bunch of functionality related to memcpy and memset transforms out of
...
GVN and into its own pass.
llvm-svn: 49419
2008-04-09 08:23:16 +00:00
Devang Patel
494c61fd20
Add new sretpromotion pass.
...
llvm-svn: 48032
2008-03-07 21:07:34 +00:00
Devang Patel
f7d8b7679b
Add StripDeadPrototypes pass.
...
llvm-svn: 47488
2008-02-22 18:39:29 +00:00
Chris Lattner
ae2f8bc116
remove the LowerSelect pass. The last client was the old Sparc backend, which is long dead by now.
...
llvm-svn: 47323
2008-02-19 07:49:17 +00:00
Chris Lattner
010e9fb704
remove the lower packed pass. It can never work and even the parts that
...
could work don't work fully. This fixes PR1705. Oh yeah, we don't have
packed types anymore either ;-)
llvm-svn: 47322
2008-02-19 07:39:17 +00:00
Bill Wendling
629a569ce9
The CorrelatedExpressionElimination pass is known to be buggy. Remove it.
...
This fixes PR1769.
llvm-svn: 46408
2008-01-27 06:11:41 +00:00
Gordon Henriksen
db4f51e1b9
With this patch, the LowerGC transformation becomes the
...
ShadowStackCollector, which additionally has reduced overhead with
no sacrifice in portability.
Considering a function @fun with 8 loop-local roots,
ShadowStackCollector introduces the following overhead
(x86):
; shadowstack prologue
movl L_llvm_gc_root_chain$non_lazy_ptr, %eax
movl (%eax), %ecx
movl $___gc_fun, 20(%esp)
movl $0, 24(%esp)
movl $0, 28(%esp)
movl $0, 32(%esp)
movl $0, 36(%esp)
movl $0, 40(%esp)
movl $0, 44(%esp)
movl $0, 48(%esp)
movl $0, 52(%esp)
movl %ecx, 16(%esp)
leal 16(%esp), %ecx
movl %ecx, (%eax)
; shadowstack loop overhead
(none)
; shadowstack epilogue
movl 48(%esp), %edx
movl %edx, (%ecx)
; shadowstack metadata
.align 3
___gc_fun: # __gc_fun
.long 8
.space 4
In comparison to LowerGC:
; lowergc prologue
movl L_llvm_gc_root_chain$non_lazy_ptr, %eax
movl (%eax), %ecx
movl %ecx, 48(%esp)
movl $8, 52(%esp)
movl $0, 60(%esp)
movl $0, 56(%esp)
movl $0, 68(%esp)
movl $0, 64(%esp)
movl $0, 76(%esp)
movl $0, 72(%esp)
movl $0, 84(%esp)
movl $0, 80(%esp)
movl $0, 92(%esp)
movl $0, 88(%esp)
movl $0, 100(%esp)
movl $0, 96(%esp)
movl $0, 108(%esp)
movl $0, 104(%esp)
movl $0, 116(%esp)
movl $0, 112(%esp)
; lowergc loop overhead
leal 44(%esp), %eax
movl %eax, 56(%esp)
leal 40(%esp), %eax
movl %eax, 64(%esp)
leal 36(%esp), %eax
movl %eax, 72(%esp)
leal 32(%esp), %eax
movl %eax, 80(%esp)
leal 28(%esp), %eax
movl %eax, 88(%esp)
leal 24(%esp), %eax
movl %eax, 96(%esp)
leal 20(%esp), %eax
movl %eax, 104(%esp)
leal 16(%esp), %eax
movl %eax, 112(%esp)
; lowergc epilogue
movl 48(%esp), %edx
movl %edx, (%ecx)
; lowergc metadata
(none)
llvm-svn: 45670
2008-01-07 01:30:53 +00:00
Chris Lattner
6badc24aa5
fix an accidental commit that broke all the testers :(
...
llvm-svn: 45659
2008-01-06 19:18:52 +00:00
Chris Lattner
5489888580
rename isStore -> mayStore to more accurately reflect what it captures.
...
llvm-svn: 45656
2008-01-06 08:36:04 +00:00
Owen Anderson
4cce45354c
Didn't mean to commit this.
...
llvm-svn: 45606
2008-01-05 00:42:45 +00:00
Owen Anderson
2adf8c5533
Move some more functionality from MRegisterInfo to TargetInstrInfo.
...
llvm-svn: 45603
2008-01-04 23:57:37 +00:00
Chris Lattner
e0b1ee937a
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change. Boy are my fingers tired. ;-)
llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Owen Anderson
a37895cfee
Remove RLE from the headers, since the pass itself is gone now.
...
llvm-svn: 41971
2007-09-14 22:54:46 +00:00
Devang Patel
228dc09ff6
Begin loop index split pass.
...
llvm-svn: 40883
2007-08-07 00:25:56 +00:00
Owen Anderson
58e64df595
Rename FastDSE to just DSE.
...
llvm-svn: 40668
2007-08-01 06:36:51 +00:00
Owen Anderson
eb9f1b612c
Add a GVN pass, using the value numbering code I developed for GVNPRE and the
...
load elimination code from RedundantLoadElimination.
llvm-svn: 40469
2007-07-24 17:55:58 +00:00
Owen Anderson
5969a3cb91
Rename a lot of things to change FastDLE to RedundantLoadElimination.
...
llvm-svn: 40457
2007-07-24 00:17:04 +00:00
Owen Anderson
8523f2d7c4
Forgot to commit this file.
...
llvm-svn: 40447
2007-07-23 22:00:03 +00:00
Owen Anderson
1eaba31f12
Add FastDSE, a new algorithm for doing dead store elimination. This algorithm is not as accurate
...
as the current DSE, but it only a linear scan over each block, rather than quadratic. Eventually
(once it has been improved somewhat), this will replace the current DSE.
NOTE: This has not yet been extensively tested.
llvm-svn: 38517
2007-07-11 00:46:18 +00:00
Owen Anderson
d765ae21f7
Put GVN-PRE in all the right places.
...
llvm-svn: 37352
2007-05-29 23:36:32 +00:00
Owen Anderson
ea857029ea
Remove ImmediateDominator analysis. The same information can be obtained from DomTree. A lot of code for
...
constructing ImmediateDominator is now folded into DomTree construction.
This is part of the ongoing work for PR217.
llvm-svn: 36063
2007-04-15 08:47:27 +00:00
Owen Anderson
85b0e20f2a
Completely purge DomSet. This is the (hopefully) final patch for PR1171.
...
llvm-svn: 35731
2007-04-07 07:17:27 +00:00
Chris Lattner
b30cb05d63
add loop rot
...
llvm-svn: 35722
2007-04-07 04:43:02 +00:00
Chris Lattner
579b1c63d5
Split the sdisel code munging stuff out into its own opt-pass, CodeGenPrepare.
...
llvm-svn: 35528
2007-03-31 04:06:36 +00:00
Chris Lattner
71ced5505c
remove some passes
...
llvm-svn: 34437
2007-02-20 05:31:04 +00:00