Commit Graph

1243 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
b04bb3f158 Add an insert method to VAlueHolder to allow batch insertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2038 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 05:49:37 +00:00
Chris Lattner
68e5ed8dbe Add new addTypeName method to Module class
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2037 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 04:48:40 +00:00
Chris Lattner
b408b12556 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2036 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:57:15 +00:00
Chris Lattner
c9aa7dfee4 s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2035 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:51:11 +00:00
Chris Lattner
6bfd6a578a s/Method/Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2034 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:44:36 +00:00
Chris Lattner
6056c49ca0 Implement new getFunction and getOrInsertFunction methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2033 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:44:18 +00:00
Chris Lattner
89851077da Simplify code a bit by using Module::getOrInsertFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2032 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:43:24 +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
be591a78cf Simplify code a lot by using the Module::getFunction & getOrInsertFunction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2028 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-29 03:38:05 +00:00
Chris Lattner
21ba3fec99 Remove the reduceApply functions they are obsolete things from the days before
we had a reasonable pass system


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2022 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-28 22:49:49 +00:00
Chris Lattner
4dc1f82e7e Implement getEscapingAllocations & getNonEscapingAllocations
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2021 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-28 19:33:00 +00:00
Chris Lattner
7d093d4231 * Rename UnlinkUndistinguishableShadowNodes & RemoveUnreachableShadowNodes
to reflect that they can eliminate arbitrary nodes.
* Rename the ShadowNodeEliminate.cpp file to EliminateNodes.cpp for the
  same reason


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2020 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-28 19:16:48 +00:00
Chris Lattner
cdae0b2591 Ooops, I did such a great job pruning nodes, that I accidentally deleted
ALL allocation nodes... hrm... bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2018 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-28 18:38:38 +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
1120c8b34a 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2010 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-28 17:56:03 +00:00
Cameron Buschardt
b1be061a76 * Move classes around
* rename constructor function
* Move stuff into anonymous namespaces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2007 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 23:28:40 +00:00
Cameron Buschardt
98a37c2b9c Implemented promote mem->reg pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2005 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 23:17:37 +00:00
Chris Lattner
2ba3a72c3a * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2004 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 19:48:03 +00:00
Chris Lattner
6088c4f55e * Implement DSNode::removeAllIncomingEdges
* Implement Critical Shadow node handling
* Implement routines to determine whether an allocation node is a malloc
  or alloca


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2003 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 19:46:05 +00:00
Chris Lattner
f4066b3fe1 * Add critical node support
* Optimize graph after building it.  This should be unneccesary in the future


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2002 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 19:45:12 +00:00
Chris Lattner
ea4af65b72 * Destroy alloca nodes when a graph gets inlined
* Add links to all subtrees when a shadow node gets resolved
* Add critical node handling


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2001 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 19:44:33 +00:00
Chris Lattner
9d42a1d2f9 * Optimizers return true on change
* Implement indistinguishable shadow node elimination


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1999 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 00:55:13 +00:00
Chris Lattner
dd3fc184f5 Fix long line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1998 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 00:54:31 +00:00
Chris Lattner
df8af1ca89 * Because of optimization, the shadow nodes between arguments might get
removed.  Check to see if they are there.
* Repeat optimizations while changing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1997 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-27 00:53:57 +00:00
Chris Lattner
bb2a28fec5 Initial checkin of Datastructure analysis.
Has bugs, but shouldn't crash in theory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1994 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 22:39:06 +00:00
Chris Lattner
9a3d69649a Change from Method to Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1992 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 18:02:30 +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
b0d04726db Convert to use new style casts instead of direct checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1990 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 17:58:12 +00:00
Chris Lattner
e590ff260e change refs to Method to Function
Change references to MEthodArgument to FunctionArgument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1989 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 17:55:33 +00:00
Chris Lattner
b277d1d0e0 Remove unneccesary forward declarations for classes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1987 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-26 17:49:00 +00:00
Vikram S. Adve
dfe412dc8b Refix bug: Add back method MachineCodeForInstruction::dropAllReferences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1980 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:58:02 +00:00
Vikram S. Adve
b6efb3605f Moved to directory Scalar/ and renamed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1977 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:55:06 +00:00
Vikram S. Adve
9c4f7268c6 Destroy MethodLiveVarInfo after register allocation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1976 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:54:03 +00:00
Vikram S. Adve
97fb99bc54 Use deterministic iterator for SchedGraphs. This is actually not
useful right now when we only do local scheduling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1975 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:53:03 +00:00
Vikram S. Adve
1392d6903c Bug fix: nextToTry was not being initialized in one case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1974 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:46:15 +00:00
Vikram S. Adve
7c7e46ae5f Add option to disable scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1973 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:45:35 +00:00
Vikram S. Adve
802cec485f Add option to disable scheduling.
Destroy live-variable information after scheduling so it is
recomputed before later phases (e.g., reg. allocation).
Use deterministic iterator to enumerate sched graphs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1972 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:44:55 +00:00
Vikram S. Adve
cf8a98f2c2 Minor changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1971 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:40:59 +00:00
Vikram S. Adve
ded1bf8cd8 Re-fix bug: Put back MachineCodeForInstruction::dropAllReferences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1970 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:40:11 +00:00
Vikram S. Adve
e4e4d4e2f9 Fix padding for variables allocated on stack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1969 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:39:26 +00:00
Vikram S. Adve
c941b87397 Major overhaul to FoldGetElemPtr to handle mixed array and struct refs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1968 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:37:53 +00:00
Vikram S. Adve
4e7bc49b54 Use deterministic iterator for treeRoots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1967 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:36:52 +00:00
Vikram S. Adve
d7e6becd3e Bug re-fix: put back MachineCodeForInstruction::get(*I).dropAllReferences().
Also re-enable instr. scheduling pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1966 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:35:16 +00:00
Vikram S. Adve
585612e556 Change latencies for Load, Store and Branch instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1965 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:33:53 +00:00
Vikram S. Adve
fd3900ad57 Major enhancements to how array and structure indices are handled.
Improve checking for constants in Multiply.
Simpler method to keep track of when a node is folded into its parent.
Several other bug fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1964 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:33:02 +00:00
Vikram S. Adve
d95919cbd0 Change treeRoots data structure to make enumeration deterministic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1962 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:24:00 +00:00
Vikram S. Adve
98d64f8d51 Major overhaul to support arbitrary mixed array and structure indices.
Also moved to the Scalar/ directory and renamed to "MultiDim".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1961 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-24 03:21:18 +00:00
Chris Lattner
e7506a366e Rename Method to Function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1957 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-23 22:51:58 +00:00
Vikram S. Adve
dfbbf7a631 New pass to decompose multi-dimensional array references into
a sequence of 1-D references, using a sequence of getElementPtrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1948 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-23 20:43:39 +00:00
Chris Lattner
bbe7bbe4d9 Add an assertion that would hopefully catch a problem that was tripping
cameron up


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1944 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-22 18:01:58 +00:00
Chris Lattner
5f4a5289d4 Fix bug test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise3.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1943 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 23:02:37 +00:00
Chris Lattner
8e640f1fc9 Fix test/Regression/Transforms/LevelRaise/2002-03-21-MissedRaise2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1941 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 22:39:59 +00:00
Chris Lattner
4fe130c22b * AllocationInst ctor moved here from iMemory.h
* AllocationInst now always has an array size operand


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1939 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 22:37:48 +00:00
Chris Lattner
599ca72f5f Fix test/Regression/Other/2002-03-21-LevelRaiseMiss.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1933 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 21:21:13 +00:00
Chris Lattner
9e77f7e08b Make ConvertableToGEP handle cases where the user is indexing into the
first element of a structure type.  Before this would not be handled because
getStructOffset would either stop immediately (because StopEarly was true
and Offset = 0), or blast past the level we wanted.

Now ConvertableToGEP steps down through the type one level at a time, checking
the Offset and Scale conditions at each step


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1931 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 06:27:20 +00:00
Chris Lattner
8e86542fb6 Implement the new InsertInstBeforeInst function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1930 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 06:24:00 +00:00
Chris Lattner
45ef5c26d4 Fix the: test/Regression/Other/2002-03-20-LevelRaiseCrash.ll bug. It turned
out that almost always the result of the add was the same as the GEP that
would be generated.  In this case, however, it wasn't, so bad things happened.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1929 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 06:22:23 +00:00
Chris Lattner
f78642bc06 Declare the new InsertInstBeforeInst function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1927 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 06:15:53 +00:00
Chris Lattner
150dcb9e2d Add an assertion to catch a misuse of replaceAllUsesWith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1924 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 05:38:15 +00:00
Chris Lattner
99fb91cc2f 1. Fix bug test/Regression/Other/2002-03-20-LevelRaiseBadCodegen.ll
2. Allow negative scales in ConvertableToGEP, so that this loop from
   alloc_tree in the Olden health benchmark is correctly raised:

       for (i = 3; i >= 0; i--)
         fval[i] = alloc_tree(level - 1, label*4 + i + 1, new);

   Stepping through the array backwards caused a negative scale.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1922 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 03:04:38 +00:00
Chris Lattner
ebcd28eb15 Namespace qualify debugging code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1921 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-21 03:02:07 +00:00
Vikram S. Adve
4a12da7912 Fixed several problems with handling arguments to Phis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1910 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:47:26 +00:00
Vikram S. Adve
9cf85a75d2 Big bug fix: killed uses were being inserted instead of erased!
Also added a set of debug options.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1909 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:45:41 +00:00
Vikram S. Adve
524185af3f Just a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1908 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:40:25 +00:00
Vikram S. Adve
a45a327e8d New pass to decompose multi-dimensional array references into
a sequence of 1-D references, using a sequence of getElementPtrs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1907 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:39:09 +00:00
Vikram S. Adve
23a4c8fcb5 Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1906 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:37:19 +00:00
Vikram S. Adve
89e2da034a Added function computeOffsetforLocalVar to check how big the
offset-from-FP will be before allocating space for a local variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1905 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:36:30 +00:00
Vikram S. Adve
c356e565a6 Bug fix in setting CC register.
Also use distinct names for the three types of SetMachineOperand
to avoid painful overloading problems and errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1904 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:35:24 +00:00
Vikram S. Adve
42f632041d Constants are now added to the constant pool only when a load
instruction is actually generated for them.
Rename the different versions of SetMachineOperand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1903 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:33:43 +00:00
Vikram S. Adve
1ed009f66e Use vector for machine instructions returned by GetInstructionsByRule.
Fix constants in instructions generated for Phi elimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1902 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:31:54 +00:00
Vikram S. Adve
705f95e0b7 Big bug fix: getUsableUniRegAtMI needed to return values in arguments
but did not pass the arguments by reference!
Also added a function to get a register class by ID.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1901 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:26:48 +00:00
Vikram S. Adve
7482532129 Add support for code generation for array references.
Also, use distinct names for the three types of SetMachineOperand to
avoid painful overloading problems and errors.
Bug fix in converting-int-to-float.  Other minor stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1896 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:15:35 +00:00
Vikram S. Adve
f1c15ee4d1 Bug fixes for not using unified reg. numbers, and for using the
wrong register class for saving CC registers.
Also, use distinct names for the three types of SetMachineOperand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1895 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:12:16 +00:00
Vikram S. Adve
e76af29edc Use distinct names for the three types of SetMachineOperand to
avoid painful overloading problems and errors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1893 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:09:15 +00:00
Vikram S. Adve
e6d2c41d4c Minor fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1892 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:08:07 +00:00
Vikram S. Adve
d198c47a0e Handling of global names was severely broken when converting to 2 passes.
Different labels were generated for the same name in different passes.
Use an annotation to hold a fixed table of names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1891 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:07:26 +00:00
Vikram S. Adve
dd55899f9a Several sundry bug fixes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1890 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-18 03:02:42 +00:00
Chris Lattner
2bfc0310ff Make an assertion provide a more helpful error message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1883 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-17 21:16:01 +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
Chris Lattner
acd3caec0d Checkin new test for problem anand ran into
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1880 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-15 20:25:09 +00:00
Chris Lattner
9b638019ca Cleanup error message output a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1879 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-15 20:21:29 +00:00
Chris Lattner
9b534266f0 Fix test/Regression/Other/2002-03-14-ValueToLarge.ll. Note that this
fix could be better, but we don't have the infrastructure to find out what
size types are yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1876 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-14 22:35:50 +00:00
Chris Lattner
fdec2468ce Add a check to ensure that only PHI nodes are self referential. Code
input to instruction combination was broken, which caused it to explode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1870 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-14 16:53:48 +00:00
Chris Lattner
754cf415f6 Fix bug: test/Regression/Other/2002-03-14-LevelRaiseHang.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1869 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-14 16:37:04 +00:00
Chris Lattner
a007bc2c14 Fix bug: test/Regression/Other/2002-03-11-InstCombineHang.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1864 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 23:28:45 +00:00
Chris Lattner
c4db754ecf update comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1862 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 22:21:04 +00:00
Chris Lattner
b24196f5ae * Fix bug: test/Regression/Other/2002-03-11-LevelRaiseIterInvalidate.ll
* Use more concise form of ReplaceInstWithInst to make code simpler
* Output nicer message for dead code eliminated when debugging


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1861 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 22:19:48 +00:00
Chris Lattner
749ce032ba Implement TODO for better diagnostic output
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1859 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 22:12:39 +00:00
Chris Lattner
0fce76a009 Fix bug: test/Regression/Other/2002-03-11-ConstPropCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1858 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 22:11:07 +00:00
Chris Lattner
cb05e78cb7 Bugfix for test/Regression/Other/2002-03-11-ExprAssertion.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1856 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 20:50:24 +00:00
Chris Lattner
2dc78088b7 Remove runtime library in favor of users linking against real libraries.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1853 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 17:57:13 +00:00
Chris Lattner
7b83b1db25 Do not link in runtime library anymore, assume that user manually links in
libraries.  Code should be generalized to allow lli to take -lc -lm arguments
in the future (todo)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1852 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 17:52:43 +00:00
Chris Lattner
e1a52f6a15 Fix bug: test/Regression/Other/2002-03-11-LevelRaiseCalls.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1844 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-11 17:27:34 +00:00
Chris Lattner
665ee88504 Implement a bunch of new functions to support the SPECINT mcf
benchmark


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1841 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 22:51:07 +00:00
Chris Lattner
e82f1c6cb7 * Add new method localLookup
* SymbolTable::remove(Value *N) checks to see if we are internally
  inconsistent before looking for a type plane (caused a crash)
* insertEntry now does a local lookup instead of a global lookup, which was
  causing an infinite loop in the renamer logic.
* Added assertions to make sure stuff stays happy
* Now the linker correctly links the SPECINT2000 mcf benchmark


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1840 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 20:26:17 +00:00
Chris Lattner
34538145f4 Fix bug: test/Regression/2002-03-08-NameCollision2.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1839 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 19:11:42 +00:00
Chris Lattner
9176fe4171 Fix minor memory leak
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1837 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 18:57:56 +00:00
Chris Lattner
f28d6c9313 Fix for: test/Regression/Assembler/2002-03-08-NameCollision.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1836 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-08 18:41:32 +00:00
Chris Lattner
4736d06bf4 We were not correctly burrowing down multiple levels to get to a leaf. Fix this now
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1833 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-07 21:18:00 +00:00
Chris Lattner
921ef3a185 Support changing the pointer type of a store for the case where we are
storing into the first element of the structure type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1832 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-07 21:17:35 +00:00
Chris Lattner
9c85fa660e Initial checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1831 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-07 20:16:38 +00:00
Chris Lattner
d4d427baa9 Clean up call graph, add comments, and fix test/Regression/Other/2002-01-31-CallGraph.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1828 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-06 20:19:35 +00:00
Chris Lattner
71e7bb4bc0 Pull interprocedural analyses out of Analysis library into their own lib
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1827 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-06 18:44:29 +00:00
Chris Lattner
8d5a16ca0b Move call graph printing support out of Writer.h into Callgraph.h
remove dead global function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1825 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-06 18:00:49 +00:00
Chris Lattner
4ce0f8aa9e Take CallGraph out of the CFG namespace. It has nothing to do with CFGs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1820 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-06 17:16:43 +00:00
Vikram S. Adve
9ee9d71199 Fix include error.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1819 91177308-0d34-0410-b5e6-96231b3b80d8
2002-03-03 20:46:32 +00:00
Chris Lattner
bd0ef77cde Change over to use new style pass mechanism, now passes only expose small
creation functions in their public header file, unless they can help it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1816 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 21:46:54 +00:00
Chris Lattner
3b2541424f Expose more entry points to the verifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1815 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 21:45:33 +00:00
Chris Lattner
eded4916d6 Move ProfilePaths class into ProfilePaths library, only expose a creation function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1812 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 20:04:59 +00:00
Chris Lattner
905ac5ee67 Pass stuff by reference instead of by copy. Copying entire graphs seems like
a bad idea


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1810 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 19:49:45 +00:00
Chris Lattner
5fb52fbf9e Move processGraph down lower in the file so all of the forward declarations
can be eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1809 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 19:43:49 +00:00
Chris Lattner
fd1717d03b * Changes to compile successfully with GCC 3.0
* Eliminated memory leak in processGraph
* Pass vectors by const reference to moveDummyCode instead of by copy


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1808 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 19:40:28 +00:00
Anand Shukla
2d9bbfdfc4 Makefile for profile-paths
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1807 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 19:36:43 +00:00
Anand Shukla
c3e69696ac Initial checkin: functions on Graph used for path profile pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1806 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 19:02:16 +00:00
Anand Shukla
070834a040 Initial checkin: instrument code to get path execution frequency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1805 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 19:00:48 +00:00
Anand Shukla
0b8066c149 Initial checkin: helper file to insert instrumentation code along edges
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1804 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 18:59:46 +00:00
Anand Shukla
d940c7d112 Initial check in of graph.cpp: implements graph interface used in path profiles
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1803 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 18:58:39 +00:00
Anand Shukla
155d2c9384 Change to make it build with GCC 2.95.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1802 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 18:57:15 +00:00
Anand Shukla
fb1d93c716 New makefile to include ProfilePaths dir
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1799 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-26 18:20:27 +00:00
Chris Lattner
e8e320d2fa Fix bug: test/Regression/Other/2002-02-24-InlineBrokePHINodes.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1798 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-25 00:35:07 +00:00
Chris Lattner
41b66b12e8 When inlining basic blocks and instructions, give them a name!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1796 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-25 00:31:02 +00:00
Chris Lattner
ec4913ea7c Remove hack. This is better fixed in Makefile.common
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1795 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-24 23:25:46 +00:00
Chris Lattner
1156edf01c Build with newer compiler, with same bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1793 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-24 23:11:05 +00:00
Chris Lattner
4fb71ba29d Namespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1791 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-24 23:03:09 +00:00