1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
Commit Graph

360 Commits

Author SHA1 Message Date
Chris Lattner
71fe09f397 Switch inliner over to use DenseMap instead of std::map for ValueMap. This
speeds up the inliner 16%.

llvm-svn: 33801
2007-02-03 00:08:31 +00:00
Chris Lattner
854464d748 move constant folding code out of Utils/Local into libanalysis
llvm-svn: 33681
2007-01-30 23:46:43 +00:00
Chris Lattner
23628987e2 The inliner/cloner can now optionally take TargetData info, which can be
used by constant folding.

llvm-svn: 33676
2007-01-30 23:22:39 +00:00
Chris Lattner
59ba02e557 Change constant folding APIs to take an optional TargetData, and change
ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array
of operands + size, instead of an std::vector.

llvm-svn: 33669
2007-01-30 23:12:47 +00:00
Anton Korobeynikov
611d5e2eda Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Devang Patel
bf44036fbf Inherit CallGraphSCCPass directly from Pass.
llvm-svn: 33514
2007-01-26 00:47:38 +00:00
Devang Patel
a9eae6951d Inherit BasicBlockPass directly from Pass.
llvm-svn: 33511
2007-01-25 23:23:25 +00:00
Chris Lattner
d5cd984a0e remove an old instrumentation pass that is not used anymore.
llvm-svn: 32997
2007-01-07 18:12:13 +00:00
Reid Spencer
4428c3483b For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Jeff Cohen
e1003da1a2 Unbreak VC++ build.
llvm-svn: 31464
2006-11-05 19:31:28 +00:00
Chris Lattner
65f872288d add option to isCriticalEdge
llvm-svn: 31258
2006-10-28 06:58:17 +00:00
Chris Lattner
85bc826ca6 Expose a smarter way to break critical edges.
llvm-svn: 31256
2006-10-28 06:44:56 +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
Reid Spencer
eb02f1c668 For PR885:
Consolidate the LinkAllAnalyses.h and LinkAllPasses.h headers into one
so there is no dupliation.

llvm-svn: 29787
2006-08-21 05:34:03 +00:00
Jim Laskey
b92b14f422 Introducing plugable register allocators and instruction schedulers.
llvm-svn: 29434
2006-08-01 14:21:23 +00:00
Devang Patel
07e0d34f7d Add new constructor to accept vector of exported names while creating
InternalizePass.

llvm-svn: 29222
2006-07-20 17:48:05 +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
Chris Lattner
0f5ef733cc Force anything that #includes llvm/Transforms/Utils/UnifyFunctionExitNodes.h
to link in the implementation.  Thanks to Anton Korobeynikov for figuring out
what was going on here.

llvm-svn: 28660
2006-06-02 18:40:06 +00:00
Chris Lattner
fcb019fcb6 Implement a new method: CloneAndPruneFunctionInto, as documented.
llvm-svn: 28518
2006-05-27 01:21:50 +00:00
Chris Lattner
c8b9439f3a Add an interface to constant fold and instruction given it's opcode, type
and operands.

llvm-svn: 28516
2006-05-27 01:17:40 +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
9a0d02f8f7 Add a CloneModule call that exposes the mapping of values from the old module
to the new module.  Patch provided by Nick Lewycky!

llvm-svn: 28349
2006-05-17 18:05:35 +00:00
Chris Lattner
2070effca0 This is a proper fix for the compiler warning. A termination condition is
not needed, as it can never be reached: an edge must exist.

llvm-svn: 28282
2006-05-14 02:01:22 +00:00
Reid Spencer
e343483440 Fix an infinite loop bug that Vladimir Prus identified.
llvm-svn: 28281
2006-05-13 18:11:32 +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
Andrew Lenharth
b3f434b83d Add a simple pass to make sure that all (non-library) calls to malloc and free
are visible to analysis as intrinsics.  That is, make sure someone doesn't pass
free around by address in some struct (as happens in say 176.gcc).

This doesn't get rid of any indirect calls, just ensure calls to free and malloc
are always direct.

llvm-svn: 27560
2006-04-10 19:26:09 +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
Chris Lattner
ed45ad33b7 Make the LLVM headers "-ansi -pedantic -Wno-long-long" clean.
Patch by Martin Partel!

llvm-svn: 26313
2006-02-22 16:23:43 +00:00
Chris Lattner
0d03d576e4 Remove a level of indirection.
llvm-svn: 26109
2006-02-10 21:32:11 +00:00
Chris Lattner
5c0f92e308 Remove a never-working pass
llvm-svn: 25348
2006-01-16 01:05:24 +00:00
Chris Lattner
3e2e2b22ec Teach inline function how to update the callgraph when it makes changes.
llvm-svn: 25318
2006-01-14 20:05:06 +00:00
Chris Lattner
67fb415248 Allow the code cloning interfaces to capture some important info about the
code being cloned if the client wants.

llvm-svn: 25281
2006-01-13 18:39:17 +00:00
Andrew Lenharth
cad1d52b64 Added documented rsprofiler interface. Also remove new profiler passes, the
old ones have been updated to implement the interface.

llvm-svn: 24499
2005-11-28 18:00:38 +00:00
Andrew Lenharth
311ec68cf4 Random sampling (aka Arnold and Ryder) profiling. This is still preliminary, but it works on spec on x86 and alpha. The idea is to allow profiling passes to remember what profiling they inserted, then a random sampling framework is inserted which consists of duplicated basic blocks (without profiling), such that at each backedge in the program and entry into every function, the framework chooses whether to use the instrumented code or the instrumentation free code. The goal of such a framework is to make it reasonably cheap to do random sampling of very expensive profiling products (such as load-value profiling).
The code is organized into 3 parts (2 passes)
1) a linked set of profiling passes, which implement an analysis group (linked, like alias analysis are).  These insert profiling into the program, and remember what they inserted, so that at a later time they can be queried about any instruction.

2) a pass that handles inserting the random sampling framework.  This also has options to control how random samples are choosen.  Currently implemented are Global counters, register allocated global counters, and read cycle counter (see? there was a reason for it).

The profiling passes are almost identical to the existing ones (block, function, and null profiling is supported right now), and they are valid passes without the sampling framework (hence the existing passes can be unified with the new ones, not done yet).

Some things are a bit ugly still, but that should be fixed up soon enough.

Other todo? making the counter values not "magic 2^16 -1" values, but dynamically choosable.

llvm-svn: 24493
2005-11-28 00:58:09 +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
ddcbd92b23 needs to go here to apparently.
llvm-svn: 24268
2005-11-10 02:07:45 +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
John Criswell
0893d5847f Move some constant folding functions into LLVMAnalysis since they are used
by Analysis and Transformation passes.

llvm-svn: 24038
2005-10-27 16:00:10 +00:00
Chris Lattner
bd6a973ae0 Don't link these three passes in anymore
llvm-svn: 23941
2005-10-24 02:30:25 +00:00
Chris Lattner
2f752062c1 Don't invade the system namespace
llvm-svn: 23917
2005-10-24 00:16:03 +00:00
Chris Lattner
31ac6df518 There is no need for this to be VC++ only
llvm-svn: 23915
2005-10-24 00:08:51 +00:00
Chris Lattner
dac26c2440 Make this work with the internalize change
llvm-svn: 23812
2005-10-19 01:41:47 +00:00
Chris Lattner
211f996c92 add an option to the internalize pass
llvm-svn: 23782
2005-10-18 06:28:16 +00:00
Chris Lattner
dbef366ea5 allow demotion to volatile values
llvm-svn: 23472
2005-09-27 19:38:43 +00:00
Chris Lattner
2a5d66d0e1 add a new function
llvm-svn: 23443
2005-09-26 05:26:32 +00:00
Chris Lattner
1fc1d60d5a add a helper
llvm-svn: 22823
2005-08-17 06:34:37 +00:00
Nate Begeman
ef41400067 Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
BasicBlock's removePredecessor routine.  This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp

llvm-svn: 22664
2005-08-04 23:24:19 +00:00
Jeff Cohen
b555ae8f95 Add SimplyLibCalls.cpp to VC++ build
llvm-svn: 21554
2005-04-26 02:57:49 +00:00
Reid Spencer
a8e0496412 Declare a function to create the SimplifyLibCalls pass.
llvm-svn: 21523
2005-04-25 02:54:00 +00:00
Misha Brukman
58c97e67f3 Remove trailing whitespace
llvm-svn: 21412
2005-04-21 20:59:05 +00:00
Chris Lattner
8456833fa8 new pass
llvm-svn: 21307
2005-04-15 21:13:16 +00:00
Chris Lattner
ca287099e1 add a new prototype
llvm-svn: 21305
2005-04-15 19:24:49 +00:00
Jeff Cohen
1be6e1cb99 Fix VC++ build breakage
llvm-svn: 20888
2005-03-28 02:52:28 +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
29092b4f26 Get VC++ compiling again
llvm-svn: 19869
2005-01-28 07:29:32 +00:00
Jeff Cohen
8b03a55724 Apply feedback from Chris.
llvm-svn: 19432
2005-01-10 04:23:32 +00:00
Jeff Cohen
a7f1ae5dc0 Apply feed back from Chris:
1. Rename createLoaderPass to CreateProfileLoaderPass
  2. Opt shouldn't use the pass registered in CodeGen.

llvm-svn: 19431
2005-01-10 03:56:27 +00:00
Jeff Cohen
f692cd303d Add last four createXxxPass functions
llvm-svn: 19424
2005-01-09 20:42:52 +00:00
Jeff Cohen
6c0db8d863 Add even more missing createXxxPass functions.
llvm-svn: 19402
2005-01-08 22:01:16 +00:00
Jeff Cohen
69ed91d1ca Add a few more passes to LinkAllPasses.h
llvm-svn: 19371
2005-01-08 18:15:23 +00:00
Jeff Cohen
ce541ade79 Add more missing createXxxPass functions.
llvm-svn: 19370
2005-01-08 17:21:40 +00:00
Jeff Cohen
d8ac84c3f3 But not the identation of THAT line
llvm-svn: 19328
2005-01-07 07:46:40 +00:00
Jeff Cohen
8a926637e2 Correct indentation levels
llvm-svn: 19322
2005-01-07 07:44:02 +00:00
Jeff Cohen
c07c54f5b4 Add missing createXxxPass functions
llvm-svn: 19319
2005-01-07 06:57:28 +00:00
Misha Brukman
8b60d3e9df Fix spelling.
llvm-svn: 19317
2005-01-07 06:45:07 +00:00
Jeff Cohen
83039834d7 Update list of passes
llvm-svn: 19316
2005-01-07 06:12:41 +00:00
Jeff Cohen
8d5d10078b Fix return type
llvm-svn: 19314
2005-01-07 05:41:39 +00:00
Jeff Cohen
9bf3df5cc6 Get the #ifdef right on LinkAllPasses.h.
llvm-svn: 19310
2005-01-06 07:01:08 +00:00
Jeff Cohen
c205cf1049 Fix minor mistakes
llvm-svn: 19309
2005-01-06 06:29:42 +00:00
Jeff Cohen
b5bd66d55c Get rid of those pesky tabs...
llvm-svn: 19308
2005-01-06 06:06:35 +00:00
Jeff Cohen
dfe5e3b330 Add project opt to Visual Studio.
llvm-svn: 19307
2005-01-06 06:02:53 +00:00
Jeff Cohen
727aeaf966 Fix incorrect return type.
llvm-svn: 19304
2005-01-06 05:45:45 +00:00
Chris Lattner
a856de4013 New prototype
llvm-svn: 18751
2004-12-10 07:55:01 +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
Chris Lattner
dd0094e4ed Convert 'struct' to 'class' in various places to adhere to the coding standards
and work better with VC++.  Patch contributed by Morten Ofstad!

llvm-svn: 17281
2004-10-27 16:14:51 +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
Reid Spencer
a5b7b341a4 Declare a function in the correct namespace.
Patch contributed by Morten Ofstad. Thanks Morten!

llvm-svn: 17124
2004-10-18 14:43:45 +00:00
Chris Lattner
cd83905b39 Add support for the unreachable instruction
llvm-svn: 17039
2004-10-16 18:06:43 +00:00
Chris Lattner
8ddca97a5a Rename pass
llvm-svn: 16801
2004-10-07 04:12:02 +00:00
Brian Gaeke
63338063d0 Add accessor function prototypes for reoptimizer support passes.
Make accessors return FunctionPass* as appropriate.

llvm-svn: 16619
2004-09-30 20:13:55 +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
12d1ccfbd8 Add an optional argument to PromoteMemToReg
llvm-svn: 16346
2004-09-15 01:02:30 +00:00
Chris Lattner
f1450e2a51 Remove unused pass
llvm-svn: 16338
2004-09-14 16:34:08 +00:00
Chris Lattner
872e4a14da Add a pass
llvm-svn: 15713
2004-08-13 03:03:44 +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
8f4173433d Remove dead file
llvm-svn: 14459
2004-06-28 00:46:54 +00:00
Chris Lattner
adff3f7355 Remove two dead passes
llvm-svn: 14456
2004-06-28 00:43:25 +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