Commit Graph

75 Commits

Author SHA1 Message Date
Chris Lattner
a5f47ea23d Start using retnodes_* for iteration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20618 91177308-0d34-0410-b5e6-96231b3b80d8
2005-03-15 16:55:04 +00:00
Chris Lattner
d7be188323 Fix the Regression/Transforms/DSAnalysis/recursion.ll regression.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20031 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-04 18:58:04 +00:00
Chris Lattner
cff8ac20ca Fix some scary bugs that VC++ detected.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19941 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-31 00:10:45 +00:00
Chris Lattner
a9548d9fd9 * Make some methods more const correct.
* Change the FunctionCalls and AuxFunctionCalls vectors into std::lists.
  This makes many operations on these lists much more natural, and avoids
  *exteremely* expensive copying of DSCallSites (e.g. moving nodes around
  between lists, erasing a node from not the end of the vector, etc).

With a profile build of analyze, this speeds up BU DS from 25.14s to
12.59s on 176.gcc.  I expect that it would help TD even more, but I don't
have data for it.

This effectively eliminates removeIdenticalCalls and children from the
profile, going from 6.53 to 0.27s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19939 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-30 23:51:02 +00:00
Chris Lattner
851b534b89 Make -ds-aa more useful, allowing it to be updated as xforms hack on the program.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19818 91177308-0d34-0410-b5e6-96231b3b80d8
2005-01-24 20:00:14 +00:00
Chris Lattner
b12914bfc0 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass.  Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16436 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-20 04:48:05 +00:00
Reid Spencer
551ccae044 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
2004-09-01 22:55:40 +00:00
Chris Lattner
4dabb2c6f3 Move all of the DSA headers into the Analysis/DataStructure subdir.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14663 91177308-0d34-0410-b5e6-96231b3b80d8
2004-07-07 06:32:21 +00:00
Misha Brukman
96a8bd7f54 Wrapped code and comments at 80 cols; doxygenified some comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13264 91177308-0d34-0410-b5e6-96231b3b80d8
2004-04-29 04:05:30 +00:00
Chris Lattner
c3f5f7701f Instead of callign removeTriviallyDeadNodes on the global graph every time
removeDeadNodes is called, only call it at the end of the pass being run.
This saves 1.3 seconds running DSA on 177.mesa (5.3->4.0s), which is
pretty big.  This is only possible because of the automatic garbage
collection done on forwarding nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11178 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-08 01:51:48 +00:00
Chris Lattner
cd90f21c0c Remove another unneeded call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11177 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-08 01:40:40 +00:00
Chris Lattner
6d8f3dcd75 In the TD pass, iterate over globals directly instead of through the whole scalar
map.  This saves 5s in the TD pass, from 22->17s on perlbmk


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10998 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:12:48 +00:00
Chris Lattner
34741cf0dd In the TD pass, don't iterate over the scalar map to find the globals, iterate over
the globals directly.  This doesn't save any substantial time, however, because the
globals graph only contains globals!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10997 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:07:30 +00:00
Chris Lattner
f325e3981e Rewrite to use the reachability cloner interface. Also, make this much more
efficient in the case where a function calls into the same graph multiple times
(ie, it either contains multiple calls to the same function, or multiple calls
to functions in the same SCC graph)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10986 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 21:53:14 +00:00
Chris Lattner
2f561384fb Eliminated the CompletedNodes argument to the cloneReachable* methods. This
map was only used to implement a marginal GlobalsGraph optimization, and it
actually slows the analysis down (due to the overhead of keeping it), so just
eliminate it entirely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10955 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 16:56:13 +00:00
Chris Lattner
9a92729581 Fine-grainify namespaces for this library
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9948 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-12 23:11:14 +00:00
Brian Gaeke
d0fde30ce8 Put all LLVM code into the llvm namespace, as per bug 109.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 22:41:34 +00:00
Chris Lattner
492dda9fd5 This doesn't use DSCallSiteIterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9809 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-08 21:17:37 +00:00
John Criswell
b576c94c15 Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 19:43:21 +00:00
Chris Lattner
11fc9301fb Functions reachable from the arguments of unresolvable call nodes should
not have their arguments marked complete


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8639 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 23:58:33 +00:00
Chris Lattner
3b0a9be238 Do not mark incoming arguments to functions complete if the function is pointed to by a global in the globals graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8637 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 22:24:04 +00:00
Chris Lattner
808a7aeec7 Switch from using CallInst's to represent call sites to using the LLVM
CallSite class.  Now we can represent function calls by invoke instructions
too!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8629 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 16:34:13 +00:00
Chris Lattner
6806f5614d DEBUG got moved to Support/Debug.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7492 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-01 22:15:03 +00:00
Vikram S. Adve
03e19ddaf7 (1) Rematerialize nodes from the globals graph into the current graph
after all callers are inlined into the current graph.
(2) Optimize the way a graph is inlined into its callees in the TD phase:
    (a) Use DSGraph::cloneReachableSubgraph to clone only a subgraph at
        each call site, for faster inlining.
    (b) Clone separately for the same callee at different call sites,
        since only the reachable subgraph is being cloned, not the entire
        caller graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7188 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 21:40:28 +00:00
Chris Lattner
61691c5d85 Remove space at end of line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7084 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:44:15 +00:00
Chris Lattner
6c87461fe6 Fix how we are handling unreachable functions. This DRAMATICALLY improves efficiency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7082 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:42:48 +00:00
Chris Lattner
47030f8a72 Try using trivially dead deletion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7075 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 19:49:11 +00:00
Chris Lattner
a8da51bf51 Complete rewrite of td pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7064 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:44 +00:00
Chris Lattner
18f07a11b9 Rework TD pass to work with the precise call graph constructed by the BU phase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7031 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:28:11 +00:00
Chris Lattner
acbc8c6768 Remove dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6999 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:39 +00:00
Chris Lattner
3d162907e3 Do not multiply delete graphs if functions are sharing graphs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6997 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:08 +00:00
Chris Lattner
5a54063303 Revamp DSGraphs so that they can support multiple functions in the same
DSGraph at one time


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6994 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:15:25 +00:00
Chris Lattner
dea8146787 Abstract out the predicate which decides whether a function gets complete
arguments or not...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6987 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 22:37:07 +00:00
Chris Lattner
312edd330f Propagate globals graph from the local to bu to td globals graphs. This
fixes bug: DSGraph/buglobals.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6947 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 22:14:55 +00:00
Chris Lattner
e0f4b98026 Remove support for the MultiObject flag, which was fundamentally broken
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6840 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:03:52 +00:00
Chris Lattner
72d29a4b00 Implement a "union-findy" version of DS-Analysis, which eliminates the
Referrers list on DSNodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5536 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-11 23:11:51 +00:00
Chris Lattner
4f2cfc0d74 Rearrange code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5527 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-10 18:16:36 +00:00
Chris Lattner
e0fbd48e19 Fix major bugs in incompleteness marking that were pessimizing results
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5515 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-09 18:42:43 +00:00
Chris Lattner
1ef0da2e25 Fix a bug where we would mark the callees arguments incomplete if the caller was external.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5510 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-08 23:07:39 +00:00
Chris Lattner
923fc05b3a Implement optimization for direct function call case. This dramatically
reduces the number of function nodes created and speeds up analysis by
about 10% overall.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5495 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-05 21:59:58 +00:00
Chris Lattner
24d80079a8 Make the TD pass not include all of the call nodes from the local pass,
eliminating incomplete markers from them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5490 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-04 00:59:32 +00:00
Chris Lattner
4923d1be91 Hack to work around deficiency in pass infrastructure
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5485 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-03 22:51:28 +00:00
Chris Lattner
41c04f730b Change DSGraph stuff to use hash_(set|map) instead of std::(set|map)
This change provides a small (3%) but consistent speedup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5460 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-01 04:52:08 +00:00
Chris Lattner
394471f197 * Eliminate boolean arguments in favor of using enums
* T-D pass now eliminates unreachable globals


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5419 91177308-0d34-0410-b5e6-96231b3b80d8
2003-01-23 22:05:33 +00:00
Vikram S. Adve
61ff02982f Fix logical error in TD pass: we should clear Mod/Ref bits of each caller
before inlining their graphs into a function.  To support this,
added flags to CloneFlags to strip/keep Mod/Ref bits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4836 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-27 17:41:13 +00:00
Chris Lattner
0ecc42619f Handle a mismatch between # function args and call site args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4696 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 21:36:05 +00:00
Chris Lattner
f40f0a39bd eliminate the ability to remove global nodes from deadNodeElminate... for now.
This slows stuff down a bit, but it should get much better before it gets any
worse.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4666 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 22:07:02 +00:00
Chris Lattner
aa0b468f6d Add globals graphs to all three passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4663 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:12:07 +00:00
Chris Lattner
65f2897f2c Clean up DSGraph::removeDeadNodes interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4660 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:00:49 +00:00
Chris Lattner
96517253a1 Make removeTriviallyDeadNodes a private interface of DSGraph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4659 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 20:55:24 +00:00