Commit Graph

1982 Commits

Author SHA1 Message Date
Chris Lattner
c269bd9232 * Add dump() virtual function to AbstractType user to help track down bugs
* PATypeHolder is now a nontemplated class, because it was (almost) only
  ever instantiated with 'Type' as the parameter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2095 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:18:00 +00:00
Chris Lattner
a13d6ceed7 Support resolving function arguments/return values to pointers that index
into other objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2094 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 22:20:48 +00:00
Vikram S. Adve
85e1e9c22f Case numbers were not updated when Sparc.burg.in was changed
to add separate label for bitwise NOT operator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2091 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 20:28:48 +00:00
Chris Lattner
69cd2b1ade Move the PromoteMemoryToRegister pass to be run _after_ the raise pointer
references pass, so it is given the chance to do some good!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2089 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 19:45:11 +00:00
Chris Lattner
bb063f38fa Add a new replaceWith method useful for replacing instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2088 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 17:52:16 +00:00
Chris Lattner
f8285d4d8f Allow scalars that point to multiple nodes when building the scalar map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2087 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 01:26:53 +00:00
Chris Lattner
f7196949bb Add extra case here to avoid getting spurious output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2086 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 00:45:33 +00:00
Chris Lattner
e0d1d1acf6 Avoid incorrectly adding null values to the scalar map!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2085 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 00:45:09 +00:00
Chris Lattner
dba61f34e8 Critical shadow nodes no do not know their parent explictly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2084 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 00:15:30 +00:00
Chris Lattner
3feaf02c47 Minor cleanups (use dyn_cast instead of testing manually)
Shadow nodes now don't explicitly know their parent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2083 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 00:14:41 +00:00
Chris Lattner
f30185fdfb Allow merging of identical call nodes. Make the shadow node pointed to
by the call node noncritical before the call is destroyed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2082 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 00:13:56 +00:00
Chris Lattner
bab4a90cb9 Increase limit for perimeter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2081 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 00:12:58 +00:00
Chris Lattner
aedcb72805 Shadow nodes don't need to know their explicit parent, they just need to
know what type to be.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2080 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-01 00:12:36 +00:00
Chris Lattner
0b7c85c06a Unify the destruction code used for node pairs vs normal nodes. This was
causing a problem before because global values with incoming edges didn't
copy the incoming edges to the node they were being merged from, causing
the poolalloc pass to die.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2079 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 19:57:44 +00:00
Vikram S. Adve
a10d1a7aaa 1. Fix a leftover bug in generating memory instructions.
2. Fix type used for TmpInstruction holding the return address.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2075 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 19:07:35 +00:00
Vikram S. Adve
a44c6c00a2 Added function getCallInstIndirectAddrVal() to set call interference
for that value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2074 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 19:04:50 +00:00
Vikram S. Adve
fbd2161628 Minor cleanup in printing constants. I think this included a bug
fix related to putting a read-write variable in a read-only section,
but I'm not sure now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2073 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 19:03:58 +00:00
Vikram S. Adve
d0bac69792 Add method getCallInstIndirectAddrVal() to add call interference
for this value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2072 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:58:49 +00:00
Vikram S. Adve
1f81861028 Add method clearCallInterference().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2071 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:58:14 +00:00
Vikram S. Adve
fa79e6e869 Include temp. values when computing max. size of stack frame!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2070 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:57:49 +00:00
Vikram S. Adve
1792779edf Fix a bug in previous bug fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2069 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:56:51 +00:00
Vikram S. Adve
1a53f03392 Bug fix: address used by indirect call instruction should also
be marked as having a Call Interference, even though it may not
be live after the call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2068 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 18:54:37 +00:00
Chris Lattner
9acfbeeaa8 Add debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2066 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:17:46 +00:00
Chris Lattner
09c07538a8 * Fix nondeleted type handle which could cause type pool corruption (and
a memory leak)
* Fix memory leak of Argument nodes on function prototypes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2065 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:16:49 +00:00
Chris Lattner
b28bf05483 * Move the isEquivalentTo implementations here. They can probably be put
someplace nicer in the file though.
* Add new dump method for debugging


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2064 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:16:08 +00:00
Chris Lattner
e6b552fd86 Print out the instruction instead of just the address!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2063 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:15:20 +00:00
Chris Lattner
44cf390784 * Move isEquivalentTo implementations to NodeImpl
* Implement a new form of node folding to catch cases missed in Addtree
* Add removeIndistinguishableNodePairs to merge calls (todo) and globals


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2062 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:14:52 +00:00
Chris Lattner
26cfa6664c * Convert CallMap to be a vector, because the keys can change, and the map
doesn't resort!
* Be more generous with the cached matches that we allow now.
* Recursive calls should all work now!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2061 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:13:27 +00:00
Chris Lattner
41deedf32f * Allow access to DSNode iterator as DSNode::iterator/begin/end
* Add debugging "dump" method to DSNode
* Fix bugs in DSNode iterator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2060 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 07:11:20 +00:00
Vikram S. Adve
f7cedec1f2 Fix CreateUIntSetInstruction() to handle sign extensions correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2059 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-31 00:13:12 +00:00
Chris Lattner
072d3a0224 * Catch and ignore (for now) return instructions in tranformed functions
* Add more debugging output
* Fix problems refering to wrong versions of various graphs
* Build the pool descriptor map!
* Clear the nodemapping map after building pool descriptor to avoid assert
* Transform the NEw function body, not the old one...
* Matrix.ll now works!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2058 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 20:53:14 +00:00
Chris Lattner
f9957c2960 Initial checkin of file:
Define an iterator to operate over data structure outgoing links and
graph implementation so generic graph functions can be used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2057 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 09:13:23 +00:00
Chris Lattner
cfb5f4ce2e * Clean up data structures [AllocDSNode -> DSNode]
* TransformFunctionInfo now has call field form field mapping.  May be
  removed in the future.
* Moved the computation of "Scalars" into transformFunctionBody so
  transformFunction didn't have to recompute it.
* Implement the node mapping calculation in preparation to calculate
  PoolDescriptors to pass to transformFunctionBody
* Print out the node mapping [it looks right!]
* Other minor changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2056 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 09:12:35 +00:00
Chris Lattner
9a691dbc82 Add accessors and a method to get all the outgoing links for ALL nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2055 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 09:07:51 +00:00
Chris Lattner
5cddb2f0f8 Add an accessor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2054 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 04:02:41 +00:00
Chris Lattner
4c7f3dfeaa Maintain enough information so that the pools for all of the nodes of
the graph can be passed around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2053 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-30 04:02:31 +00:00
Chris Lattner
9d3493e533 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2052 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 21:25:19 +00:00
Chris Lattner
8aaa6e0f86 Add a hook to allow the datastructure to keep naturally up to date, even
though it's not entirely fleshed out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2051 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 21:23:29 +00:00
Chris Lattner
a5c3dec126 * s/Method/Function
* Implement a check to make sure a function is not internal and external
  at the same time


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2050 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:06:18 +00:00
Chris Lattner
a744451856 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2049 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:05:48 +00:00
Chris Lattner
f40b4792eb s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2048 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:04:45 +00:00
Chris Lattner
3c11fb501d Add more accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2047 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:04:19 +00:00
Chris Lattner
7dab15def6 Checkin new useful routine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2046 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:04:08 +00:00
Chris Lattner
fa703a4ae5 New clone function routine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2045 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 19:03:54 +00:00
Chris Lattner
d250f4294e Find out which calls in the function we need to transform and how.
Next step is to start hacking functions up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2044 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 17:13:46 +00:00
Chris Lattner
dc89f87d52 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2043 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 17:08:29 +00:00
Chris Lattner
87f856c793 Rename getCalledMethod to getCalledFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2042 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 17:08:01 +00:00
Chris Lattner
b5085a7d04 Remove getCalledMethod. Use getCalledFunction instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2041 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 17:07:34 +00:00
Chris Lattner
9d89190434 Modularize code a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2040 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 06:21:38 +00:00
Chris Lattner
54ce13f983 Implement the first step of pool allocation - Creating, initialization, and
destruction of the pools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2039 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 05:50:20 +00:00