Commit Graph

509 Commits

Author SHA1 Message Date
Chris Lattner
28897e1784 Switch the Nodes list from being an std::vector<DSNode*> to an ilist<DSNode>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11173 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-08 00:53:26 +00:00
Chris Lattner
9fd37ba721 Change to use node_iterators instead of direct access to Nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11171 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-08 00:23:16 +00:00
Chris Lattner
e92e76446e getNodes() is gone, use node_begin/end instead
Rename stats from dsnode -> dsa
Add a new stat


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11167 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-07 23:58:05 +00:00
Chris Lattner
a84c681637 getNodes() is gone
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11166 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-07 23:57:26 +00:00
Chris Lattner
a5ca28cafe There is no need to clone over nodes that are going to be dead anyway
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11157 91177308-0d34-0410-b5e6-96231b3b80d8
2004-02-07 22:00:03 +00:00
Chris Lattner
a67138ddff Avoid referencing deleted DSgraphs when merging an SCC into a larger SCC. This
fixes the crash in 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11033 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-31 21:02:18 +00:00
Chris Lattner
92e41d5982 Forward method request to chained aa implementation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11024 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-30 22:20:55 +00:00
Chris Lattner
ead9eb75d7 Fix a bug aflicting 265.gap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11006 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-29 08:36:22 +00:00
Chris Lattner
17a93e2e1b Minor bugfixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11005 91177308-0d34-0410-b5e6-96231b3b80d8
2004-01-29 03:32:15 +00:00
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
Chris Lattner
ec157b7cde The Globals graph must become complete at the end of the BU phase!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8638 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 23:27:05 +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
26c4fc3b69 Make sure to add global variable initializers to the Globals graph!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8636 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 21:48:16 +00:00
Chris Lattner
9970bf6288 Don't consider incomplete nodes to be typesafe!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8635 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 21:48:01 +00:00
Chris Lattner
bab8c28924 Remove trivially dead nodes was not removing nodes that were dead due to forwarding!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8634 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 21:34:07 +00:00
Chris Lattner
894263bc9f Add special case handling for calloc and realloc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8630 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 16:50:46 +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
192cd9cccd Make this work better for constants that aren't necessarily in ANY graph, such as null pointers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8628 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 16:12:57 +00:00
Chris Lattner
7892549796 Keep track of the number of typed/untyped memory accesses theyre are in the program
VS: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8611 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-20 01:20:46 +00:00
Misha Brukman
2f2d06506c Fixed spelling and grammar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8478 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-11 18:14:24 +00:00
Chris Lattner
758fefc0f0 Final cleanup: remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8291 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 18:01:36 +00:00
Chris Lattner
273328e8e0 Not only is this a lot smaller, it actually works if there is already a
function with the right name in the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8290 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:53:46 +00:00
Chris Lattner
09a670587a If "These should be used only by the auto-parallelization pass", we might as
well put them INTO the auto-par pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:49:38 +00:00
Chris Lattner
60a3518cf9 Moved all of the cilkifier stuff into lib/Transforms/IPO, as it really is not
support stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8287 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:45:30 +00:00
Chris Lattner
aa9214524d Minor cleanups
Do not #include Parallelize.h, it's just a subset of Cilkifier.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8285 91177308-0d34-0410-b5e6-96231b3b80d8
2003-09-01 16:42:16 +00:00
Chris Lattner
55b2eb3ef8 Rename TarjanSCCIterator -> scc_iterator
* Increases consistency with other iterators (e.g. df_iterator, po_iterator...)
  * It's shorter
  * We don't name classes by the implementation, we name it for the interface!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8273 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 20:01:57 +00:00
Chris Lattner
56ef49f5c6 Remove dead var
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8270 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 19:54:57 +00:00
Chris Lattner
9f2a06e76d The SCC::HasLoop method is now in the main iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8269 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 19:51:38 +00:00
Chris Lattner
fe8d8806f7 Remove explicit passing of SCC's around as objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8267 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 19:46:48 +00:00
Chris Lattner
95008bca9e Move the getAnalysisUsage method from the header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8264 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 19:40:57 +00:00
Chris Lattner
6c5fd8e055 The tarjan iterator now returns a reference to the current SCC, not a possibly null pointer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8262 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 19:35:16 +00:00
Chris Lattner
0c0023b754 Minor cleanups
Iterate from tarj_begin -> tarj_end, not from tarj_begin -> NULL


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8260 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-31 19:29:52 +00:00
Chris Lattner
8043127860 Remove unnecessary use of NonCopyable
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7641 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-06 17:16:24 +00:00
Chris Lattner
7ddb0139ad Add more verbose comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7610 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 18:38:37 +00:00
Sumant Kowshik
108421a8e5 Added function mergeInGlobalsGraph which merges in the entire globals graph with the graph of a function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7606 91177308-0d34-0410-b5e6-96231b3b80d8
2003-08-05 17:04:41 +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
Chris Lattner
1f2bbaa9cb Fix another minor bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7340 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-26 23:00:05 +00:00
Chris Lattner
e7e221ad24 Dont' try to parse the colon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7323 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:49:29 +00:00
Chris Lattner
f2d0134118 Add a more general check-flags which can be used to ensure arbitrary flags are set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7322 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:45:40 +00:00
Vikram S. Adve
40c600e8f3 Fix comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7227 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-22 12:08:58 +00:00
Brian Gaeke
1d2ba44224 Fix typo in call to isUnresolvableFunc, which was breaking the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7194 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-17 19:07:46 +00:00
Vikram S. Adve
1da1d32fc7 Rematerialize nodes from the globals graph into the current graph
after all callees are inlined into the current graph.

NOTE: There's also a major bug fix for the BU pass in DataStructure.cpp,
which ensures that resolvable indirect calls are not moved out to the
globals graph, so that they are eventually inlined (if possible).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7189 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 21:42: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
Vikram S. Adve
78bbec7fcb Implement 2 important changes: (1) rematerialization from the globals graph,
and (2) faster inlining by cloning only reachable nodes.  In particular:
(1) Added DSGraph::cloneReachableSubgraph and DSGraph::cloneReachableNodes
    to clone the subgraph reachable from a set of root nodes, into the
    current graph, merging the global nodes into thos in the current graph.
    The TD pass now uses this for faster inlining, and so does the
    next function.
(2) Added DSGraph::updateFromGlobalGraph() to rematerialize nodes from the
    globals graph into the current graph in both BU and TD passes.
(3) `I' flags are removed from all nodes in the globals graph, because they
    are difficult to maintain correctly and are not needed anyway.
(4) Aux. function calls are only removed to the globals graph if they
    will never be resovled.  (This is what fixed gap.)  The immediate
    reason is that if we took these out of a function (and moved them to
    the globals graph) we would need to rematerialize these nodes into the
    function graph for every function in the BU pass.  The longer term
    problem is that we would need to find a way to remove them from the
    globals graph iff they have been resolved on all paths through the
    call graph.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7187 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 21:36:31 +00:00
Vikram S. Adve
2e1de5ed59 Factor out the test for unresolvable external functions into
isUnresolvableFunc() (I thought I needed this externally.
I don't, but it's still nicer this way.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7186 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-16 21:25:17 +00:00
Chris Lattner
85cfe01a5e Remove globals more aggressively from graphs.
Fix a bug where we removed nodes that were marked U.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7090 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-03 02:03:53 +00:00
Chris Lattner
7079386e02 INCLUDE_PARENT_GRAPH is required!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7088 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:57:05 +00:00
Chris Lattner
10c45d6cd5 Disable incorrect mustalias code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7087 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:56:51 +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
d391d70361 Keep track of how many inlinings are performed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7076 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 20:24:42 +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
44cfdf9b9a Remove dead Nodes list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7065 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 06:06:34 +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
63899fab93 Print collapsed to match the paper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7063 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:27 +00:00
Chris Lattner
9cd0484251 Reduce amount of work we do calculating mustaliases if the arg is a global
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7062 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:13 +00:00
Chris Lattner
58f98d0bf0 Add support for ParentGraph only when building in debug mode
Minor cleanups, reenable folding of call nodes to external functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7061 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:38:49 +00:00
Chris Lattner
f07804b923 Add some functions to the blacklist
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7060 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:38:00 +00:00
Chris Lattner
744f93996e Make the BU closure keep track of which actual calls happen
Minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7059 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:37:48 +00:00
Chris Lattner
3051419036 Make local pass print out its progress
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7058 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:37:26 +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
b6734b281b Do not treat global variables as functions! (and assert failing)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:27:53 +00:00
Chris Lattner
d9dad2cf61 Dont' print scalar nodes for ConstantPointerRefs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:27:32 +00:00
Chris Lattner
5d5b6d6a5c Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:04:18 +00:00
Chris Lattner
6681e98b13 Use the getFunctionNames method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7008 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:57:39 +00:00
Chris Lattner
a9d6566e36 Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7007 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:57:30 +00:00
Chris Lattner
2b4c8dfdd5 Split CallSiteIterator out into DSCallSiteIterator.h, and generalize it a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7006 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:27:53 +00:00
Chris Lattner
9f93055253 Be more const-correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7005 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:27:18 +00:00
Chris Lattner
7b1ceaa40b Fix bug in last checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7003 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:18:26 +00:00
Chris Lattner
0eea61863b Reimplement the BU closure to collapse all SCC graphs into a single graph.
Look at all of the code that gets deleted!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7001 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:09:58 +00:00
Chris Lattner
2cb9acd785 Handle the case where OldNodeMap == &ScalarMap correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7000 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:09:29 +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
81d924d804 Do not delete the same graph multiple times when freeing memory if graphs are sharing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6998 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:27 +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
8d32767da4 Move usages of explicit hash_* datastructures to use typedefs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6996 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:36:09 +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
a321b04d60 Adjust for new DSGraph API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6993 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:14:54 +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
06e24c8447 Fix minor bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6986 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 22:36:31 +00:00
Chris Lattner
919ffbf977 Add support for ensuring that nodes are not incomplete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6985 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 22:36:15 +00:00
Chris Lattner
5c5b10f46a Add support for "physical subtyping", which fixes:
DSGraph/2003-06-29-NodeCollapsing2.ll & DSGraph/PhysicalSubtyping.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6982 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 20:27:45 +00:00
Chris Lattner
889fb9de96 Add print method to not get silly warning from analyze
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6981 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 20:27:16 +00:00
Chris Lattner
5100dbb9e7 New pass which is useful for writing regression tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6979 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 18:17:07 +00:00
Chris Lattner
5c70dc0456 Expose must alias information for global variables, implementing: DSGraph/mustalias.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6973 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 00:54:08 +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
5e459dbc52 Drop references to globals who do exist in the globals graph, but are never
read or written to.  Keep track of how many times this happens.  This should
be good for deleting things like references to type information in C++ classes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6946 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 22:10:58 +00:00
Chris Lattner
72d50a090f Avoid double negatives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6945 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 21:58:28 +00:00
Chris Lattner
934fe856b5 New pass to perform DSA based optimizations. Initially we just support turning
globals into constants if we can prove it's safe


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6941 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 21:54: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
bd92b73be7 * Changes to make NodeType be private to DSNode.
* Add new MultiObject flag to DSNode which keeps track of whether or not
  multiple objects have been merged into the node, allowing must-alias info
  to be tracked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6794 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 21:15:11 +00:00
Chris Lattner
e158b19a3c Nodes get forwarded when they are collapsed currently.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6696 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 12:08:18 +00:00
Chris Lattner
a75c8c4da8 Remove bogus assertion: a node with no referrers could be collapsed if field-sensitivity was disabled
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6695 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-16 12:07:39 +00:00
Chris Lattner
ab2b328c78 Eliminate unnecessary ->get calls that are now automatically handled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6397 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-29 15:12:27 +00:00
Misha Brukman
f117cc9ee6 s/convertable/convertible/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6248 91177308-0d34-0410-b5e6-96231b3b80d8
2003-05-20 18:45:36 +00:00
Chris Lattner
4ad02e726d Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
2003-04-16 20:28:45 +00:00
Chris Lattner
088b639e3a Don't apply type information to load instructions if it will cause collapsing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5684 91177308-0d34-0410-b5e6-96231b3b80d8
2003-03-03 17:13:31 +00:00
Chris Lattner
a612afc54e Adjust to implement new AA interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5638 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-26 19:29:36 +00:00
Chris Lattner
98d6f0ad03 Fix resolution of indirect function calls... whoops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5576 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 23:27:18 +00:00
Chris Lattner
f1c283859b Mark function edges
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5571 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 20:25:47 +00:00
Chris Lattner
5f07a8b312 - Eliminate provably non-pointer nodes from graphs.
This helps a lot of testcases, for example:
            New Time  New #Nodes     Old Time    Old #Nodes
254.gap:    91.1024     21605        91.1397     22657
povray31:    2.7807      8613         3.0152     10338
255.vortex:  1.2034      8153         1.2172     8822
moria:        .6756      3150          .7054     3877
300.twolf:    .1652      2010          .1851     3270

Typically, testcases which use long and ulong integers a lot get better, f.e. povray above.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5566 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 06:28:00 +00:00
Chris Lattner
1a1a85d514 Don't put integer pointers (longs) into the scalar map.
This speeds stuff up by 10% on some tests, woot!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5564 91177308-0d34-0410-b5e6-96231b3b80d8
2003-02-14 04:55:58 +00:00