Commit Graph

101 Commits

Author SHA1 Message Date
Chris Lattner
65e96e57c5 fix comments and documentation in file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2530 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 19:04:39 +00:00
Chris Lattner
ade686e79b Split ChangeAllocations.cpp into Raise & LowerAllocations.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2529 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 19:02:48 +00:00
Chris Lattner
c8cc4cb03b Updates to move some header files out of include/llvm/Transforms into
the Scalar and Utils subdirectories


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2523 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:36:35 +00:00
Chris Lattner
497c60c0ed Reduce dependance on TransformInternals.h, instead using the TransformUtils library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2518 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-07 18:12:18 +00:00
Chris Lattner
1f8d13c361 Be a little more efficient, do not generate loads and stores with indices in them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2430 91177308-0d34-0410-b5e6-96231b3b80d8
2002-05-02 17:38:14 +00:00
Chris Lattner
f772f8ef38 Eliminate dead global variables
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2400 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 18:13:11 +00:00
Chris Lattner
c6f3ae5c66 Eliminate duplicate or unneccesary #include's
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 17:42:12 +00:00
Chris Lattner
96c466b06a Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-29 14:57:45 +00:00
Chris Lattner
97e52e4336 Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2386 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 21:27:06 +00:00
Chris Lattner
31bcdb822f Split ConstantVals.h into Constant.h and Constants.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:55:58 +00:00
Chris Lattner
100d6daca4 Be careful not to make "external" function internal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2363 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 05:48:34 +00:00
Chris Lattner
dbb1735673 Initial checkin of new "Internalize" pass for GCCLD
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2362 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 05:43:27 +00:00
Chris Lattner
483e14ee04 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 07:27:19 +00:00
Chris Lattner
f57b845547 * 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 06:56:12 +00:00
Chris Lattner
f2361c5e5c Changes because the Terminator::getSuccessor function now FAILS if successor
IDX is out of range instead of returning null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2332 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 03:15:45 +00:00
Chris Lattner
8e343330a5 * Change Constant::getNullConstant to Constant::getNullValue
* Add support for pool allocating array allocations of varying size


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2329 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:29:32 +00:00
Chris Lattner
7b5577b371 Programs that actually free memory were broken
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2307 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 22:11:30 +00:00
Chris Lattner
0154505ab7 Add a fixme so that we don't forget this is broken.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2298 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 18:52:03 +00:00
Chris Lattner
3b87167ac4 Correctly transform dependant arguments, allowing the perimeter bm to work.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2282 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 14:43:30 +00:00
Chris Lattner
09b9212b6e run an extra pass after a function has been transformed to eliminate
obviously duplicate loads of the pool base.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2255 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-15 22:42:23 +00:00
Chris Lattner
3e0e520728 Turn off debug output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2247 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-14 06:14:41 +00:00
Chris Lattner
441d25a9f6 * Allow datasize to be specified on the commandline
* Build new datatypes correctly
* Transform instructions that return null pointers from functions to return
  a null index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2244 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-13 23:13:18 +00:00
Chris Lattner
ddcbd34f56 * Give alloca's for pool descriptors better names than "pool<n>".
* Fill in the pool descriptor links in the pool descriptors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2239 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-13 19:52:54 +00:00
Chris Lattner
027a6755f8 * Add names to the symbol table for pool types and modified types
* Handle more complex structure so that power works almost
* Fix bug with pooldestroy call where we passed in the size of the object
  instead of the pool to destroy.  bisort is now pool allocated successfully!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2238 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-13 19:25:57 +00:00
Chris Lattner
5146a7ddd4 Implement function rewriting to use offsets instead of pointers in programs.
This now works with treeadd at least, and perhaps other programs as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2233 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-12 20:23:15 +00:00
Chris Lattner
265b083e84 * Add documentation
* Split the CleanGCC pass into two passes, a global pass and an IP pass.
  Before it was just a global pass, but it did illegal things to the
  module, which broke other passes that were being scheduled with it by
  gccld.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2224 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-10 20:33:11 +00:00
Chris Lattner
73e214244f Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2216 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:48:49 +00:00
Chris Lattner
42a412711c Add #includes to make up for #includes pruned out of header files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2207 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 18:37:46 +00:00
Chris Lattner
237e6d10f2 s/Method/Function
Remove extraneous #includes of llvm/Assembly/Writer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2178 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 22:03:00 +00:00
Chris Lattner
2fbfdcffd3 Change references to the Method class to be references to the Function
class.  The Method class is obsolete (renamed) and all references to it
are being converted over to Function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 20:49:59 +00:00
Chris Lattner
61f64f9b6a PATypeHolder is now not a template
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2106 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:24:34 +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
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
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
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
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
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
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
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
Chris Lattner
d2d3a16641 Flesh out a bunch more code, print allocations that are poolable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2031 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:40:59 +00:00
Chris Lattner
a637859c71 s/method/function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2030 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:40:25 +00:00
Chris Lattner
0d461f7f09 s/Method/Function/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2029 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:39:36 +00:00
Chris Lattner
bda28f7c2a Initial checkin of Noop pass that will be the pool allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2014 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-28 18:08:31 +00:00
Chris Lattner
79df7c0aaa Change references from Method to Function
change references from MethodARgument to FunctionArgument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1991 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 18:01:55 +00:00
Chris Lattner
f09733a876 Remove code designed to compensate for a bug in GCC. The bug has since
been fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1881 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-15 20:35:21 +00:00