Commit Graph

404 Commits

Author SHA1 Message Date
Chris Lattner
3793325cb3 Add a new trivial -inst-namer pass which makes it possible to diff the
before/after effects of a pass, crazy!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55230 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 06:07:02 +00:00
Owen Anderson
3688f268cb Remove GCSE, ValueNumbering, and LoadValueNumbering. These have been deprecated for almost a year; it's finally time for them to go away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 21:31:02 +00:00
Owen Anderson
11f2ec8eb5 Make MergeBlockIntoPredecessor more aggressive when the same successor appears
more than once.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-17 19:42:29 +00:00
Owen Anderson
b31b06d04b Factor MergeBlockIntoPredecessor out into BasicBlockUtils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53705 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-17 00:01:40 +00:00
Dan Gohman
58ca8d55d4 Correct a top-level comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53685 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16 16:03:31 +00:00
Chris Lattner
46868c07bb Reapply r53540, now with the matching header!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53557 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 17:32:59 +00:00
Chris Lattner
de29d92420 whitespace fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53537 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 00:28:45 +00:00
Chris Lattner
6838d8726e doxygenate comments and wrap to 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53536 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 00:27:31 +00:00
Dan Gohman
1002c02034 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:00:37 +00:00
Matthijs Kooijman
65c9216a39 Add missing semicolumn in my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 09:49:38 +00:00
Matthijs Kooijman
b0ed11f4a0 Improve comments wrt createInternalize.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 09:48:11 +00:00
Matthijs Kooijman
4e78908b94 Rename a few variables to be more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52672 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 09:14:10 +00:00
Evan Cheng
652f7ea955 Revert 51775.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51795 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 22:47:19 +00:00
Evan Cheng
babf11f249 Patches for building llvm on Solaris x86. Contributed by Nathan Keynes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 17:16:20 +00:00
Dan Gohman
1baa88e3de Prune and tidy #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-29 19:52:31 +00:00
Devang Patel
ef3682a4fb Simplify internalize pass. Add test case.
Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:01:01 +00:00
Dan Gohman
816cdf6bb2 Commit the header I accidentally left out of 51083.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 04:39:40 +00:00
Dan Gohman
9c78a39907 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 00:43:10 +00:00
Dan Gohman
6ddba2b933 Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.

Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51022 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 02:05:11 +00:00
Dan Gohman
84b7df43fb Remove uses of llvm/System/IncludeFile.h that are no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50695 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 01:32:53 +00:00
Chris Lattner
fd1cbbe9cf Delete the IPO simplify-libcalls and completely reimplement it as
a FunctionPass.  This makes it simpler, fixes dozens of bugs, adds
a couple of minor features, and shrinks is considerably: from
2214 to 1437 lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-01 06:25:24 +00:00
Owen Anderson
0396cd33ca Rename DeadLoopElimination to LoopDeletion, part 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 20:06:54 +00:00
Owen Anderson
0ff7708a5b Add dead loop elimination, which removes dead loops for which we can compute
the trip count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50382 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-29 00:38:34 +00:00
Chris Lattner
54b9c3ba2a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50020 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 01:28:02 +00:00
Chris Lattner
8383a7b7a6 Add a new Jump Threading pass, which will handle cases
such as those in PR2235.  Right now the pass is not very
effective. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50000 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 20:35:01 +00:00
Chris Lattner
bcd203cf86 Allow argpromote to promote struct arguments with a specified number
of elements.  Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49962 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 19:50:01 +00:00
Owen Anderson
a723d1e48f Factor a bunch of functionality related to memcpy and memset transforms out of
GVN and into its own pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 08:23:16 +00:00
Evan Cheng
8d84d5b62c 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48725 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 06:37:48 +00:00
Andrew Lenharth
7623716e61 FunctionExtractorPass has been superceded by GVExtractorPass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48648 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21 16:46:53 +00:00
Andrew Lenharth
d245a8ae47 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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48015 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-07 19:51:57 +00:00
Gabor Greif
29d8aa7877 fix typos
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-06 10:36:00 +00:00
Devang Patel
ca891ecf91 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47776 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29 23:34:08 +00:00
Chris Lattner
6110224fa6 prune #includes, fit in 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47556 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-25 19:21:38 +00:00
Chris Lattner
75542bd56b remove the LowerSelect pass. The last client was the old Sparc backend, which is long dead by now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 07:49:17 +00:00
Chris Lattner
15f166c7b6 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 ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47322 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 07:39:17 +00:00
Bill Wendling
beefd3d0f8 The CorrelatedExpressionElimination pass is known to be buggy. Remove it.
This fixes PR1769.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46408 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-27 06:11:41 +00:00
Chris Lattner
120d053e3b Allow clients to specify the inline threshold when creating
the inliner pass.  Patch by Robert Zeh.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45903 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 06:49:13 +00:00
Chris Lattner
3dab223dc9 don't include loopinfo.h from this file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 06:30:04 +00:00
Gordon Henriksen
8fa8929177 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45670 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 01:30:53 +00:00
Chris Lattner
e4b83877d5 back out accidental commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45660 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 19:19:32 +00:00
Chris Lattner
2e48a70b35 rename isStore -> mayStore to more accurately reflect what it captures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45656 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 08:36:04 +00:00
Owen Anderson
a997c498e0 Didn't mean to commit this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45607 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-05 00:43:37 +00:00
Owen Anderson
d94b6a16fe Move some more functionality from MRegisterInfo to TargetInstrInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45603 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-04 23:57:37 +00:00
Chris Lattner
7ed47a1335 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:42 +00:00
Owen Anderson
019b92a70c Start the process of making MachineLoopInfo possible by templating Loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44097 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 02:33:58 +00:00
Anton Korobeynikov
18d083f0d1 Make this header public
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43938 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 12:16:58 +00:00
Gordon Henriksen
4e1be6d5ea Deleting redundant copy of block extractor pass. See also PR1775.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43694 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 01:54:05 +00:00
Anton Korobeynikov
a024e8ceda Reg2Mem cleanup and optimizations:
- enable phi instructions demotion to stack
 - create alloca instructions in the entry block


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43208 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-21 23:05:16 +00:00
Hartmut Kaiser
efd4a5144b 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?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17 14:56:40 +00:00
Owen Anderson
7e9edda51d Remove RLE from the headers, since the pass itself is gone now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41971 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-14 22:54:46 +00:00