Chris Lattner
04946381b9
Add an initial version of the CompleteBUDataStructures class, which is currently
...
identical to the BU pass, but has an accurate call graph
llvm-svn: 9956
2003-11-13 01:43:00 +00:00
Chris Lattner
9e876556fd
Fine-grainify namespaces for this library
...
llvm-svn: 9948
2003-11-12 23:11:14 +00:00
Chris Lattner
da03a8a792
Add new argument to disable checking
...
llvm-svn: 9922
2003-11-12 17:58:22 +00:00
Chris Lattner
b740afb2b0
Print return nodes for graphs with multiple functions in them correctly
...
llvm-svn: 9914
2003-11-12 04:58:19 +00:00
Chris Lattner
12c71c00ef
Don't crash if no gg
...
llvm-svn: 9913
2003-11-12 04:57:58 +00:00
Brian Gaeke
960707c335
Put all LLVM code into the llvm namespace, as per bug 109.
...
llvm-svn: 9903
2003-11-11 22:41:34 +00:00
Chris Lattner
da05b05197
Compute node offsets correctly
...
llvm-svn: 9895
2003-11-11 20:12:32 +00:00
Chris Lattner
fdc8d6547b
Add new method for computing node mappings. This is used by the pool allocator
...
llvm-svn: 9880
2003-11-11 05:08:59 +00:00
Chris Lattner
cff83a2f24
Add support for memmove
...
llvm-svn: 9824
2003-11-09 03:32:52 +00:00
Chris Lattner
12dd38aa99
Handle bzero and memset in the local analysis, because we were missing the fact
...
that memset returns its argument!!
llvm-svn: 9811
2003-11-08 21:55:50 +00:00
Chris Lattner
2cb1db763e
This doesn't use DSCallSiteIterator
...
llvm-svn: 9809
2003-11-08 21:17:37 +00:00
Chris Lattner
2b9926fc8e
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.
llvm-svn: 9659
2003-11-02 22:27:28 +00:00
Chris Lattner
53e8fab411
Fix bug: test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
...
llvm-svn: 9658
2003-11-02 21:02:20 +00:00
John Criswell
29265fe981
Added LLVM copyright header.
...
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell
4436c49787
Added LLVM copyright notice to Makefiles.
...
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
482202a601
Added LLVM project notice to the top of every C++ source file.
...
Header files will be on the way.
llvm-svn: 9298
2003-10-20 19:43:21 +00:00
Alkis Evlogimenos
6e739d0a3c
Use std::string::size_type for for ColonPos to stop gcc from giving a warning
...
llvm-svn: 8811
2003-10-01 22:49:22 +00:00
Chris Lattner
66a473371f
DOn't crash if program calls the null pointer
...
llvm-svn: 8708
2003-09-24 23:42:58 +00:00
Chris Lattner
3c095c79fa
Functions reachable from the arguments of unresolvable call nodes should
...
not have their arguments marked complete
llvm-svn: 8639
2003-09-20 23:58:33 +00:00
Chris Lattner
413b7bde7c
The Globals graph must become complete at the end of the BU phase!
...
llvm-svn: 8638
2003-09-20 23:27:05 +00:00
Chris Lattner
880b9aa10a
Do not mark incoming arguments to functions complete if the function is pointed to by a global in the globals graph
...
llvm-svn: 8637
2003-09-20 22:24:04 +00:00
Chris Lattner
8c1a835806
Make sure to add global variable initializers to the Globals graph!
...
llvm-svn: 8636
2003-09-20 21:48:16 +00:00
Chris Lattner
71f747ea3d
Don't consider incomplete nodes to be typesafe!
...
llvm-svn: 8635
2003-09-20 21:48:01 +00:00
Chris Lattner
cc81b798e4
Remove trivially dead nodes was not removing nodes that were dead due to forwarding!
...
llvm-svn: 8634
2003-09-20 21:34:07 +00:00
Chris Lattner
689b681558
Add special case handling for calloc and realloc
...
llvm-svn: 8630
2003-09-20 16:50:46 +00:00
Chris Lattner
04d9cb6770
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!
llvm-svn: 8629
2003-09-20 16:34:13 +00:00
Chris Lattner
36b877ae7f
Make this work better for constants that aren't necessarily in ANY graph, such as null pointers
...
llvm-svn: 8628
2003-09-20 16:12:57 +00:00
Chris Lattner
b1fcb2b644
Keep track of the number of typed/untyped memory accesses theyre are in the program
...
VS: ----------------------------------------------------------------------
llvm-svn: 8611
2003-09-20 01:20:46 +00:00
Misha Brukman
329983228f
Fixed spelling and grammar.
...
llvm-svn: 8478
2003-09-11 18:14:24 +00:00
Chris Lattner
61182a2021
Add more verbose comment
...
llvm-svn: 7610
2003-08-05 18:38:37 +00:00
Sumant Kowshik
1d869b78f5
Added function mergeInGlobalsGraph which merges in the entire globals graph with the graph of a function
...
llvm-svn: 7606
2003-08-05 17:04:41 +00:00
Chris Lattner
8abcd56c74
DEBUG got moved to Support/Debug.h
...
llvm-svn: 7492
2003-08-01 22:15:03 +00:00
Chris Lattner
1cde34a7ff
Fix another minor bug
...
llvm-svn: 7340
2003-07-26 23:00:05 +00:00
Chris Lattner
d504c33746
Dont' try to parse the colon
...
llvm-svn: 7323
2003-07-25 20:49:29 +00:00
Chris Lattner
39e89fe443
Add a more general check-flags which can be used to ensure arbitrary flags are set
...
llvm-svn: 7322
2003-07-25 20:45:40 +00:00
Vikram S. Adve
eb04c29378
Fix comment.
...
llvm-svn: 7227
2003-07-22 12:08:58 +00:00
Brian Gaeke
c55a920283
Fix typo in call to isUnresolvableFunc, which was breaking the build.
...
llvm-svn: 7194
2003-07-17 19:07:46 +00:00
Vikram S. Adve
cf01ed5f75
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).
llvm-svn: 7189
2003-07-16 21:42:03 +00:00
Vikram S. Adve
03be4a96f3
(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.
llvm-svn: 7188
2003-07-16 21:40:28 +00:00
Vikram S. Adve
dce6694ff4
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.
llvm-svn: 7187
2003-07-16 21:36:31 +00:00
Vikram S. Adve
6c254f0534
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.)
llvm-svn: 7186
2003-07-16 21:25:17 +00:00
Chris Lattner
117da20334
Remove globals more aggressively from graphs.
...
Fix a bug where we removed nodes that were marked U.
llvm-svn: 7090
2003-07-03 02:03:53 +00:00
Chris Lattner
c812e5f44e
INCLUDE_PARENT_GRAPH is required!
...
llvm-svn: 7088
2003-07-02 23:57:05 +00:00
Chris Lattner
9a75369b74
Disable incorrect mustalias code
...
llvm-svn: 7087
2003-07-02 23:56:51 +00:00
Chris Lattner
959177fb96
Remove space at end of line
...
llvm-svn: 7084
2003-07-02 23:44:15 +00:00
Chris Lattner
7fd198806a
Fix how we are handling unreachable functions. This DRAMATICALLY improves efficiency
...
llvm-svn: 7082
2003-07-02 23:42:48 +00:00
Chris Lattner
cd7482b354
Keep track of how many inlinings are performed
...
llvm-svn: 7076
2003-07-02 20:24:42 +00:00
Chris Lattner
d3d5c5c98e
Try using trivially dead deletion
...
llvm-svn: 7075
2003-07-02 19:49:11 +00:00
Chris Lattner
ad7b9c1810
Remove dead Nodes list
...
llvm-svn: 7065
2003-07-02 06:06:34 +00:00
Chris Lattner
116f68a990
Complete rewrite of td pass
...
llvm-svn: 7064
2003-07-02 04:39:44 +00:00
Chris Lattner
049d558988
Print collapsed to match the paper
...
llvm-svn: 7063
2003-07-02 04:39:27 +00:00
Chris Lattner
0b61cdd191
Reduce amount of work we do calculating mustaliases if the arg is a global
...
llvm-svn: 7062
2003-07-02 04:39:13 +00:00
Chris Lattner
03f3cb1af7
Add support for ParentGraph only when building in debug mode
...
Minor cleanups, reenable folding of call nodes to external functions
llvm-svn: 7061
2003-07-02 04:38:49 +00:00
Chris Lattner
db6e0ac800
Add some functions to the blacklist
...
llvm-svn: 7060
2003-07-02 04:38:00 +00:00
Chris Lattner
5a3d63d5aa
Make the BU closure keep track of which actual calls happen
...
Minor cleanups
llvm-svn: 7059
2003-07-02 04:37:48 +00:00
Chris Lattner
3ff99e3731
Make local pass print out its progress
...
llvm-svn: 7058
2003-07-02 04:37:26 +00:00
Chris Lattner
23428214e9
Rework TD pass to work with the precise call graph constructed by the BU phase
...
llvm-svn: 7031
2003-07-01 16:28:11 +00:00
Chris Lattner
e809e3afd8
Do not treat global variables as functions! (and assert failing)
...
llvm-svn: 7030
2003-07-01 16:27:53 +00:00
Chris Lattner
8a30ad6d89
Dont' print scalar nodes for ConstantPointerRefs
...
llvm-svn: 7029
2003-07-01 16:27:32 +00:00
Chris Lattner
269467d216
Minor cleanups
...
llvm-svn: 7027
2003-07-01 16:04:18 +00:00
Chris Lattner
70923c688d
Use the getFunctionNames method
...
llvm-svn: 7008
2003-06-30 05:57:39 +00:00
Chris Lattner
bfce1115e3
Add new method
...
llvm-svn: 7007
2003-06-30 05:57:30 +00:00
Chris Lattner
f8865a4389
Split CallSiteIterator out into DSCallSiteIterator.h, and generalize it a bit
...
llvm-svn: 7006
2003-06-30 05:27:53 +00:00
Chris Lattner
fa52af4fb0
Be more const-correct
...
llvm-svn: 7005
2003-06-30 05:27:18 +00:00
Chris Lattner
0929c5ef68
Fix bug in last checkin
...
llvm-svn: 7003
2003-06-30 05:18:26 +00:00
Chris Lattner
4ffb4e0e03
Reimplement the BU closure to collapse all SCC graphs into a single graph.
...
Look at all of the code that gets deleted!
llvm-svn: 7001
2003-06-30 05:09:58 +00:00
Chris Lattner
348d93c8c2
Handle the case where OldNodeMap == &ScalarMap correctly
...
llvm-svn: 7000
2003-06-30 05:09:29 +00:00
Chris Lattner
312783f0d2
Remove dead method
...
llvm-svn: 6999
2003-06-30 04:53:39 +00:00
Chris Lattner
01877f5224
Do not delete the same graph multiple times when freeing memory if graphs are sharing
...
llvm-svn: 6998
2003-06-30 04:53:27 +00:00
Chris Lattner
7695128217
Do not multiply delete graphs if functions are sharing graphs
...
llvm-svn: 6997
2003-06-30 04:53:08 +00:00
Chris Lattner
6d187fdc5a
Move usages of explicit hash_* datastructures to use typedefs
...
llvm-svn: 6996
2003-06-30 03:36:09 +00:00
Chris Lattner
63aeacfe3d
Revamp DSGraphs so that they can support multiple functions in the same
...
DSGraph at one time
llvm-svn: 6994
2003-06-30 03:15:25 +00:00
Chris Lattner
7e29f97d1d
Abstract out the predicate which decides whether a function gets complete
...
arguments or not...
llvm-svn: 6987
2003-06-29 22:37:07 +00:00
Chris Lattner
205d1acfba
Fix minor bug in previous checkin
...
llvm-svn: 6986
2003-06-29 22:36:31 +00:00
Chris Lattner
992abdae26
Add support for ensuring that nodes are not incomplete
...
llvm-svn: 6985
2003-06-29 22:36:15 +00:00
Chris Lattner
16e3c398c8
Add support for "physical subtyping", which fixes:
...
DSGraph/2003-06-29-NodeCollapsing2.ll & DSGraph/PhysicalSubtyping.ll
llvm-svn: 6982
2003-06-29 20:27:45 +00:00
Chris Lattner
0aca3e714f
Add print method to not get silly warning from analyze
...
llvm-svn: 6981
2003-06-29 20:27:16 +00:00
Chris Lattner
5da440b239
New pass which is useful for writing regression tests
...
llvm-svn: 6979
2003-06-29 18:17:07 +00:00
Chris Lattner
0877def4f6
Expose must alias information for global variables, implementing: DSGraph/mustalias.ll
...
llvm-svn: 6973
2003-06-29 00:54:08 +00:00
Chris Lattner
fa578d0eb4
Propagate globals graph from the local to bu to td globals graphs. This
...
fixes bug: DSGraph/buglobals.ll
llvm-svn: 6947
2003-06-28 22:14:55 +00:00
Chris Lattner
c7ba69d8b4
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
llvm-svn: 6946
2003-06-28 22:10:58 +00:00
Chris Lattner
856a6cbb80
Avoid double negatives
...
llvm-svn: 6945
2003-06-28 21:58:28 +00:00
Chris Lattner
2890f428a9
New pass to perform DSA based optimizations. Initially we just support turning
...
globals into constants if we can prove it's safe
llvm-svn: 6941
2003-06-28 21:54:55 +00:00
Chris Lattner
d791d8e427
Remove support for the MultiObject flag, which was fundamentally broken
...
llvm-svn: 6840
2003-06-22 03:03:52 +00:00
Chris Lattner
4853d162af
* 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.
llvm-svn: 6794
2003-06-19 21:15:11 +00:00
Chris Lattner
3937726a5b
Nodes get forwarded when they are collapsed currently.
...
llvm-svn: 6696
2003-06-16 12:08:18 +00:00
Chris Lattner
82f4f85f6d
Remove bogus assertion: a node with no referrers could be collapsed if field-sensitivity was disabled
...
llvm-svn: 6695
2003-06-16 12:07:39 +00:00
Misha Brukman
e5838c4d72
s/convertable/convertible/g
...
llvm-svn: 6248
2003-05-20 18:45:36 +00:00
Chris Lattner
c12e5ccdb5
Don't apply type information to load instructions if it will cause collapsing
...
llvm-svn: 5684
2003-03-03 17:13:31 +00:00
Chris Lattner
e79b8319a6
Adjust to implement new AA interface
...
llvm-svn: 5638
2003-02-26 19:29:36 +00:00
Chris Lattner
b39d6355e1
Fix resolution of indirect function calls... whoops
...
llvm-svn: 5576
2003-02-14 23:27:18 +00:00
Chris Lattner
b5cbfa0f15
Mark function edges
...
llvm-svn: 5571
2003-02-14 20:25:47 +00:00
Chris Lattner
8acdca64fd
- 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.
llvm-svn: 5566
2003-02-14 06:28:00 +00:00
Chris Lattner
ddd3b7fa54
Don't put integer pointers (longs) into the scalar map.
...
This speeds stuff up by 10% on some tests, woot!
llvm-svn: 5564
2003-02-14 04:55:58 +00:00
Chris Lattner
3699ef409c
Hax0r around a deficiency in the Pass infrastructure
...
llvm-svn: 5555
2003-02-13 21:44:18 +00:00
Chris Lattner
60ede774af
Use the new tailclip property new added to graphviz CVS to make call nodes
...
actually intelligable
llvm-svn: 5554
2003-02-13 20:14:40 +00:00
Chris Lattner
a17866894a
Move node forwarding code from being inlined to being out-of-line.
...
This brings a 11.6% speedup to steens, and a 3.6 overall speedup to ds-aa
llvm-svn: 5552
2003-02-13 19:09:00 +00:00
Chris Lattner
7127d7db7a
Implement a "union-findy" version of DS-Analysis, which eliminates the
...
Referrers list on DSNodes.
llvm-svn: 5536
2003-02-11 23:11:51 +00:00
Chris Lattner
763502671d
Minor tweaks to printing. Close the file before viewing it in viewGraph
...
llvm-svn: 5535
2003-02-11 19:27:27 +00:00
Chris Lattner
e715357909
Modest speedup which seems to help steens quite a bit on large graphs
...
llvm-svn: 5532
2003-02-10 18:47:23 +00:00