Commit Graph

145 Commits

Author SHA1 Message Date
Chris Lattner
0009dac2bf Call nodes are never equivalent
Shadow nodes are never critical.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2102 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:21:51 +00:00
Chris Lattner
1f1170c94a Add hack to get timing of analysis
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2101 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:21:27 +00:00
Chris Lattner
cc0c1b2e18 * Eliminate commented out code
* Do not demand a shadow node when resolving
* Raise arbitrary inline limit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2100 91177308-0d34-0410-b5e6-96231b3b80d8
2002-04-04 19:21:06 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
Chris Lattner
1ddf664f74 Make it compile with GCC 3.0.4
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1786 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-24 23:01:21 +00:00
Chris Lattner
455889aa79 * Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
  InstrTypes.h anymore


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1750 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-12 22:39:50 +00:00
Chris Lattner
221d688a5e Method.h no longer includes BasicBlock.h
Method::inst_* is now in llvm/Support/InstIterator.h
GraphTraits specializations for BasicBlock and Methods are now in llvm/Support/CFG.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1746 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-12 21:07:25 +00:00
Chris Lattner
6357a3f42d Convert BBLiveVar to be a BasicBlock annotation, this removes the BB2BBLVMap from MethodLiveVarInfo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1721 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 06:52:25 +00:00
Chris Lattner
2f898d2074 Convert operand iterator over to work like an STL iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1720 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 06:02:59 +00:00
Chris Lattner
748697d242 Minor change: Methods that return ValueSet's that are guaranteed to be valid
return references instead of pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1719 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 04:20:12 +00:00
Chris Lattner
7471a7b019 Must include SetOperations to do set_*
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1716 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 03:35:53 +00:00
Chris Lattner
eb5230c4f9 Remove generic routines to Support/SetOperations.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1715 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 03:35:31 +00:00
Chris Lattner
c980c50dc1 Remove empty files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1713 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 02:52:53 +00:00
Chris Lattner
5e5dfa307a * Eliminate the LiveVarSet class, making applyTranferFuncForMInst a static
function in the one .cpp file that uses it.  Use ValueSet's instead.
* Prepare to delete LiveVarSet.h & LiveVarSet.cpp
* Eliminate the ValueSet class, making all old member functions into global
  templates that will eventually be moved to Support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1711 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 02:51:01 +00:00
Chris Lattner
0665a5f1f5 * Code Cleanups
* Introduce RAV to allow stream I/O instead of using printValue


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1710 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 01:43:49 +00:00
Chris Lattner
f39f379f9e Changes neccesary due to the move of BBLiveVar.h to the lib/Analysis/LiveVar directory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1709 91177308-0d34-0410-b5e6-96231b3b80d8
2002-02-05 00:43:37 +00:00