Chris Lattner
b2d9f7dcc9
* Fix function resolution for varargs function to generate incorrect bytecode instead of crashing
...
* remove using decls
CVS: ----------------------------------------------------------------------
llvm-svn: 5437
2003-01-30 18:22:32 +00:00
Chris Lattner
6e07784692
Initial checkin of pool allocation code
...
llvm-svn: 5432
2003-01-29 21:12:13 +00:00
Chris Lattner
d1fd7e958c
Disable construction of pool allocator
...
llvm-svn: 5422
2003-01-24 20:13:20 +00:00
Chris Lattner
661841c49b
Fix references to functions
...
llvm-svn: 5222
2003-01-13 00:27:23 +00:00
Vikram S. Adve
d9676ed983
External routines used to identify Cilk operations inserted by the
...
parallelization pass.
llvm-svn: 4965
2002-12-10 13:08:48 +00:00
Vikram S. Adve
9a672d17ae
This file implements a pass that automatically parallelizes a program,
...
using the Cilk multi-threaded runtime system to execute parallel code.
The current version inserts too many sync() operations in the program
because it does not attempt to optimize their placement.
llvm-svn: 4962
2002-12-10 00:43:34 +00:00
Chris Lattner
8016a16ed0
Fix symbol table problem
...
llvm-svn: 4785
2002-11-20 19:32:43 +00:00
Chris Lattner
98cf1f5d64
- Eliminated the deferred symbol table stuff in Module & Function, it really
...
wasn't an optimization and it was causing lots of bugs.
llvm-svn: 4779
2002-11-20 18:36:02 +00:00
Chris Lattner
c362618f2a
Minor changes to cloning interface
...
llvm-svn: 4770
2002-11-19 22:54:01 +00:00
Chris Lattner
b1120055b9
Rework inline pass to use cloning infrastructure to do the dirty work
...
llvm-svn: 4766
2002-11-19 21:54:07 +00:00
Chris Lattner
1666751257
Start using the new function cloning header
...
llvm-svn: 4764
2002-11-19 20:59:41 +00:00
Chris Lattner
d06467db62
Move MutatStructTypes.h out of IPO
...
llvm-svn: 4762
2002-11-19 20:49:40 +00:00
Chris Lattner
fb8ca4a899
Rename CloneFunction.h to Cloning.h
...
llvm-svn: 4760
2002-11-19 20:08:24 +00:00
Chris Lattner
58f9002b4a
Move the function extractor pass from tools/extract into lib/Xform/IPO
...
llvm-svn: 4759
2002-11-19 18:42:59 +00:00
Chris Lattner
52b8fc0c35
Fix testcase: FunctionResolve/2002-11-09-ExternFn.ll
...
llvm-svn: 4668
2002-11-10 03:36:55 +00:00
Chris Lattner
17069b342a
Use the new getMainFunction() method to efficiently locate main
...
llvm-svn: 4630
2002-11-08 20:34:21 +00:00
Chris Lattner
5997c3d866
Fix bug: FunctionResolve/2002-11-07-RetMismatch.ll
...
llvm-svn: 4618
2002-11-08 00:38:20 +00:00
Chris Lattner
3ff5457b32
Really disable pool allocator
...
llvm-svn: 4216
2002-10-17 04:57:09 +00:00
Chris Lattner
149376dee5
- Change Function's so that their argument list is populated when they are
...
constructed. Before, external functions would have an empty argument list,
now a Function ALWAYS has a populated argument list.
llvm-svn: 4149
2002-10-13 20:57:00 +00:00
Chris Lattner
5f9f4e3aac
Account for global variables resolved more accurately.
...
llvm-svn: 4143
2002-10-13 17:30:30 +00:00
Chris Lattner
88dbc4dbe9
Use methods that are more explanatory
...
llvm-svn: 4142
2002-10-13 17:12:47 +00:00
Chris Lattner
1a535e18cd
Stop using DataStructureGraph.h
...
llvm-svn: 4106
2002-10-10 20:33:46 +00:00
Chris Lattner
eac4dcd0bd
- Dramatically simplify the ConstantMerge code now that
...
Value::replaceAllUsesWith works with constants correctly.
llvm-svn: 4104
2002-10-09 23:16:04 +00:00
Chris Lattner
013eca003a
Almost a complete rewrite of FunctionResolution to now resolve functions
...
and global variables.
This fixes bug: FuncResolve/2002-08-19-ResolveGlobalVarsEasier.ll
And bug: SingleSource/UnitTests/2002-10-09-ArrayResolution.c
Note that this does not fix bug:
FunctionResolve/2002-08-19-ResolveGlobalVars.ll because replaceAllUsesWith
breaks when a constantexpr is pointing to the thing being replaced. This
is more of an infrastructure problem than anything.
llvm-svn: 4099
2002-10-09 21:10:06 +00:00
Chris Lattner
68f21bcb1b
Non-functionality change just to make it more clear what is going on
...
llvm-svn: 4060
2002-10-07 18:34:32 +00:00
Chris Lattner
bf3a099a62
Updates to work with recent Statistic's changes:
...
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
* Broke constructor to take two const char * arguments instead of one, so
that indendation can be taken care of automatically.
* Sort the list by pass name when printing
* Make sure to print all statistics as a group, instead of randomly when
the statistics dtors are called.
* Updated ProgrammersManual with new semantics.
llvm-svn: 4002
2002-10-01 22:38:41 +00:00
Chris Lattner
3cf3782bc0
Updates to work with recent Statistic's changes:
...
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
* Broke constructor to take two const char * arguments instead of one, so
that indendation can be taken care of automatically.
* Sort the list by pass name when printing
* Make sure to print all statistics as a group, instead of randomly when
the statistics dtors are called.
* Updated ProgrammersManual with new semantics.
llvm-svn: 4001
2002-10-01 22:38:37 +00:00
Chris Lattner
870a4a5bb4
Converted SimpleStructMutation to take TargetData as a required pass.
...
llvm-svn: 3932
2002-09-26 00:17:21 +00:00
Chris Lattner
28d103548d
Fix: ConstantMerge/2002-09-23-CPR-Update.ll
...
Basically, this bug boiled down to calling replaceUsesOfWith on a constant,
which changed it's shape in an illegal way. This pass now goes through all
of the trouble neccesary to do the replacement on constants.
llvm-svn: 3895
2002-09-23 23:00:46 +00:00
Chris Lattner
facc751260
Don't insert a PHI node to merge "returns" from an inlined function if there
...
is only a single return from the function!
llvm-svn: 3878
2002-09-22 18:41:25 +00:00
Chris Lattner
afb4fc189c
Fix FunctionInlining pass assertion failure:
...
ilist:104: failed assertion `Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"'
llvm-svn: 3768
2002-09-16 22:30:20 +00:00
Misha Brukman
2e8086f046
Function.h is unnecessary when Module.h is included.
...
llvm-svn: 3716
2002-09-14 03:04:02 +00:00
Misha Brukman
09d24c7374
Following Chris's advice, I'm pruning some unnecessary .h includes that I'm
...
noticing. Since Module includes Function, and eventually, BasicBlock and
GlobalVariable, the last three are unnecessary to be included directly.
llvm-svn: 3713
2002-09-14 02:06:53 +00:00
Chris Lattner
fc91ee91e8
Change the MallocInst & AllocaInst ctors to take the allocated type, not the
...
pointer type returned.
llvm-svn: 3711
2002-09-13 22:28:50 +00:00
Chris Lattner
322bf4f3a9
Change the MallocInst & AllocaInst ctors to take the allocated type, not the
...
pointer type returned.
llvm-svn: 3710
2002-09-13 22:28:45 +00:00
Chris Lattner
9674b869e5
Fix bug in previous checkin
...
llvm-svn: 3672
2002-09-10 23:31:12 +00:00
Chris Lattner
f80f7b02b7
Clean up code due to auto-insert constructors
...
llvm-svn: 3666
2002-09-10 22:38:49 +00:00
Chris Lattner
a239e6879d
Clean up code due to auto-insert constructors
...
llvm-svn: 3665
2002-09-10 22:38:47 +00:00
Chris Lattner
5c447863d5
Simplify code (somtimes dramatically), by using the new "auto-insert" feature
...
of instruction constructors.
llvm-svn: 3655
2002-09-10 17:03:06 +00:00
Chris Lattner
5f00d66cc3
Factor silly code duplication out
...
llvm-svn: 3627
2002-09-08 21:47:54 +00:00
Chris Lattner
02fe752fbd
Eliminated the MemAccessInst class, folding contents into GEP class.
...
llvm-svn: 3488
2002-08-22 23:37:24 +00:00
Chris Lattner
67a806ed90
Do not create load/stores with indexes
...
llvm-svn: 3420
2002-08-21 22:10:52 +00:00
Chris Lattner
8f3acc6fde
- Made GlobalDCE worklist driven, making it more successful. Now can handle
...
cases like: test/Regression/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll
llvm-svn: 3381
2002-08-18 01:28:30 +00:00
Chris Lattner
b3c2af69fe
Remove support for NOT instruction
...
llvm-svn: 3313
2002-08-14 17:45:39 +00:00
Chris Lattner
f0ed55d1ee
- Cleaned up the interface to AnalysisUsage to take analysis class names
...
instead of ::ID's.
- Pass::getAnalysis<> now no longer takes an optional argument
llvm-svn: 3265
2002-08-08 19:01:30 +00:00
Chris Lattner
7ff5a21f0f
Remove unneccesary #inlcude
...
llvm-svn: 3200
2002-08-01 20:01:02 +00:00
Chris Lattner
47cc3669ff
* Indent class into anonymous namespace, filling up the diff with garbage
...
* Internalize global variables with initializers
* Add new stat to track global variable internalization
* Only count functions that were not internal before in internalized function
count
llvm-svn: 3163
2002-07-30 19:48:44 +00:00
Chris Lattner
ed37856e69
Fix bug with last patch which would occur when a call returned void and we
...
attempted to assign it a name.
llvm-svn: 3142
2002-07-30 02:42:49 +00:00
Chris Lattner
aacadd1a95
* Make sure the resolved function call instructions get the name from the
...
old call instruction
* Implement conversion of return values for calls. This fixes bug:
test/Regression/Transforms/FunctionResolve/retmismatch3.ll
llvm-svn: 3140
2002-07-30 00:50:49 +00:00
Chris Lattner
c8b7092e54
* Add support for different "PassType's"
...
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses
llvm-svn: 3113
2002-07-26 21:12:46 +00:00
Chris Lattner
a2c0985980
* Add support for different "PassType's"
...
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses
llvm-svn: 3112
2002-07-26 21:12:44 +00:00
Chris Lattner
10073a9080
*** empty log message ***
...
llvm-svn: 3075
2002-07-25 06:17:51 +00:00
Chris Lattner
99a53f6aa9
Eliminate several include/llvm/Transforms/IPO/*.h files, moving their contents into IPO.h
...
llvm-svn: 3043
2002-07-24 17:12:05 +00:00
Chris Lattner
42706e4dec
Merge ChangeAllocations into scalar.h
...
llvm-svn: 3038
2002-07-23 22:04:17 +00:00
Chris Lattner
5afe2f2ccd
Rename header
...
llvm-svn: 3037
2002-07-23 22:04:02 +00:00
Chris Lattner
0db86893eb
Cleanup and simplify code
...
llvm-svn: 3036
2002-07-23 22:03:41 +00:00
Chris Lattner
b0cec70cbc
Incorporate ConstantMerge.h into IPO.h
...
llvm-svn: 3035
2002-07-23 19:57:40 +00:00
Chris Lattner
b28b680155
*** empty log message ***
...
llvm-svn: 3016
2002-07-23 18:06:35 +00:00
Chris Lattner
6788f25f99
* Remove getPassName implementation
...
* Register all Passes
llvm-svn: 3015
2002-07-23 18:06:30 +00:00
Chris Lattner
75a210a63d
* Break the two different behaviors of SimpleStructMutation into two subclasses
...
* Register the passes
llvm-svn: 3013
2002-07-23 18:03:11 +00:00
Chris Lattner
784d54ba4b
* Remove lots of dead stuff
...
* Register Pass
llvm-svn: 3011
2002-07-23 18:01:39 +00:00
Chris Lattner
a896b08b5c
*** empty log message ***
...
llvm-svn: 3002
2002-07-23 17:52:38 +00:00
Chris Lattner
f5cad15a67
*** empty log message ***
...
llvm-svn: 2985
2002-07-22 02:10:13 +00:00
Chris Lattner
6801fdf009
Seperate stats for DCE'd functions and vars
...
llvm-svn: 2961
2002-07-18 06:40:04 +00:00
Chris Lattner
6f21961d67
*** empty log message ***
...
llvm-svn: 2959
2002-07-18 04:43:20 +00:00
Chris Lattner
72f9a86d1e
Only functions with external linkage can be resolved to function declarations.
...
This change fixes programs that have multiple functions named the same thing,
where are least one of them is static/internal.
llvm-svn: 2954
2002-07-18 03:01:24 +00:00
Chris Lattner
dfe041880d
* Correctly get prototype for void*malloc(size_t)
...
llvm-svn: 2951
2002-07-18 00:18:01 +00:00
Chris Lattner
87d180e7c6
Disable pool allocation stuff until data structure analysis is sorted back out
...
llvm-svn: 2869
2002-07-10 22:36:47 +00:00
Chris Lattner
33422fedc2
*** empty log message ***
...
llvm-svn: 2813
2002-06-30 16:25:25 +00:00
Anand Shukla
2bc6419a82
changes to make it compatible with 64bit gcc
...
llvm-svn: 2792
2002-06-25 21:07:58 +00:00
Chris Lattner
113f4f4609
MEGAPATCH checkin.
...
For details, See: docs/2002-06-25-MegaPatchInfo.txt
llvm-svn: 2779
2002-06-25 16:13:24 +00:00
Chris Lattner
7076ff29ed
MEGAPATCH checkin.
...
For details, See: docs/2002-06-25-MegaPatchInfo.txt
llvm-svn: 2778
2002-06-25 16:13:21 +00:00
Chris Lattner
2ae9cda097
Remove DynamicConstantMerge pass, because it did not fit in with the Pass
...
system correctly.
llvm-svn: 2772
2002-06-25 15:55:29 +00:00
Chris Lattner
6eeda027c7
Remove "fixers" for problems in GCC generated code that cannot be generated
...
anymore.
llvm-svn: 2771
2002-06-25 15:55:03 +00:00
Chris Lattner
eef79f1af4
Do not remove type names that contain a .
...
llvm-svn: 2747
2002-05-26 20:17:35 +00:00
Chris Lattner
1eb9e6cc47
Fix "unimplemented features":
...
test/Regression/Transforms/FunctionResolve/retmismatch[12].ll
This makes it much more useful for running benchmarks that are missing
prototypes for some functions.
llvm-svn: 2745
2002-05-24 21:33:26 +00:00
Chris Lattner
5aa9e3e702
Split the FunctionResolution pass out of CleanGCCOutput.cpp.
...
llvm-svn: 2742
2002-05-24 20:42:13 +00:00
Chris Lattner
e3da2980ad
Support programs that do not #include <malloc.h> or give a full prototype
...
for malloc and free. Lots of crufty benchmarks are using stuff like:
char *malloc();
void free();
to forward declare malloc and free. Now we recognize and raise these forms
llvm-svn: 2740
2002-05-24 20:29:18 +00:00
Chris Lattner
acd4599e57
Convert transforms over to standardize debugging output on -debug option
...
llvm-svn: 2714
2002-05-22 17:27:12 +00:00
Chris Lattner
0b18c1d64e
Add support for printing out statistics information when -stats is added to
...
the command line
llvm-svn: 2601
2002-05-10 15:38:35 +00:00
Chris Lattner
03453a0e39
fix comments and documentation in file
...
llvm-svn: 2530
2002-05-07 19:04:39 +00:00
Chris Lattner
77f791dd5b
Split ChangeAllocations.cpp into Raise & LowerAllocations.cpp
...
llvm-svn: 2529
2002-05-07 19:02:48 +00:00
Chris Lattner
7608a46cbe
Updates to move some header files out of include/llvm/Transforms into
...
the Scalar and Utils subdirectories
llvm-svn: 2523
2002-05-07 18:36:35 +00:00
Chris Lattner
9b55e5a2f4
Reduce dependance on TransformInternals.h, instead using the TransformUtils library
...
llvm-svn: 2518
2002-05-07 18:12:18 +00:00
Chris Lattner
39db871f86
Be a little more efficient, do not generate loads and stores with indices in them.
...
llvm-svn: 2430
2002-05-02 17:38:14 +00:00
Chris Lattner
b4de02df67
Eliminate dead global variables
...
llvm-svn: 2400
2002-04-29 18:13:11 +00:00
Chris Lattner
d5a847057b
Eliminate duplicate or unneccesary #include's
...
llvm-svn: 2397
2002-04-29 17:42:12 +00:00
Chris Lattner
37104aace8
Add new optional getPassName() virtual function that a Pass can override
...
to make debugging output a lot nicer.
llvm-svn: 2395
2002-04-29 14:57:45 +00:00
Chris Lattner
f12cc842b3
Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
...
llvm-svn: 2386
2002-04-28 21:27:06 +00:00
Chris Lattner
ca14237696
Split ConstantVals.h into Constant.h and Constants.h
...
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner
ee2e78b86c
Be careful not to make "external" function internal
...
llvm-svn: 2363
2002-04-28 05:48:34 +00:00
Chris Lattner
1b94c007dc
Initial checkin of new "Internalize" pass for GCCLD
...
llvm-svn: 2362
2002-04-28 05:43:27 +00:00
Chris Lattner
f998685cd9
s/Method/Function
...
llvm-svn: 2336
2002-04-27 07:27:19 +00:00
Chris Lattner
c8e665431b
* Rename MethodPass class to FunctionPass
...
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
- Method is now const
- It now takes one AnalysisUsage object to fill in instead of 3 vectors
to fill in
- Pass's now specify which other passes they _preserve_ not which ones
they modify (be conservative!)
- A pass can specify that it preserves all analyses (because it never
modifies the underlying program)
* s/Method/Function/g in other random places as well
llvm-svn: 2333
2002-04-27 06:56:12 +00:00
Chris Lattner
66cfaf1da2
Changes because the Terminator::getSuccessor function now FAILS if successor
...
IDX is out of range instead of returning null.
llvm-svn: 2332
2002-04-27 03:15:45 +00:00
Chris Lattner
0e0c15b17a
* Change Constant::getNullConstant to Constant::getNullValue
...
* Add support for pool allocating array allocations of varying size
llvm-svn: 2329
2002-04-27 02:29:32 +00:00
Chris Lattner
271255b087
Programs that actually free memory were broken
...
llvm-svn: 2307
2002-04-18 22:11:30 +00:00
Chris Lattner
1c8d3f8996
Add a fixme so that we don't forget this is broken.
...
llvm-svn: 2298
2002-04-18 18:52:03 +00:00
Chris Lattner
3e78deaafd
Correctly transform dependant arguments, allowing the perimeter bm to work.
...
llvm-svn: 2282
2002-04-18 14:43:30 +00:00
Chris Lattner
457e1accb2
run an extra pass after a function has been transformed to eliminate
...
obviously duplicate loads of the pool base.
llvm-svn: 2255
2002-04-15 22:42:23 +00:00