Commit Graph

307 Commits

Author SHA1 Message Date
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
b9ddce65c2 Eliminate the PromoteInstance class, incorporating it into the PromotePass
class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2375 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 19:12:38 +00:00
Chris Lattner
0adb9f95ea Eliminate visited, CurrentValue, and WriteSets as instance variables of
PromoteInstance.  Make them local variables that are passed around as
appropriate.  Especially in the case of CurrentValue, this makes the
code simpler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2374 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 18:54:01 +00:00
Chris Lattner
5b5df1747f * Fix bug: test/Regression/Transforms/Mem2Reg/2002-03-28-UninitializedVal.ll
* Minor cleanup that was missed in last patch


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2373 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 18:39:46 +00:00
Chris Lattner
9f4eb01dd4 This huge changeset is a strictly cleanup change
Bugfixes will come in the next revision so that the diff is obvious.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2372 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 18:27:55 +00:00
Chris Lattner
1b7f7dc4b4 Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classes
to the global namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2370 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 16:21:30 +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
d80e973cec Initial checkin of simple&fast SSA based GCSE algorithm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2338 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 00:47:11 +00:00
Chris Lattner
a298d27808 Change the Dominator info and LoopInfo classes to keep track of BasicBlock's, not
const BasicBlocks


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2337 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-28 00:15:57 +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
1a18b7cf80 Change Constant::getNullConstant to Constant::getNullValue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2323 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-27 02:25:14 +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
dd841aeb8d Significantly rework InstructionCombining to work better and to be cleaner.
We now use an InstVisitor to delegate to different cases that we are
interested in handling.  We also fix the FIXME's by adding users to the
worklist when appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2292 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 17:39:14 +00:00
Chris Lattner
2a632551a7 Convert SCCP over to use InstVisitor instead of hand crafted switch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2286 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 15:13:15 +00:00
Chris Lattner
6428a27ee3 GEP instructions can never be constant propogated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2284 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 14:44:13 +00:00
Chris Lattner
27e3420ce9 Store instructions always return void, so they never get a name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2283 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-18 14:43:54 +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
4a94a70250 Add casts for documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2272 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-16 22:10:52 +00:00
Chris Lattner
169bffe28a * Clean up the code a bit
* Allow structs with negative offsets.  This enables the em3d benchmark to
  be made typesafe.  In this case, the struct had an array as the first
  element, so a negative index was ok (the expr was -8 + 8x)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2271 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-16 22:10:36 +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
8d70cd9607 Eliminate cast of same type instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2251 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-15 19:45:29 +00:00
Chris Lattner
649f5dd77a * s/Method/Function
* Fix bug where the character after a % was being discarded


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2248 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-14 06:15:24 +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
ca180c7ca3 Implement TODO, fixing bug:
test/Regression/Transforms/LevelRaise/2002-04-09-MissedRaise.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2219 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 20:53:36 +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
0ac5429ff0 Add explicit #includes of Function.h to make up for the removed #include
in iOther.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2209 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-09 19:08:28 +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
968ddc921e ConstantHandling moved into VMCore library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2165 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-08 20:18:09 +00:00
Chris Lattner
87182ae6ba Eliminate explicit use of Writer library, using debug dump output instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2147 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-07 22:31:23 +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
2aac6bf66a s/MethodType/FunctionType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2115 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 22:19:18 +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