1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

162 Commits

Author SHA1 Message Date
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
Dan Gohman
3ea2dceca0 Prune and tidy #includes.
llvm-svn: 51697
2008-05-29 19:52:31 +00:00
Dan Gohman
ffe0b1f40e Whitespace cleanups.
llvm-svn: 51089
2008-05-14 00:43:10 +00:00
Dan Gohman
138a53b303 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.

llvm-svn: 51022
2008-05-13 02:05:11 +00:00
Chris Lattner
be2bafbe92 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.

llvm-svn: 50520
2008-05-01 06:25:24 +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
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
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
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
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
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
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
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
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
Owen Anderson
d765ae21f7 Put GVN-PRE in all the right places.
llvm-svn: 37352
2007-05-29 23:36:32 +00:00
Devang Patel
562df7f986 Add loop rotation pass.
llvm-svn: 35714
2007-04-07 01:25:15 +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
Devang Patel
6a56e3c1a0 Now IndVarSimplify is a LoopPass.
llvm-svn: 35003
2007-03-07 06:39:01 +00:00
Devang Patel
16107bb71b Now LICM is a LoopPass.
llvm-svn: 35001
2007-03-07 04:41:30 +00:00
Devang Patel
3a24891f80 Now LoopUnroll is a LoopPass.
llvm-svn: 34996
2007-03-07 01:38:05 +00:00
Devang Patel
c35610b9f9 Now LoopUnswitch is a LoopPass.
llvm-svn: 34992
2007-03-07 00:26:10 +00:00
Devang Patel
0b82378a28 Now LoopStrengthReduce is a LoopPass.
llvm-svn: 34984
2007-03-06 21:14:09 +00:00
Reid Spencer
55e4e98a2a For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Reid Spencer
45d9d72ac0 For PR1072:
Removing -raise has neglible positive or negative side effects so we are
opting to remove it. See the PR for comparison details.

llvm-svn: 33844
2007-02-03 23:15:56 +00:00
Devang Patel
a9eae6951d Inherit BasicBlockPass directly from Pass.
llvm-svn: 33511
2007-01-25 23:23:25 +00:00
Bill Wendling
85f53a4427 Corrected formatting.
llvm-svn: 30942
2006-10-13 20:53:50 +00:00
Duraid Madina
51396ffd3e add setJumpBufSize() and setJumpBufAlignment() to target-lowering.
Call these from your backend to enjoy setjmp/longjmp goodness, see
lib/Target/IA64/IA64ISelLowering.cpp for an example

llvm-svn: 30095
2006-09-04 06:21:35 +00:00
Nick Lewycky
9535a84c33 Add PredicateSimplifier pass. Collapses equal variables into one form
and simplifies expressions. This implements the optimization described
in PR807.

llvm-svn: 29947
2006-08-28 22:44:55 +00:00
Owen Anderson
0d9583aa41 Update some comments, and expose LCSSAID in preparation for having other passes
require LCSSA.

llvm-svn: 28734
2006-06-08 20:02:53 +00:00
Owen Anderson
93098cfc4c Skeletal LCSSA pass. This is currently non-functional. Expect functionality
and documentation updates soo.

llvm-svn: 28495
2006-05-26 13:58:26 +00:00
Chris Lattner
1275941193 Add pass ID's for various passes, so they can be AddRequiredID. Patch by
Domagoj Babic!

llvm-svn: 28048
2006-05-02 04:24:36 +00:00
Chris Lattner
0b321ad43f remove a dead prototype
llvm-svn: 27882
2006-04-20 15:45:54 +00:00
Evan Cheng
db35180b27 For each loop, keep track of all the IV expressions inserted indexed by
stride. For a set of uses of the IV of a stride which is a multiple
of another stride, do not insert a new IV expression. Rather, reuse the
previous IV and rewrite the uses as uses of IV expression multiplied by
the factor.

e.g.
x = 0 ...; x ++
y = 0 ...; y += 4
then use of y can be rewritten as use of 4*x for x86.

llvm-svn: 26803
2006-03-16 21:53:05 +00:00
Evan Cheng
692235499c Added target lowering hooks which LSR consults to make more intelligent
transformation decisions.

llvm-svn: 26738
2006-03-13 23:14:23 +00:00
Andrew Lenharth
79ee761b69 Reg2Mem is something a pass may depend on, so allow that
llvm-svn: 24488
2005-11-22 22:14:23 +00:00
Andrew Lenharth
03d60c3d09 The pass everyone has been waiting for!
Reg2Mem

for fun you can opt -reg2mem -mem2reg

llvm-svn: 24267
2005-11-10 01:58:38 +00:00
Nate Begeman
f299b9fb03 Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.

No targets currently do anything with this information, nor is it presrved
in the bytecode representation.  That's coming up next.

llvm-svn: 24196
2005-11-05 09:21:28 +00:00
Chris Lattner
dae0aafea8 Remove the LowerConstantExpressionsPass pass
llvm-svn: 24089
2005-10-29 05:32:20 +00:00
Misha Brukman
58c97e67f3 Remove trailing whitespace
llvm-svn: 21412
2005-04-21 20:59:05 +00:00
Chris Lattner
ca287099e1 add a new prototype
llvm-svn: 21305
2005-04-15 19:24:49 +00:00
Alkis Evlogimenos
e0e628a401 Rename createPromoteMemoryToRegister() to
createPromoteMemoryToRegisterPass() to be consistent with other pass
creation functions.

llvm-svn: 20885
2005-03-28 02:01:12 +00:00
Jeff Cohen
29ecafb2e3 Add support for not strength reducing GEPs where the element size is a small
power of two.  This emphatically includes the zeroeth power of two.

llvm-svn: 20429
2005-03-04 04:04:26 +00:00
Chris Lattner
f43446fb2f Add an argument.
llvm-svn: 20413
2005-03-03 01:03:10 +00:00
Jeff Cohen
ce541ade79 Add more missing createXxxPass functions.
llvm-svn: 19370
2005-01-08 17:21:40 +00:00
Chris Lattner
e2b8d886c9 Move the strip pass from Scalar to IPO lib
llvm-svn: 18438
2004-12-02 21:24:19 +00:00
Chris Lattner
fd98a3195a New prototype for lowerpacked pass.
llvm-svn: 17915
2004-11-17 18:01:49 +00:00
Chris Lattner
6807c1681b This is V9 specific stuff
llvm-svn: 17546
2004-11-07 00:42:29 +00:00
Nate Begeman
49e38c2185 Initial implementation of the strength reduction for GEP instructions in
loops.  This optimization is not turned on by default yet, but may be run
with the opt tool's -loop-reduce flag.  There are many FIXMEs listed in the
code that will make it far more applicable to a wide range of code, but you
have to start somewhere :)

This limited version currently triggers on the following tests in the
MultiSource directory:
pcompress2: 7 times
cfrac: 5 times
anagram: 2 times
ks: 6 times
yacr2: 2 times

llvm-svn: 17134
2004-10-18 21:08:22 +00:00
Chris Lattner
a4d3f95fa3 Do not prototype any of these passes as returning Pass*. Instead, be specific
llvm-svn: 16431
2004-09-20 04:41:39 +00:00
Chris Lattner
f1450e2a51 Remove unused pass
llvm-svn: 16338
2004-09-14 16:34:08 +00:00
Chris Lattner
00ff5a4e35 Expose breakcriticaledges as a functionpass
llvm-svn: 15370
2004-07-31 10:02:24 +00:00
Brian Gaeke
45adb41f46 Make the create...() functions for some of these passes return a FunctionPass *.
llvm-svn: 15276
2004-07-27 17:43:21 +00:00
Chris Lattner
d1cfccd01e New prototype
llvm-svn: 15102
2004-07-22 08:07:30 +00:00
Chris Lattner
2420a80afa Prototype for new ConstantExpr lowering pass, contributed by Vladimir Prus!
llvm-svn: 14397
2004-06-25 07:41:06 +00:00
Chris Lattner
f9d9fd95bd Add a new prototype
llvm-svn: 13685
2004-05-23 21:16:13 +00:00
Chris Lattner
10c5fa0de9 Add accessor for a Loop Unswitching pass
llvm-svn: 13066
2004-04-19 06:28:37 +00:00
Chris Lattner
27fd823c1b Add prototype
llvm-svn: 13029
2004-04-18 05:20:32 +00:00
Chris Lattner
34112aa99f Improve description, add warning
llvm-svn: 12570
2004-03-31 21:59:07 +00:00
Chris Lattner
58a6a4d57a Add a simple select instruction lowering pass
llvm-svn: 12540
2004-03-30 18:41:10 +00:00
Chris Lattner
3bb91dafcd Move loop extractor to the IPO header
llvm-svn: 12374
2004-03-14 02:36:34 +00:00
Misha Brukman
1ddb180929 Add the prototype for the LoopExtractor Pass.
llvm-svn: 11937
2004-02-28 03:33:17 +00:00
Misha Brukman
47df5a35ec Fix spelling of `tendency'.
llvm-svn: 11378
2004-02-13 16:23:14 +00:00
Chris Lattner
2b87d0184b Expose a pass ID for lower-invoke
llvm-svn: 11377
2004-02-13 16:16:35 +00:00
Brian Gaeke
d25f86d683 Put all LLVM code into the llvm namespace, as per bug 109.
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
6beaeb1c1d Move isCriticalEdge & SplitCritical edge out of this file, which is only
for passes.

llvm-svn: 9851
2003-11-10 04:09:44 +00:00
Misha Brukman
b6f41c96d7 Declare FunctionPasses as such.
llvm-svn: 9767
2003-11-07 17:19:39 +00:00
John Criswell
16c6cda9d5 Added LLVM copyright header (for lack of a better term).
llvm-svn: 9304
2003-10-20 20:19:47 +00:00
Chris Lattner
f4ca01758d Rename loop preheaders pass to loop simplify
llvm-svn: 9061
2003-10-12 21:52:28 +00:00
Chris Lattner
8848bf58ce Add new prototype for createLowerInvokePass(). Make simplifycfg be a
functionpass

llvm-svn: 8870
2003-10-05 19:15:13 +00:00
Chris Lattner
4e4c763dfc Standardize header file comments
llvm-svn: 8782
2003-09-30 18:37:50 +00:00
Chris Lattner
bf7dd80e7c Expose the TCE pass
llvm-svn: 8619
2003-09-20 05:14:13 +00:00
Chris Lattner
58d4183a25 Fix spell-o's
llvm-svn: 8431
2003-09-10 05:29:43 +00:00
Chris Lattner
603a7af227 Add RPR prototype here
llvm-svn: 8314
2003-09-01 20:44:42 +00:00
Chris Lattner
2ef2a63728 Change the RaiseAllocations pass from being a BasicBlockPass to being a Pass
llvm-svn: 8279
2003-09-01 03:14:00 +00:00
Brian Gaeke
4651096037 Factory methods for function passes now return type FunctionPass *.
llvm-svn: 7839
2003-08-14 06:09:32 +00:00
Brian Gaeke
77c65be59e Factory methods for FunctionPasses now return type FunctionPass *.
llvm-svn: 7823
2003-08-13 18:18:15 +00:00
Chris Lattner
6c260f1c5c Add prototype for tail-dup pass
llvm-svn: 6847
2003-06-22 20:10:42 +00:00
Chris Lattner
593cb8cafe Expose proto for SRoA pass.
llvm-svn: 6348
2003-05-27 15:52:45 +00:00
Misha Brukman
825e174bf7 Hopefully, the final fix for `[Pp]ropogate'.
llvm-svn: 6251
2003-05-20 21:01:22 +00:00
Chris Lattner
0a9913935f Add stub to create lowerSwitches pass
llvm-svn: 5866
2003-04-23 16:24:19 +00:00
Chris Lattner
3cf20c3f14 Expose isCriticalEdge & SplitCriticalEdge methods from crit-edges pass
llvm-svn: 4075
2002-10-08 21:06:27 +00:00
Chris Lattner
9a954d1bc1 Checkin new loop-preheader insertion pass.
llvm-svn: 3943
2002-09-26 16:17:33 +00:00