Commit Graph

178 Commits

Author SHA1 Message Date
Chris Lattner
019a7c801b Fix references to functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5222 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-13 00:27:23 +00:00
Vikram S. Adve
d86deb689b External routines used to identify Cilk operations inserted by the
parallelization pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4965 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-10 13:08:48 +00:00
Vikram S. Adve
e12c74c07b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4962 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-10 00:43:34 +00:00
Chris Lattner
da3c8a7674 Fix symbol table problem
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4785 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 19:32:43 +00:00
Chris Lattner
6e6026b465 - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-20 18:36:02 +00:00
Chris Lattner
d18015599c Minor changes to cloning interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4770 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 22:54:01 +00:00
Chris Lattner
dcd8040d11 Rework inline pass to use cloning infrastructure to do the dirty work
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4766 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 21:54:07 +00:00
Chris Lattner
309f19391b Start using the new function cloning header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4764 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 20:59:41 +00:00
Chris Lattner
e6aa37388a Move MutatStructTypes.h out of IPO
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4762 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 20:49:40 +00:00
Chris Lattner
36b7cc3b06 Rename CloneFunction.h to Cloning.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4760 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 20:08:24 +00:00
Chris Lattner
5113eb0c52 Move the function extractor pass from tools/extract into lib/Xform/IPO
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4759 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-19 18:42:59 +00:00
Chris Lattner
a2b8d7bff2 Fix testcase: FunctionResolve/2002-11-09-ExternFn.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4668 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 03:36:55 +00:00
Chris Lattner
93fbd733e7 Use the new getMainFunction() method to efficiently locate main
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4630 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 20:34:21 +00:00
Chris Lattner
6f23963adc Fix bug: FunctionResolve/2002-11-07-RetMismatch.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4618 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 00:38:20 +00:00
Chris Lattner
c966a2acee Really disable pool allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4216 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-17 04:57:09 +00:00
Chris Lattner
69da5cf261 - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 20:57:00 +00:00
Chris Lattner
eaa359586c Account for global variables resolved more accurately.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4143 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 17:30:30 +00:00
Chris Lattner
66c25ff438 Use methods that are more explanatory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4142 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-13 17:12:47 +00:00
Chris Lattner
7a11a94183 Stop using DataStructureGraph.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4106 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-10 20:33:46 +00:00
Chris Lattner
c67ebfa788 - Dramatically simplify the ConstantMerge code now that
Value::replaceAllUsesWith works with constants correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4104 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 23:16:04 +00:00
Chris Lattner
a45ec54a02 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4099 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-09 21:10:06 +00:00
Chris Lattner
7c1faf0f59 Non-functionality change just to make it more clear what is going on
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4060 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-07 18:34:32 +00:00
Chris Lattner
a92f696b74 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:38:41 +00:00
Chris Lattner
6ee6bbeb04 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4001 91177308-0d34-0410-b5e6-96231b3b80d8
2002-10-01 22:38:37 +00:00
Chris Lattner
3a15d70734 Converted SimpleStructMutation to take TargetData as a required pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3932 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-26 00:17:21 +00:00
Chris Lattner
e4314ed315 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3895 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-23 23:00:46 +00:00
Chris Lattner
bdccb00970 Don't insert a PHI node to merge "returns" from an inlined function if there
is only a single return from the function!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3878 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-22 18:41:25 +00:00
Chris Lattner
dbcbe3f7e8 Fix FunctionInlining pass assertion failure:
ilist:104: failed assertion `Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3768 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-16 22:30:20 +00:00
Misha Brukman
655fb5c817 Function.h is unnecessary when Module.h is included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3716 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 03:04:02 +00:00
Misha Brukman
520eaff91a 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3713 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-14 02:06:53 +00:00
Chris Lattner
e87e1c9aa9 Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-13 22:28:50 +00:00
Chris Lattner
05804b7459 Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-13 22:28:45 +00:00
Chris Lattner
08c2e4838d Fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3672 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 23:31:12 +00:00
Chris Lattner
f2d2d0bb13 Clean up code due to auto-insert constructors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3666 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 22:38:49 +00:00
Chris Lattner
1d608abbc0 Clean up code due to auto-insert constructors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3665 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 22:38:47 +00:00
Chris Lattner
3ea5cb0df1 Simplify code (somtimes dramatically), by using the new "auto-insert" feature
of instruction constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3655 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-10 17:03:06 +00:00
Chris Lattner
5fb724332a Factor silly code duplication out
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3627 91177308-0d34-0410-b5e6-96231b3b80d8
2002-09-08 21:47:54 +00:00
Chris Lattner
3bb8ad27a8 Eliminated the MemAccessInst class, folding contents into GEP class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3488 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-22 23:37:24 +00:00
Chris Lattner
3f9b28d075 Do not create load/stores with indexes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3420 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-21 22:10:52 +00:00
Chris Lattner
0bfb6ba3e3 - Made GlobalDCE worklist driven, making it more successful. Now can handle
cases like: test/Regression/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3381 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-18 01:28:30 +00:00
Chris Lattner
e4c3764a9f Remove support for NOT instruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3313 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-14 17:45:39 +00:00
Chris Lattner
5f0eb8da62 - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
 - Pass::getAnalysis<> now no longer takes an optional argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3265 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-08 19:01:30 +00:00
Chris Lattner
cc8d8fb676 Remove unneccesary #inlcude
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3200 91177308-0d34-0410-b5e6-96231b3b80d8
2002-08-01 20:01:02 +00:00
Chris Lattner
55e41ba3d2 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3163 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 19:48:44 +00:00
Chris Lattner
e902bda4ce Fix bug with last patch which would occur when a call returned void and we
attempted to assign it a name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3142 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 02:42:49 +00:00
Chris Lattner
9cf307fdeb * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3140 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-30 00:50:49 +00:00
Chris Lattner
a6275ccdf5 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3113 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 21:12:46 +00:00
Chris Lattner
1e43516dcf * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3112 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-26 21:12:44 +00:00
Chris Lattner
0c0edf8afc *** empty log message ***
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3075 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-25 06:17:51 +00:00
Chris Lattner
568ddabc8f Eliminate several include/llvm/Transforms/IPO/*.h files, moving their contents into IPO.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3043 91177308-0d34-0410-b5e6-96231b3b80d8
2002-07-24 17:12:05 +00:00