Chris Lattner
57e11a167d
Move SplitBlockPredecessors out of loopsimplify into BasicBlockUtils.h
...
as a global helper function. At the same type, switch it from taking
a vector of predecessors to an arbitrary sequential input. This allows
us to switch LoopSimplify to use a SmallVector for various temporary
vectors that it passed into SplitBlockPredecessors.
llvm-svn: 50020
2008-04-21 01:28:02 +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
Chris Lattner
d299f7b8cf
Allow argpromote to promote struct arguments with a specified number
...
of elements. Patch by Matthijs Kooijman!
llvm-svn: 49962
2008-04-19 19:50: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
Evan Cheng
d01a2a18f8
Increasing the inline limit from (overly conservative) 200 to 300. Given each BB costs 20 and each instruction costs 5, 200 means a 4 BB function + 24 instructions (actually less because caller's size also contributes to it).
...
Furthermore, double the limit when more than 10% of the callee instructions are vector instructions. Multimedia kernels tend to love inlining.
llvm-svn: 48725
2008-03-24 06:37:48 +00:00
Andrew Lenharth
2ff2bcbde8
FunctionExtractorPass has been superceded by GVExtractorPass
...
llvm-svn: 48648
2008-03-21 16:46:53 +00:00
Andrew Lenharth
6c788376e9
add a pass that can extract all kinds of global values, not just functions. Update llvm-extract to use it and optionally extract a global variable if you want it too
...
llvm-svn: 48015
2008-03-07 19:51:57 +00:00
Gabor Greif
d746841e93
fix typos
...
llvm-svn: 47994
2008-03-06 10:36:00 +00:00
Devang Patel
cb72d92471
Add pass to promote sret.
...
This pass transforms
%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal void @foo(%struct._Point* sret %agg.result)
into
%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal %struct._Point @foo()
This pass updates foo() clients appropriately to use
getresult instruction to extract return values.
This pass is not yet ready for prime time.
llvm-svn: 47776
2008-02-29 23:34:08 +00:00
Chris Lattner
9fb1d740a6
prune #includes, fit in 80 cols.
...
llvm-svn: 47556
2008-02-25 19:21:38 +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
Chris Lattner
fb5876f0be
Allow clients to specify the inline threshold when creating
...
the inliner pass. Patch by Robert Zeh.
llvm-svn: 45903
2008-01-12 06:49:13 +00:00
Chris Lattner
ff7707de37
don't include loopinfo.h from this file.
...
llvm-svn: 45858
2008-01-11 06:30:04 +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
a09bc3d9a4
back out accidental commit.
...
llvm-svn: 45660
2008-01-06 19:19:32 +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
6c7beb1748
Didn't mean to commit this.
...
llvm-svn: 45607
2008-01-05 00:43:37 +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
7b92dab615
Start the process of making MachineLoopInfo possible by templating Loop.
...
llvm-svn: 44097
2007-11-14 02:33:58 +00:00
Anton Korobeynikov
8ab03c9d1c
Make this header public
...
llvm-svn: 43938
2007-11-09 12:16:58 +00:00
Gordon Henriksen
8188f028a2
Deleting redundant copy of block extractor pass. See also PR1775.
...
llvm-svn: 43694
2007-11-05 01:54:05 +00:00
Anton Korobeynikov
bcee4726bf
Reg2Mem cleanup and optimizations:
...
- enable phi instructions demotion to stack
- create alloca instructions in the entry block
llvm-svn: 43208
2007-10-21 23:05:16 +00:00
Hartmut Kaiser
ed12f66488
Updated VC++ build system.
...
Silenced some VC warnings.
I'm getting linker errors, though: unresolved externals:
llvm::Split<class llvm::BasicBlock *,struct llvm::GraphTraits<class llvm::BasicBlock *> >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)
and
llvm::Split<struct llvm::Inverse<class llvm::BasicBlock *>,struct llvm::GraphTraits<struct llvm::Inverse<class llvm::BasicBlock *> > >(class llvm::DominatorTreeBase<class llvm::BasicBlock> &,class llvm::BasicBlock *)
Where are these defined?
llvm-svn: 43073
2007-10-17 14:56:40 +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
d412a2a0ed
Add utility to clone loops.
...
llvm-svn: 40997
2007-08-10 17:59:47 +00:00
Chris Lattner
15b13dc5f9
add #ifndef guards
...
llvm-svn: 40990
2007-08-10 15:53:08 +00:00
Devang Patel
8289b6e663
Fix comment.
...
llvm-svn: 40911
2007-08-07 23:16:03 +00:00
Devang Patel
228dc09ff6
Begin loop index split pass.
...
llvm-svn: 40883
2007-08-07 00:25:56 +00:00
Dan Gohman
7dd04fb91c
More explicit keywords.
...
llvm-svn: 40673
2007-08-01 15:32:29 +00:00
Owen Anderson
58e64df595
Rename FastDSE to just DSE.
...
llvm-svn: 40668
2007-08-01 06:36:51 +00:00
Devang Patel
a03e82d7ee
Use SmallPtrSet.
...
llvm-svn: 40560
2007-07-27 18:34:27 +00:00
Devang Patel
d7b401bafd
Add BasicInliner interface.
...
This interface allows clients to inline bunch of functions with module
level call graph information.:wq
llvm-svn: 40486
2007-07-25 18:00:25 +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
0448fc9e66
Fix a comment.
...
llvm-svn: 40446
2007-07-23 21:51:37 +00:00
Owen Anderson
bd3360e856
Add FastDLE, the load-elimination counterpart of FastDSE.
...
llvm-svn: 40445
2007-07-23 21:48:08 +00:00
Devang Patel
9166ad7658
Make LCSSA a loop pass.
...
llvm-svn: 39844
2007-07-13 23:57:11 +00:00
Tanya Lattner
a715bbe152
Adding ability to demote phi to stack.
...
llvm-svn: 39744
2007-07-11 18:41:34 +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
Devang Patel
65f3717db9
Expose struct size threhold to allow users to tweak their own setting.
...
llvm-svn: 38472
2007-07-09 21:19:23 +00:00
Devang Patel
d9043c7501
Add SplitEdge and SplitBlock utility routines.
...
llvm-svn: 37952
2007-07-06 21:39:20 +00:00
Tanya Lattner
6d152cd7df
Move inliner pass header file.
...
llvm-svn: 37664
2007-06-19 22:29:02 +00:00
Devang Patel
b5554f450a
Do not preserve ETForest.
...
llvm-svn: 37506
2007-06-08 00:02:08 +00:00
Devang Patel
3daf3625ab
Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.
...
llvm-svn: 37501
2007-06-07 22:17:16 +00:00
Devang Patel
a466c96f77
Use DominatorTree instead of ETForest.
...
This allows faster immediate domiantor walk.
llvm-svn: 37500
2007-06-07 21:57:03 +00:00
Devang Patel
59091c81b6
Rename.
...
llvm-svn: 37448
2007-06-06 00:49:02 +00:00
Devang Patel
61661c6774
Avoid non-trivial loop unswitching while optimizing for size.
...
llvm-svn: 37446
2007-06-06 00:21:03 +00:00