Commit Graph

400 Commits

Author SHA1 Message Date
Chris Lattner
62482e5649 Rename DSGraph::ScalarMapTy -> DSScalarMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11001 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 09:15:42 +00:00
Chris Lattner
28da03b0fe Fix a bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11000 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:31:34 +00:00
Chris Lattner
a3fd88d01f Eliminate the call to removeTriviallyDeadNodes from updateFromGlobals graph,
moving it to the start of removeDeadNodes.  This speeds up DSA by 2s on perlbmk
from 41s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10999 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:24:41 +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
bdce7b7844 In updateFromGlobalsGraph, instead of iterating over all of the scalars in the
function to find the globals, iterate over all of the globals directly.  This
speeds the function up from 14s to 6.3s on perlbmk, reducing DSA time from
53->46s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10996 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 03:03:06 +00:00
Chris Lattner
a88a55cf10 Minor tweaks, eliminate useless integer pruning optimziation, turn on
timers by default


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10993 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 02:41:32 +00:00
Chris Lattner
239644dc3b Further reduce the number of nodes cloned with getClonedNH, using merge instead.
This reduces the number of nodes allocated, then immediately merged and DNE'd
from 2193852 to 1298049.  unfortunately this only speeds DSA up by ~1.5s (of
53s), because it's spending most of its time waddling through the scalar map :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10992 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 02:11:49 +00:00
Chris Lattner
00948c05b2 Add a timer, fix a minor bug.
Also, use RC::merge when possible, reducing the number of nodes allocated, then immediately merged away from 2985444 to 2193852 on perlbmk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10991 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 02:05:05 +00:00
Chris Lattner
64507e39da Another bugfix, disable "spurious" output.
You gotta love spurious


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10990 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-28 01:19:52 +00:00
Chris Lattner
352e31f572 fix bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10989 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 22:54:56 +00:00
Chris Lattner
0b14487591 * Add a new commandline argument to control the "global roots hack". Default
it to be off.  If it looks like it's completely unnecessary after testing, I
  will remove it completely (which is the hope).
* Callers of the DSNode "copy ctor" can not choose to not copy links.
* Make node collapsing not create a garbage node in some cases, avoiding a
  memory allocation, and a subsequent DNE.
* When merging types, allow two functions of different types to be merged
  without collapsing.
* Use DSNodeHandle::isNull more often instead of DSNodeHandle::getNode() == 0,
  as it is much more efficient.
*** Implement the new, more efficient reachability cloner class
    In addition to only cloning nodes that are reachable from interesting
    roots, this also fixes the huge inefficiency we had where we cloned lots
    of nodes, only to merge them away immediately after they were cloned.
    Now we only actually allocate a node if there isn't one to merge it into.
* Eliminate the now-obsolete cloneReachable* and clonePartiallyInto methods
* Rewrite updateFromGlobalsGraph to use the reachability cloner
* Rewrite mergeInGraph to use the reachability cloner
* Disable the scalar map scanning code in removeTriviallyDeadNodes.  In large
  SCC's, this is extremely expensive.  We need a better data structure for the
  scalar map, because we really want to scan the unique node handles, not ALL
  of the scalars.
* Remove the incorrect SANER_CODE_FOR_CHECKING_IF_ALL_REFERRERS_ARE_FROM_SCALARMAP code.
* Move the code for eliminating integer nodes from the trivially dead
  eliminator to the dead node eliminator.
* removeDeadNodes no longer uses removeTriviallyDeadNodes, as it contains a
  superset of the node removal power.
* Only futz around with the globals graph in removeDeadNodes if it is modified


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10987 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 22:03:40 +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
02da032b03 minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10985 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 21:51:19 +00:00
Chris Lattner
825a02ae36 Get clone flags right, so we don't build InlinedGlobals only to clear them
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10984 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-27 21:50:41 +00:00
Chris Lattner
091f776081 Initial support for implementing clonePartiallyInto in terms of cloneReachableSubgraph, though this support is currently disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10970 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-23 01:44:53 +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
93ddd7ea10 Ok, I'm tired of pulling out all my timers to check stuff in, just do it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10954 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 16:36:28 +00:00
Chris Lattner
5254a8dda8 Bug fix: X.mergeWith(Y) was not updating Y if Y was a null node handle!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10953 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 16:31:08 +00:00
Chris Lattner
4c6cb7a2b1 Start implementing DSGraph::clonePartiallyInto and implement mergeInGraph
in terms of it.

Though clonePartiallyInto is not cloning partial graphs yet, this change
dramatically speeds up inlining of graphs with many scalars.  For example,
this change speeds up the BU pass on 253.perlbmk from 69s to 36s, because
it avoids iteration over the scalar map, which can get pretty large.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10951 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 15:30:58 +00:00
Chris Lattner
4a85776993 Allow disabling of ALL printing overhead when performing timings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10948 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-22 13:42:43 +00:00
Chris Lattner
fa3711a0f8 Do not depend on index type to determine whether it is a structure or sequential index
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10221 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-25 20:19:55 +00:00
Chris Lattner
1e2385b941 Finegrainify namespacification
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10138 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-21 21:54:22 +00:00
Chris Lattner
179bc7dcb1 Implement a small optimization to handling of GEP's that are equivalent to casts.
This results in substantially reduced collapsing for some testcases


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10002 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-14 17:09:46 +00:00
Chris Lattner
a366c98077 Trying to get the dsgraph for an external function is bad for DSA's health
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9979 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-13 18:48:11 +00:00
Chris Lattner
79390d48d0 Implement the CompleteBU pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9964 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-13 05:05:41 +00:00
Chris Lattner
6acfe92b32 Minor code cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9962 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-13 05:04:19 +00:00
Chris Lattner
a190766a54 Disable integer tracking by default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9960 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-13 03:10:49 +00:00
Chris Lattner
95724a4aec Add an initial version of the CompleteBUDataStructures class, which is currently
identical to the BU pass, but has an accurate call graph


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9956 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-13 01:43:00 +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
Chris Lattner
afc1dbafb4 Add new argument to disable checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9922 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-12 17:58:22 +00:00
Chris Lattner
d8ea8a5027 Print return nodes for graphs with multiple functions in them correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9914 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-12 04:58:19 +00:00
Chris Lattner
9dc4185763 Don't crash if no gg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9913 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-12 04:57:58 +00:00
Chris Lattner
c5f0afad2c Cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9907 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-12 00:40:34 +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
413406c068 Compute node offsets correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9895 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 20:12:32 +00:00
Chris Lattner
400433dfea Add new method for computing node mappings. This is used by the pool allocator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9880 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-11 05:08:59 +00:00
Chris Lattner
67ce57ac49 Add support for memmove
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9824 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-09 03:32:52 +00:00
Chris Lattner
fb8c61056f Handle bzero and memset in the local analysis, because we were missing the fact
that memset returns its argument!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9811 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-08 21:55:50 +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
Chris Lattner
0271345368 Fix name collision
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9722 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-05 05:55:45 +00:00
Chris Lattner
15869aa2c7 All DSGraphs keep a reference to the targetdata they are created with. This is
used to eliminate the hard coded, hacked in, sparc specific, global TargetData.
Changing the TargetData used to actually match the code fixes problems, and
eliminates a crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9659 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-02 22:27:28 +00:00
Chris Lattner
dbfe36e51e Fix bug: test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9658 91177308-0d34-0410-b5e6-96231b3b80d8
2003-11-02 21:02:20 +00:00
John Criswell
856ba76200 Added LLVM copyright header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-21 15:17:13 +00:00
John Criswell
e488e9360b Added LLVM copyright notice to Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-20 22:26:57 +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
Misha Brukman
cf00c4ab3b Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-10 17:57:28 +00:00
Alkis Evlogimenos
b5c1af4773 Use std::string::size_type for for ColonPos to stop gcc from giving a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8811 91177308-0d34-0410-b5e6-96231b3b80d8
2003-10-01 22:49:22 +00:00
Chris Lattner
fbc2d84ce9 DOn't crash if program calls the null pointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8708 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-24 23:42:58 +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