1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-28 14:32:51 +01:00
Commit Graph

1980 Commits

Author SHA1 Message Date
Chris Lattner
19689af3bb Support resolving function arguments/return values to pointers that index
into other objects.

llvm-svn: 2094
2002-04-01 22:20:48 +00:00
Vikram S. Adve
0035fcbea1 Case numbers were not updated when Sparc.burg.in was changed
to add separate label for bitwise NOT operator.

llvm-svn: 2091
2002-04-01 20:28:48 +00:00
Chris Lattner
dc6c89b725 Move the PromoteMemoryToRegister pass to be run _after_ the raise pointer
references pass, so it is given the chance to do some good!

llvm-svn: 2089
2002-04-01 19:45:11 +00:00
Chris Lattner
0f0829f28d Add a new replaceWith method useful for replacing instructions
llvm-svn: 2088
2002-04-01 17:52:16 +00:00
Chris Lattner
2e3a4dece6 Allow scalars that point to multiple nodes when building the scalar map.
llvm-svn: 2087
2002-04-01 01:26:53 +00:00
Chris Lattner
99da111daf Add extra case here to avoid getting spurious output
llvm-svn: 2086
2002-04-01 00:45:33 +00:00
Chris Lattner
62756e4208 Avoid incorrectly adding null values to the scalar map!
llvm-svn: 2085
2002-04-01 00:45:09 +00:00
Chris Lattner
e66e651b68 Critical shadow nodes no do not know their parent explictly.
llvm-svn: 2084
2002-04-01 00:15:30 +00:00
Chris Lattner
61f6065cef Minor cleanups (use dyn_cast instead of testing manually)
Shadow nodes now don't explicitly know their parent.

llvm-svn: 2083
2002-04-01 00:14:41 +00:00
Chris Lattner
a68c92a3d4 Allow merging of identical call nodes. Make the shadow node pointed to
by the call node noncritical before the call is destroyed.

llvm-svn: 2082
2002-04-01 00:13:56 +00:00
Chris Lattner
f9097b54be Increase limit for perimeter
llvm-svn: 2081
2002-04-01 00:12:58 +00:00
Chris Lattner
ce662b0ee9 Shadow nodes don't need to know their explicit parent, they just need to
know what type to be.

llvm-svn: 2080
2002-04-01 00:12:36 +00:00
Chris Lattner
42145d8a25 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.

llvm-svn: 2079
2002-03-31 19:57:44 +00:00
Vikram S. Adve
e665a992a9 1. Fix a leftover bug in generating memory instructions.
2. Fix type used for TmpInstruction holding the return address.

llvm-svn: 2075
2002-03-31 19:07:35 +00:00
Vikram S. Adve
257e4d18da Added function getCallInstIndirectAddrVal() to set call interference
for that value.

llvm-svn: 2074
2002-03-31 19:04:50 +00:00
Vikram S. Adve
8efa40ac63 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.

llvm-svn: 2073
2002-03-31 19:03:58 +00:00
Vikram S. Adve
6ac730799c Add method getCallInstIndirectAddrVal() to add call interference
for this value.

llvm-svn: 2072
2002-03-31 18:58:49 +00:00
Vikram S. Adve
44ee4184e4 Add method clearCallInterference().
llvm-svn: 2071
2002-03-31 18:58:14 +00:00
Vikram S. Adve
c2c33ba3fd Include temp. values when computing max. size of stack frame!
llvm-svn: 2070
2002-03-31 18:57:49 +00:00
Vikram S. Adve
1e6ab6f476 Fix a bug in previous bug fix.
llvm-svn: 2069
2002-03-31 18:56:51 +00:00
Vikram S. Adve
fbdd533059 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.

llvm-svn: 2068
2002-03-31 18:54:37 +00:00
Chris Lattner
c620b825b6 Add debug output
llvm-svn: 2066
2002-03-31 07:17:46 +00:00
Chris Lattner
164b766137 * Fix nondeleted type handle which could cause type pool corruption (and
a memory leak)
* Fix memory leak of Argument nodes on function prototypes

llvm-svn: 2065
2002-03-31 07:16:49 +00:00
Chris Lattner
8528806b33 * Move the isEquivalentTo implementations here. They can probably be put
someplace nicer in the file though.
* Add new dump method for debugging

llvm-svn: 2064
2002-03-31 07:16:08 +00:00
Chris Lattner
d2c39a02f7 Print out the instruction instead of just the address!
llvm-svn: 2063
2002-03-31 07:15:20 +00:00
Chris Lattner
aba1ef6fc9 * 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

llvm-svn: 2062
2002-03-31 07:14:52 +00:00
Chris Lattner
f1a2a9c168 * 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!

llvm-svn: 2061
2002-03-31 07:13:27 +00:00
Chris Lattner
0a70c8a163 * Allow access to DSNode iterator as DSNode::iterator/begin/end
* Add debugging "dump" method to DSNode
* Fix bugs in DSNode iterator

llvm-svn: 2060
2002-03-31 07:11:20 +00:00
Vikram S. Adve
f057ff78fb Fix CreateUIntSetInstruction() to handle sign extensions correctly.
llvm-svn: 2059
2002-03-31 00:13:12 +00:00
Chris Lattner
4c4a273f43 * 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!

llvm-svn: 2058
2002-03-30 20:53:14 +00:00
Chris Lattner
c3b299b9ba Initial checkin of file:
Define an iterator to operate over data structure outgoing links and
graph implementation so generic graph functions can be used.

llvm-svn: 2057
2002-03-30 09:13:23 +00:00
Chris Lattner
410c6394d3 * 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

llvm-svn: 2056
2002-03-30 09:12:35 +00:00
Chris Lattner
06ffc5b249 Add accessors and a method to get all the outgoing links for ALL nodes
llvm-svn: 2055
2002-03-30 09:07:51 +00:00
Chris Lattner
fb50c702c4 Add an accessor
llvm-svn: 2054
2002-03-30 04:02:41 +00:00
Chris Lattner
36d50d01ab 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
a4b9a9f573 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
289f7690fe 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
c7df07c3f8 * 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
9166ac0b3f 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
b6b7c3fe60 s/Method/Function
llvm-svn: 2048
2002-03-29 19:04:45 +00:00
Chris Lattner
c8291c9eb1 Add more accessors
llvm-svn: 2047
2002-03-29 19:04:19 +00:00
Chris Lattner
4e65b19a54 Checkin new useful routine
llvm-svn: 2046
2002-03-29 19:04:08 +00:00
Chris Lattner
57dd5ed245 New clone function routine
llvm-svn: 2045
2002-03-29 19:03:54 +00:00
Chris Lattner
6b1ce137c2 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
5df9c977e1 s/Method/Function
llvm-svn: 2043
2002-03-29 17:08:29 +00:00
Chris Lattner
4e79dc8099 Rename getCalledMethod to getCalledFunction
llvm-svn: 2042
2002-03-29 17:08:01 +00:00
Chris Lattner
01affcf43e Remove getCalledMethod. Use getCalledFunction instead
llvm-svn: 2041
2002-03-29 17:07:34 +00:00
Chris Lattner
3a9f1dd66a Modularize code a bit
llvm-svn: 2040
2002-03-29 06:21:38 +00:00
Chris Lattner
7c2529076a 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
18cc6a9277 Add an insert method to VAlueHolder to allow batch insertion
llvm-svn: 2038
2002-03-29 05:49:37 +00:00