Commit Graph

298797 Commits

Author SHA1 Message Date
Chris Lattner
396d5d7c62 Maintain enough information so that the pools for all of the nodes of
the graph can be passed around.

llvm-svn: 2053
2002-03-30 04:02:31 +00:00
Chris Lattner
f32d65d5ca Implement the first batch of transformations to the methods. So far it:
* Converts malloc instructions to poolalloc
 * Converts free instructions to poolfree
 * Convert calls to call the new cloned hacked up versions

Note that this does not modify hacked up stuff yet, just the top level
function

llvm-svn: 2052
2002-03-29 21:25:19 +00:00
Chris Lattner
619dc920df Add a hook to allow the datastructure to keep naturally up to date, even
though it's not entirely fleshed out.

llvm-svn: 2051
2002-03-29 21:23:29 +00:00
Chris Lattner
3e6e3e6bce * s/Method/Function
* Implement a check to make sure a function is not internal and external
  at the same time

llvm-svn: 2050
2002-03-29 19:06:18 +00:00
Chris Lattner
291a1b1eb2 Correctly clone the function with the extra argument types. Now we need
to modify the function next.

This also properly recycles functions so that we don't get exponential
code blowup in the common case.

llvm-svn: 2049
2002-03-29 19:05:48 +00:00
Chris Lattner
f50cffce10 s/Method/Function
llvm-svn: 2048
2002-03-29 19:04:45 +00:00
Chris Lattner
8fea42d955 Add more accessors
llvm-svn: 2047
2002-03-29 19:04:19 +00:00
Chris Lattner
0623f2984f Checkin new useful routine
llvm-svn: 2046
2002-03-29 19:04:08 +00:00
Chris Lattner
16bfdb5f02 New clone function routine
llvm-svn: 2045
2002-03-29 19:03:54 +00:00
Chris Lattner
692ad5d9bd Find out which calls in the function we need to transform and how.
Next step is to start hacking functions up.

llvm-svn: 2044
2002-03-29 17:13:46 +00:00
Chris Lattner
15deaa0ab9 s/Method/Function
llvm-svn: 2043
2002-03-29 17:08:29 +00:00
Chris Lattner
adbb711895 Rename getCalledMethod to getCalledFunction
llvm-svn: 2042
2002-03-29 17:08:01 +00:00
Chris Lattner
b388895b0a Remove getCalledMethod. Use getCalledFunction instead
llvm-svn: 2041
2002-03-29 17:07:34 +00:00
Chris Lattner
66df97d436 Modularize code a bit
llvm-svn: 2040
2002-03-29 06:21:38 +00:00
Chris Lattner
e0618ca2bd Implement the first step of pool allocation - Creating, initialization, and
destruction of the pools.

llvm-svn: 2039
2002-03-29 05:50:20 +00:00
Chris Lattner
5c1f41eb97 Add an insert method to VAlueHolder to allow batch insertion
llvm-svn: 2038
2002-03-29 05:49:37 +00:00
Chris Lattner
13ae72f175 Add new addTypeName method to Module class
llvm-svn: 2037
2002-03-29 04:48:40 +00:00
Chris Lattner
f94811af13 s/Method/Function
llvm-svn: 2036
2002-03-29 03:57:15 +00:00
Chris Lattner
ff87436f48 s/Method/Function
llvm-svn: 2035
2002-03-29 03:51:11 +00:00
Chris Lattner
91db58298a s/Method/Function
llvm-svn: 2034
2002-03-29 03:44:36 +00:00
Chris Lattner
a483b0616a Implement new getFunction and getOrInsertFunction methods
llvm-svn: 2033
2002-03-29 03:44:18 +00:00
Chris Lattner
c46dcca220 Simplify code a bit by using Module::getOrInsertFunction
llvm-svn: 2032
2002-03-29 03:43:24 +00:00
Chris Lattner
175f37c47b Flesh out a bunch more code, print allocations that are poolable.
llvm-svn: 2031
2002-03-29 03:40:59 +00:00
Chris Lattner
ca1500607e s/method/function
llvm-svn: 2030
2002-03-29 03:40:25 +00:00
Chris Lattner
870b1a2799 s/Method/Function/g
llvm-svn: 2029
2002-03-29 03:39:36 +00:00
Chris Lattner
c13563d5c0 Simplify code a lot by using the Module::getFunction & getOrInsertFunction
llvm-svn: 2028
2002-03-29 03:38:05 +00:00
Chris Lattner
9cd4241633 Expose more information to clients
llvm-svn: 2027
2002-03-29 03:35:30 +00:00
Chris Lattner
5814395906 Add getOrInsertFunction and getFunction methods to Module. This simplifies
some code in the transformations.

llvm-svn: 2026
2002-03-29 03:32:29 +00:00
Chris Lattner
7f357b557b Add #define for MethodType
llvm-svn: 2025
2002-03-29 03:32:00 +00:00
Chris Lattner
05fea314b4 s/Method/Function/
llvm-svn: 2024
2002-03-29 03:30:59 +00:00
Chris Lattner
1e65c6cc27 Rename MethodType to FunctionType, provide a #define
llvm-svn: 2023
2002-03-29 03:15:32 +00:00
Chris Lattner
cd8846ff84 Remove the reduceApply functions they are obsolete things from the days before
we had a reasonable pass system

llvm-svn: 2022
2002-03-28 22:49:49 +00:00
Chris Lattner
8d4894e3fa Implement getEscapingAllocations & getNonEscapingAllocations
llvm-svn: 2021
2002-03-28 19:33:00 +00:00
Chris Lattner
c3ae15cf0b * Rename UnlinkUndistinguishableShadowNodes & RemoveUnreachableShadowNodes
to reflect that they can eliminate arbitrary nodes.
* Rename the ShadowNodeEliminate.cpp file to EliminateNodes.cpp for the
  same reason

llvm-svn: 2020
2002-03-28 19:16:48 +00:00
Chris Lattner
7b4155888d * Remove RemoveUnreachableShadowNodes & UnlinkUndistinguishableShadowNodes
to reflect the fact that they actually operate on arbitrary nodes
* Clean up public interface of FunctionDSGraph
* add getEscapingAllocations & getNonEscapingAllocations

llvm-svn: 2019
2002-03-28 19:15:38 +00:00
Chris Lattner
8a5c470c59 Ooops, I did such a great job pruning nodes, that I accidentally deleted
ALL allocation nodes... hrm... bad.

llvm-svn: 2018
2002-03-28 18:38:38 +00:00
Chris Lattner
674ff853b9 Add subdirs to makefile
llvm-svn: 2017
2002-03-28 18:21:31 +00:00
Chris Lattner
0a0e090e4e Initial checkin of first regression test for mem2reg pass
llvm-svn: 2016
2002-03-28 18:21:05 +00:00
Chris Lattner
97ca0eacb1 Makefile change for IPO's that use the Datastructure analysis stuff
llvm-svn: 2015
2002-03-28 18:10:31 +00:00
Chris Lattner
64fd935489 Initial checkin of Noop pass that will be the pool allocator
llvm-svn: 2014
2002-03-28 18:08:31 +00:00
Chris Lattner
b9530575ef Add hook for pool allocation pass
llvm-svn: 2013
2002-03-28 18:08:07 +00:00
Chris Lattner
564d00792a New file for new pass
llvm-svn: 2012
2002-03-28 18:01:22 +00:00
Chris Lattner
92c3670048 Checking for Cameron
llvm-svn: 2011
2002-03-28 17:56:28 +00:00
Chris Lattner
b1782d0c90 Many changes
* Simplify a lot of the inlining stuff.  There are still problems, but not
  many
* Break up the Function representation to have a vector for every different
  node type so it is fast to find nodes of a particular flavor.
* Do more intelligent merging of call values
* Allow elimination of unreachable shadow and allocation nodes
* Generalize indistinguishability testing to allow merging of identical calls.
* Increase shadow node merging power

llvm-svn: 2010
2002-03-28 17:56:03 +00:00
Chris Lattner
5f3982df6c * Define some operators on PointerVal and PVS's
* Nodes can determine whether they are foldable with another node
* Rename NewDSNode to AllocDSNode
* The Function graph breaks up all of the node types into individual
  vectors to alloc fast access when you are looking for a particular type
  of node.  Simplifies much code.

llvm-svn: 2009
2002-03-28 17:48:41 +00:00
Cameron Buschardt
9dcd905f71 Rename constructor function for mem2reg pass.
llvm-svn: 2008
2002-03-27 23:29:23 +00:00
Cameron Buschardt
fea5661d49 * Move classes around
* rename constructor function
* Move stuff into anonymous namespaces

llvm-svn: 2007
2002-03-27 23:28:40 +00:00
Cameron Buschardt
a7b7b432cf Rename constructor function
llvm-svn: 2006
2002-03-27 23:27:45 +00:00
Cameron Buschardt
baef5b2ee2 Implemented promote mem->reg pass.
llvm-svn: 2005
2002-03-27 23:17:37 +00:00
Chris Lattner
be449bc1ef * Add #define to enabled debug messages
* Move removeEdgesTo to be a member of DSNode
* Implement (but #ifdef out) the new, spiffier, method of determining
  shadow node equivalence.  This cannot be enabled until more is
  implemented.

llvm-svn: 2004
2002-03-27 19:48:03 +00:00