Chris Lattner
a71b07eeca
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
63fb5bcaac
Fix bug: test/Regression/Analysis/DSGraph/2003-11-02-NodeCollapsing.ll
...
llvm-svn: 9658
2003-11-02 21:02:20 +00:00
John Criswell
de34542f41
Added LLVM copyright header.
...
llvm-svn: 9321
2003-10-21 15:17:13 +00:00
John Criswell
71d2894956
Added LLVM copyright notice to Makefiles.
...
llvm-svn: 9312
2003-10-20 22:26:57 +00:00
John Criswell
b402729b30
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
e6fdc87045
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
471405e2ba
DOn't crash if program calls the null pointer
...
llvm-svn: 8708
2003-09-24 23:42:58 +00:00
Chris Lattner
883cc51630
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
681a690f26
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
a85a2f8d86
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
c2e75f110a
Make sure to add global variable initializers to the Globals graph!
...
llvm-svn: 8636
2003-09-20 21:48:16 +00:00
Chris Lattner
a721b89e37
Don't consider incomplete nodes to be typesafe!
...
llvm-svn: 8635
2003-09-20 21:48:01 +00:00
Chris Lattner
f203e908e3
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
372fe6873d
Add special case handling for calloc and realloc
...
llvm-svn: 8630
2003-09-20 16:50:46 +00:00
Chris Lattner
b12a8a6177
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
6a460d88d3
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
448df1c145
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
b9a4ddbfc5
Fixed spelling and grammar.
...
llvm-svn: 8478
2003-09-11 18:14:24 +00:00
Chris Lattner
e2ee62c91c
Add more verbose comment
...
llvm-svn: 7610
2003-08-05 18:38:37 +00:00
Sumant Kowshik
1a4fce3511
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
686e94e760
DEBUG got moved to Support/Debug.h
...
llvm-svn: 7492
2003-08-01 22:15:03 +00:00
Chris Lattner
36a7bf78fa
Fix another minor bug
...
llvm-svn: 7340
2003-07-26 23:00:05 +00:00
Chris Lattner
752a4ca4c4
Dont' try to parse the colon
...
llvm-svn: 7323
2003-07-25 20:49:29 +00:00
Chris Lattner
915b998b3f
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
420ec0bb0f
Fix comment.
...
llvm-svn: 7227
2003-07-22 12:08:58 +00:00
Brian Gaeke
026c333f07
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
96abba3e01
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
e2993f34ed
(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
d1a85b7860
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
0ce80bfa82
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
2a6504c799
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
492b7eeb06
INCLUDE_PARENT_GRAPH is required!
...
llvm-svn: 7088
2003-07-02 23:57:05 +00:00
Chris Lattner
86c8f822ec
Disable incorrect mustalias code
...
llvm-svn: 7087
2003-07-02 23:56:51 +00:00
Chris Lattner
478e42b621
Remove space at end of line
...
llvm-svn: 7084
2003-07-02 23:44:15 +00:00
Chris Lattner
b64aff94fd
Fix how we are handling unreachable functions. This DRAMATICALLY improves efficiency
...
llvm-svn: 7082
2003-07-02 23:42:48 +00:00
Chris Lattner
083398eff5
Keep track of how many inlinings are performed
...
llvm-svn: 7076
2003-07-02 20:24:42 +00:00
Chris Lattner
59bb44723a
Try using trivially dead deletion
...
llvm-svn: 7075
2003-07-02 19:49:11 +00:00
Chris Lattner
c1f922d61e
Remove dead Nodes list
...
llvm-svn: 7065
2003-07-02 06:06:34 +00:00
Chris Lattner
56585a82d9
Complete rewrite of td pass
...
llvm-svn: 7064
2003-07-02 04:39:44 +00:00
Chris Lattner
a85502303e
Print collapsed to match the paper
...
llvm-svn: 7063
2003-07-02 04:39:27 +00:00
Chris Lattner
95c5313776
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
f4a221c87c
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
d49611837b
Add some functions to the blacklist
...
llvm-svn: 7060
2003-07-02 04:38:00 +00:00
Chris Lattner
64ea02737e
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
60652f41c4
Make local pass print out its progress
...
llvm-svn: 7058
2003-07-02 04:37:26 +00:00
Chris Lattner
5ddec0f02d
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
3536455262
Do not treat global variables as functions! (and assert failing)
...
llvm-svn: 7030
2003-07-01 16:27:53 +00:00
Chris Lattner
7ab30a179b
Dont' print scalar nodes for ConstantPointerRefs
...
llvm-svn: 7029
2003-07-01 16:27:32 +00:00
Chris Lattner
599287e3c3
Minor cleanups
...
llvm-svn: 7027
2003-07-01 16:04:18 +00:00
Chris Lattner
33fce4d868
Use the getFunctionNames method
...
llvm-svn: 7008
2003-06-30 05:57:39 +00:00
Chris Lattner
cb32be085b
Add new method
...
llvm-svn: 7007
2003-06-30 05:57:30 +00:00
Chris Lattner
851b6382b6
Split CallSiteIterator out into DSCallSiteIterator.h, and generalize it a bit
...
llvm-svn: 7006
2003-06-30 05:27:53 +00:00
Chris Lattner
e40d871120
Be more const-correct
...
llvm-svn: 7005
2003-06-30 05:27:18 +00:00
Chris Lattner
fb9f50ee23
Fix bug in last checkin
...
llvm-svn: 7003
2003-06-30 05:18:26 +00:00
Chris Lattner
9954cfc9bf
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
60b2516889
Handle the case where OldNodeMap == &ScalarMap correctly
...
llvm-svn: 7000
2003-06-30 05:09:29 +00:00
Chris Lattner
20d3019fa6
Remove dead method
...
llvm-svn: 6999
2003-06-30 04:53:39 +00:00
Chris Lattner
37d7a580b2
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
64008895c8
Do not multiply delete graphs if functions are sharing graphs
...
llvm-svn: 6997
2003-06-30 04:53:08 +00:00
Chris Lattner
8574358e8a
Move usages of explicit hash_* datastructures to use typedefs
...
llvm-svn: 6996
2003-06-30 03:36:09 +00:00
Chris Lattner
203826c2e1
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
762a057a22
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
9cb6f34b81
Fix minor bug in previous checkin
...
llvm-svn: 6986
2003-06-29 22:36:31 +00:00
Chris Lattner
9229da84be
Add support for ensuring that nodes are not incomplete
...
llvm-svn: 6985
2003-06-29 22:36:15 +00:00
Chris Lattner
94b29bf96d
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
ed9302c854
Add print method to not get silly warning from analyze
...
llvm-svn: 6981
2003-06-29 20:27:16 +00:00
Chris Lattner
55099822d5
New pass which is useful for writing regression tests
...
llvm-svn: 6979
2003-06-29 18:17:07 +00:00
Chris Lattner
b932c794ee
Expose must alias information for global variables, implementing: DSGraph/mustalias.ll
...
llvm-svn: 6973
2003-06-29 00:54:08 +00:00
Chris Lattner
1352a50cbb
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
801e22514d
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
5f90382628
Avoid double negatives
...
llvm-svn: 6945
2003-06-28 21:58:28 +00:00
Chris Lattner
cf6df3ef6b
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
0a0266865a
Remove support for the MultiObject flag, which was fundamentally broken
...
llvm-svn: 6840
2003-06-22 03:03:52 +00:00
Chris Lattner
365e583866
* 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
2806ac8828
Nodes get forwarded when they are collapsed currently.
...
llvm-svn: 6696
2003-06-16 12:08:18 +00:00
Chris Lattner
e718da0d46
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
74cf3f5246
s/convertable/convertible/g
...
llvm-svn: 6248
2003-05-20 18:45:36 +00:00
Chris Lattner
1778154dc7
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
4162adcfee
Adjust to implement new AA interface
...
llvm-svn: 5638
2003-02-26 19:29:36 +00:00
Chris Lattner
148d67f088
Fix resolution of indirect function calls... whoops
...
llvm-svn: 5576
2003-02-14 23:27:18 +00:00
Chris Lattner
37735c4677
Mark function edges
...
llvm-svn: 5571
2003-02-14 20:25:47 +00:00
Chris Lattner
00fe161e49
- 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
e5dbced215
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
b178c26c20
Hax0r around a deficiency in the Pass infrastructure
...
llvm-svn: 5555
2003-02-13 21:44:18 +00:00
Chris Lattner
32a8143e30
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
120d135f05
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
522cb6d282
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
2d27e0d912
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
de261140d0
Modest speedup which seems to help steens quite a bit on large graphs
...
llvm-svn: 5532
2003-02-10 18:47:23 +00:00
Chris Lattner
8d025d56d6
Fix problem breaking GAP, use hasNoReferrers more
...
llvm-svn: 5530
2003-02-10 18:18:18 +00:00
Chris Lattner
72fbffecd2
Implement a new "viewGraph" method which can be used to instantly view a graph from gdb
...
llvm-svn: 5528
2003-02-10 18:17:07 +00:00
Chris Lattner
940a5eddb3
Rearrange code
...
llvm-svn: 5527
2003-02-10 18:16:36 +00:00
Chris Lattner
1ed7b4806b
Fix problem breaking Fhourstones
...
llvm-svn: 5526
2003-02-10 18:16:19 +00:00
Chris Lattner
34a3429b0a
Make steensgaards performance not shameful
...
llvm-svn: 5524
2003-02-10 00:14:57 +00:00
Chris Lattner
f8c57bab25
Don't insert null entries into the scalar map for constexpr (cast null to Ty)
...
llvm-svn: 5523
2003-02-09 23:04:12 +00:00
Chris Lattner
117a27d291
Switch to using the right call vector
...
llvm-svn: 5517
2003-02-09 19:26:47 +00:00
Chris Lattner
dcf8d02380
Fix major bugs in incompleteness marking that were pessimizing results
...
llvm-svn: 5515
2003-02-09 18:42:43 +00:00
Chris Lattner
063bef68c4
Print out the steens graph if -debug is specified
...
llvm-svn: 5514
2003-02-09 18:42:16 +00:00
Chris Lattner
5da09703fa
* Fix a bug where global incompleteness marking would not mark the global
...
itself incomplete!
* Allow incompleteness callers to specify they don't want globals to be
considered sources of incompleteness.
llvm-svn: 5513
2003-02-09 18:41:49 +00:00
Chris Lattner
8711f611fa
Add a special case for main because we know it's incoming arguments don't alias
...
llvm-svn: 5511
2003-02-08 23:08:02 +00:00
Chris Lattner
6daed111da
Fix a bug where we would mark the callees arguments incomplete if the caller was external.
...
llvm-svn: 5510
2003-02-08 23:07:39 +00:00
Chris Lattner
a05bfd7525
Remove explicit result counters
...
llvm-svn: 5508
2003-02-08 23:03:17 +00:00
Chris Lattner
2c7c54ce9d
Add a flag which effectively disables field sensitivity
...
llvm-svn: 5506
2003-02-08 20:18:39 +00:00
Chris Lattner
b056679b1e
Don't bother counting alias results, allow the AliasAnalysisCounter to do that.
...
llvm-svn: 5505
2003-02-07 20:39:48 +00:00
Chris Lattner
21e1033bff
Fix an assertion failure
...
llvm-svn: 5496
2003-02-06 00:15:08 +00:00
Chris Lattner
5f3ef2f0e7
Implement optimization for direct function call case. This dramatically
...
reduces the number of function nodes created and speeds up analysis by
about 10% overall.
llvm-svn: 5495
2003-02-05 21:59:58 +00:00
Chris Lattner
4aa35d21be
Remove bogus assertion
...
llvm-svn: 5492
2003-02-04 16:33:23 +00:00
Chris Lattner
4e0422745c
Fix a huge bug with handling non-pointer instructions
...
llvm-svn: 5491
2003-02-04 00:59:50 +00:00
Chris Lattner
a4f94897b9
Make the TD pass not include all of the call nodes from the local pass,
...
eliminating incomplete markers from them
llvm-svn: 5490
2003-02-04 00:59:32 +00:00
Chris Lattner
e8381114ef
Add sanity check
...
llvm-svn: 5489
2003-02-04 00:03:57 +00:00
Chris Lattner
96f37f267a
Fix steensgaard to work on a lot more cases...
...
llvm-svn: 5488
2003-02-04 00:03:37 +00:00
Chris Lattner
2e3829c76d
Fix printing of nonfunction graphs
...
llvm-svn: 5487
2003-02-04 00:03:18 +00:00
Chris Lattner
7b9a9209fc
Rename variable
...
llvm-svn: 5486
2003-02-03 22:51:53 +00:00
Chris Lattner
102e619864
Hack to work around deficiency in pass infrastructure
...
llvm-svn: 5485
2003-02-03 22:51:28 +00:00
Chris Lattner
2a3c476fd4
Initial implementation of ds-aa
...
llvm-svn: 5484
2003-02-03 22:50:46 +00:00
Chris Lattner
2ce14e226e
* Fix a bug introduced in the last checkin wrt Stack markers
...
* Make cloning more efficient in the process...
llvm-svn: 5479
2003-02-03 20:08:51 +00:00
Chris Lattner
5d14f5d9ac
Implement the globals graph!
...
llvm-svn: 5477
2003-02-03 19:12:15 +00:00
Chris Lattner
a589169d22
Add better debug output
...
llvm-svn: 5476
2003-02-03 19:11:38 +00:00
Chris Lattner
e4d8ec335c
Be a bit more specific in caption
...
llvm-svn: 5469
2003-02-02 16:42:01 +00:00
Chris Lattner
acc67b5d1d
Fix a bug where we would delete neccesary calls in bu pass
...
llvm-svn: 5465
2003-02-01 06:54:31 +00:00
Chris Lattner
d946a6a307
Fix a bug where we would incorrectly delete globals which had edges to alive nodes in
...
a graph in the t-d pass. This slows down the TD pass by quite a bit (1/3), but is
needed for correctness.
llvm-svn: 5464
2003-02-01 06:51:17 +00:00
Chris Lattner
4f56dfb8d8
Delete nodes more efficiently
...
llvm-svn: 5463
2003-02-01 06:41:15 +00:00
Chris Lattner
bbd430c392
Remove dead nodes more efficiently
...
llvm-svn: 5462
2003-02-01 06:23:33 +00:00
Chris Lattner
8bb8f73e76
Improve efficiency of aliveness traversal code
...
llvm-svn: 5461
2003-02-01 06:17:02 +00:00
Chris Lattner
7aec6c471b
Change DSGraph stuff to use hash_(set|map) instead of std::(set|map)
...
This change provides a small (3%) but consistent speedup
llvm-svn: 5460
2003-02-01 04:52:08 +00:00
Chris Lattner
6051f888b4
Remove using declarations
...
llvm-svn: 5456
2003-02-01 04:01:21 +00:00
Chris Lattner
c3e8b48d5e
Remove globals on the bottom up pass which do not contain any information
...
llvm-svn: 5451
2003-01-31 23:57:36 +00:00
Chris Lattner
390dc95c05
Add functions to the ban list
...
llvm-svn: 5450
2003-01-31 23:57:10 +00:00
Chris Lattner
91e3c1eeac
Use and implement API for graph traversals
...
llvm-svn: 5431
2003-01-29 21:10:20 +00:00
Chris Lattner
712b3598b8
free instructions mark their operands as being heap nodes.
...
llvm-svn: 5425
2003-01-28 20:59:57 +00:00
Chris Lattner
f1afc156f8
* Eliminate boolean arguments in favor of using enums
...
* T-D pass now eliminates unreachable globals
llvm-svn: 5419
2003-01-23 22:05:33 +00:00
Chris Lattner
1c82a35a0b
Slight efficiency improvement
...
llvm-svn: 5418
2003-01-23 21:31:16 +00:00
Chris Lattner
bd72aa79fc
Fix analysis of the Burg program
...
llvm-svn: 5401
2003-01-22 22:00:24 +00:00
Misha Brukman
1264a03c8a
'graph' is spelled without a 'c'.
...
Also added Statistic counters for NoAlias and MayAlias.
llvm-svn: 4972
2002-12-12 05:34:10 +00:00
Vikram S. Adve
773fe59c79
Two bug fixes:
...
(1) Make entries for Constant values in the ScalarMap.
(2) Set MOD bit for the node pointed to by the
argument of a free instruction.
llvm-svn: 4948
2002-12-06 21:17:10 +00:00
Vikram S. Adve
cb7daf77e8
Fix several related bugs in DSNode::mergeWith() caused by the
...
fact that the incoming nodes may be merged away at intermediate
steps. Use an extra level of indirection via DSNodeHandles
to track the nodes being merged. All this now happens in a
static helper function MergeNodes().
llvm-svn: 4947
2002-12-06 21:15:21 +00:00
Vikram S. Adve
ab3a68a7c3
Cute bug fix: when moving links from N to this, some links could have
...
been missed if node *this got merged away due to recursive merging!
Also, links were not moved correctly if a node is collapsed.
llvm-svn: 4933
2002-12-05 17:17:26 +00:00
Vikram S. Adve
b0371788d9
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.
llvm-svn: 4836
2002-11-27 17:41:13 +00:00
Vikram S. Adve
7bbda247e2
Keep global nodes in each DS Graph (by forcing them to be marked live).
...
llvm-svn: 4831
2002-11-25 18:21:25 +00:00
Chris Lattner
ad3955d6a5
Add peak memory usage measurement stuff
...
Add structure padding optimizations
llvm-svn: 4749
2002-11-18 21:44:46 +00:00
Chris Lattner
f179a40a00
Add peak memory usage support
...
llvm-svn: 4748
2002-11-18 21:44:19 +00:00
Chris Lattner
25a8814af0
Add stats
...
llvm-svn: 4747
2002-11-18 21:42:45 +00:00
Chris Lattner
38bc372a49
Add hack to only consider indirect calls indirect if they do more than cast
...
their source function
llvm-svn: 4723
2002-11-17 22:17:12 +00:00
Chris Lattner
322901a840
Add MaxSCC statistics
...
llvm-svn: 4722
2002-11-17 22:16:28 +00:00
Vikram S. Adve
2dfc11dc3b
Pass to compute various statisics related to DSGraphs.
...
For now, this just computes the #indirect call sites and
the avg. #callees per indirect call site (actually it prints
both totals and the average is their ratio).
llvm-svn: 4705
2002-11-13 15:41:00 +00:00
Chris Lattner
b257e87db5
Inline graphs from outside the SCC into the SCC before SCC resolution starts
...
llvm-svn: 4701
2002-11-12 15:58:08 +00:00
Chris Lattner
cd37857ad0
Fix two bugs:
...
* The globals vector was getting broken and unsorted, this caused vortex
to get badly pessimized
* Node offset handling was being handled really poorly, and in particular
we were not merging types with offsets right. This causes several graphs
to be non-merged.
llvm-svn: 4699
2002-11-12 07:20:45 +00:00
Chris Lattner
f56a5282d2
Handle a mismatch between # function args and call site args
...
llvm-svn: 4696
2002-11-11 21:36:05 +00:00
Chris Lattner
6fcb6f1472
Elimiante calls to a node with nothing in it.
...
llvm-svn: 4695
2002-11-11 21:35:38 +00:00
Chris Lattner
0052b69a32
Complete rewrite of BU code to use Tarjan's SCC finding algorithm to drive
...
the algorithm instead of hand coded depth first iteration
llvm-svn: 4694
2002-11-11 21:35:13 +00:00
Chris Lattner
fb44e1ff28
Mark stuff reachable by _AUX_ calls as incomplete in the BU graph
...
llvm-svn: 4690
2002-11-11 03:36:55 +00:00
Chris Lattner
f05d126a68
Fix infinite loop in the BU algorithm. Unfortunately this dies a serious
...
death when handling moderately sized SCC's, but what can you do
llvm-svn: 4689
2002-11-11 00:01:34 +00:00
Chris Lattner
a7302da4e8
Print the right call set size
...
llvm-svn: 4688
2002-11-11 00:01:02 +00:00
Chris Lattner
41bf6e1bc6
Use call site mergeWith method to simplify code
...
llvm-svn: 4687
2002-11-11 00:00:46 +00:00
Chris Lattner
0fe1af497d
Fix a bug that could trigger when varargs call sites had non-matching number of arguments
...
llvm-svn: 4683
2002-11-10 07:46:08 +00:00
Chris Lattner
928e9c012b
* Dramatically rework liveness evaluation.
...
* Implement the first step of the Globals graph: Deleting nodes from function
graphs. In practice, these nodes need to be moved to the globals graph, but
this will be taken care of later. Note that the graphs computed right now are
not strictly correct!
llvm-svn: 4681
2002-11-10 06:59:55 +00:00
Chris Lattner
f5667969d1
Honor the shouldPrintAuxCalls flag
...
llvm-svn: 4678
2002-11-10 06:53:59 +00:00
Chris Lattner
2597c1158f
Initialize PrintAuxCalls member
...
llvm-svn: 4677
2002-11-10 06:53:38 +00:00
Chris Lattner
a30663385f
* Bottom-Up graphs print the Aux call vector
...
* Significantly improve DEBUG output
* Aggressively fold calls together if we inlined a graph that provides
call nodes.
* Add a bailout if the current graph has over 200 call nodes in it, this is
a really whacky case that should never happen.
llvm-svn: 4675
2002-11-10 06:52:47 +00:00
Chris Lattner
1fe76d2385
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.
llvm-svn: 4666
2002-11-09 22:07:02 +00:00
Chris Lattner
d9c732c581
Remove obsolete code
...
llvm-svn: 4665
2002-11-09 21:41:44 +00:00
Chris Lattner
20d264e16b
Fix logic
...
llvm-svn: 4664
2002-11-09 21:40:58 +00:00
Chris Lattner
0752756a6a
Add globals graphs to all three passes
...
llvm-svn: 4663
2002-11-09 21:12:07 +00:00
Chris Lattner
f6ea37ce99
Move maskNodeTypes to header file
...
llvm-svn: 4661
2002-11-09 21:02:26 +00:00
Chris Lattner
e726eb5ea7
Clean up DSGraph::removeDeadNodes interface
...
llvm-svn: 4660
2002-11-09 21:00:49 +00:00
Chris Lattner
3e54e8f3ca
Make removeTriviallyDeadNodes a private interface of DSGraph
...
llvm-svn: 4659
2002-11-09 20:55:24 +00:00
Chris Lattner
082bbe3069
Don't put constants into the scalar map!
...
llvm-svn: 4657
2002-11-09 20:14:03 +00:00
Chris Lattner
1c5c03d6f7
Add initial support for a globals graph
...
llvm-svn: 4656
2002-11-09 20:01:01 +00:00
Chris Lattner
5a11bf70c3
Tighten up array handling
...
llvm-svn: 4655
2002-11-09 19:25:27 +00:00
Chris Lattner
6172544663
#include Datastructure.h first
...
llvm-svn: 4654
2002-11-09 19:25:10 +00:00
Chris Lattner
b3580d5111
Fix warning & release build
...
llvm-svn: 4648
2002-11-09 00:49:05 +00:00
Chris Lattner
608bb157f7
Fold arrays down to a single element. This causes huge wins on some benchmarks
...
for example: 197.parser (64M->14M), 164.gzip (14M->2.7M). The actual graphs
represented should not change at all.
llvm-svn: 4643
2002-11-08 22:49:57 +00:00
Chris Lattner
4baa01ba61
ONLY merge in the aux call sites, this causes a HUGE speedup
...
llvm-svn: 4640
2002-11-08 22:27:25 +00:00
Chris Lattner
380395f58e
Allow specification of whether the call sites should be copied, AND whether
...
the aux call sites should be copied
llvm-svn: 4639
2002-11-08 22:27:09 +00:00
Chris Lattner
5cffea23bb
Reenable 'quick exit' case
...
llvm-svn: 4638
2002-11-08 22:26:43 +00:00
Chris Lattner
b3bf781d44
Reimplement TD pass completely it now works
...
llvm-svn: 4635
2002-11-08 21:28:37 +00:00
Chris Lattner
f1e963a98c
Cannot modify original call sites vector
...
llvm-svn: 4634
2002-11-08 21:27:37 +00:00
Chris Lattner
427b472549
- Add a bunch of checking to make sure that dead nodes are not used after they
...
are marked DEAD. This helped track down some bugs
- Fix a bunch of bugs where we were doing work on nodes after they became dead
- Add support for aux function call sites
- Add support for not cloning call sites
llvm-svn: 4633
2002-11-08 21:27:12 +00:00
Chris Lattner
4feccc4d45
Remove gunk used by broken TD pass
...
llvm-svn: 4632
2002-11-08 21:25:24 +00:00
Chris Lattner
22e36c86cd
Use DSNodeHandleMap instead to be safe
...
llvm-svn: 4622
2002-11-08 05:01:14 +00:00
Chris Lattner
986ec528fd
* actually handle constants (especially constantexprs) correctly.
...
- This seems to dramatically improve many benchmarks, only slowing down
gzip significantly.
llvm-svn: 4621
2002-11-08 05:00:44 +00:00
Chris Lattner
86b5e92d45
Add flush
...
llvm-svn: 4619
2002-11-08 01:21:07 +00:00
Chris Lattner
450e1fbc76
Instead of using a bool that constant has to be explained, use a self
...
explanitory enum instead.
llvm-svn: 4600
2002-11-07 07:06:20 +00:00
Chris Lattner
7d2624d4f3
Implement a new mergeInGraph method, which basically factors code out of
...
the BU class.
This will be used by the IPModRef class to do stuff, eventually perhaps the
TD pass will use it also.
Speaking of the TD pass, this also eliminates the self recursive case, which
was broken, and couldn't occur anyway.
llvm-svn: 4599
2002-11-07 06:31:54 +00:00
Chris Lattner
dfba076f5b
Rename DataStructureAnalysis namespace to DS
...
llvm-svn: 4596
2002-11-07 05:20:53 +00:00
Chris Lattner
d68d0a9037
Minor bugfix to enable generation of methcall.llvm.lib, objinst.llvm.lib, and
...
The problem was merging two unsized types like function's, ie int (int*) with
int (uint *)
llvm-svn: 4594
2002-11-07 04:59:28 +00:00
Chris Lattner
b0de126c1a
Compute total number of nodes and # call nodes
...
llvm-svn: 4592
2002-11-07 02:18:46 +00:00
Chris Lattner
f352eadeb3
Move printouts to be wrapped in DEBUG() macros
...
llvm-svn: 4588
2002-11-07 01:54:56 +00:00
Chris Lattner
1efa9f0247
When the -only-print-main-ds option is specified, still print out graph size
...
statistics for skipped functions
llvm-svn: 4587
2002-11-07 01:54:44 +00:00
Chris Lattner
97722c2dad
Change Steens class to build with Vikram's changes
...
llvm-svn: 4572
2002-11-06 18:08:32 +00:00
Chris Lattner
6a019cdff5
Make PointerSize & Shift be enums
...
Fix problem with recursive merging
llvm-svn: 4570
2002-11-06 18:01:39 +00:00
Chris Lattner
d0387e7e11
Dramatically simplify internal DSNode representation, get implementation
...
*FULLY OPERATIONAL* and safe. We are now capable of completely analyzing
at LEAST the Olden benchmarks + 181.mcf
llvm-svn: 4562
2002-11-06 06:20:27 +00:00
Chris Lattner
304e29942d
Delete "StripScalars" argument to cloneInto method
...
llvm-svn: 4560
2002-11-06 06:16:30 +00:00
Chris Lattner
b09aadd633
Attempted fixes to the mergemap to make it work better.
...
Ended up disabling merge map merging completely. It shall be removed.
llvm-svn: 4550
2002-11-05 00:01:58 +00:00
Chris Lattner
5c467c7d99
Change the "Cannot merge two portions of the same node yet" from an assertion
...
into a "oh crap, lets collapse" case
llvm-svn: 4530
2002-11-04 06:48:26 +00:00
Chris Lattner
4e4beb637b
Give a better error message in an unhandled case
...
llvm-svn: 4521
2002-11-04 02:29:15 +00:00
Chris Lattner
8d63aab886
Rename ValueMap to ScalarMap
...
llvm-svn: 4516
2002-11-03 21:27:48 +00:00
Chris Lattner
0ee058644e
Rename NewNode flag to HeapNode
...
llvm-svn: 4515
2002-11-03 21:24:04 +00:00
Chris Lattner
7287a8f9a8
Change the letters used to represent stack and heap allocations to "S" and "H"
...
respectively. This is to make presentation easier in the paper.
llvm-svn: 4514
2002-11-03 19:46:15 +00:00
Chris Lattner
702ac95902
Implement the "unknown flag" which mainly consists of aligning printing code
...
llvm-svn: 4490
2002-11-02 00:36:03 +00:00
Chris Lattner
53f7777f77
Oops, this was not meant to be checked in
...
llvm-svn: 4489
2002-11-02 00:26:32 +00:00
Chris Lattner
226c503f31
Stop representing scalars as explicit nodes in the graph. Now the only
...
nodes in the graph are memory objects, which is very nice. This also greatly
reduces the size and memory footprint for DSGraphs. For example, the local
DSGraph for llu went from 65 to 13 nodes with this change. As a side bonus,
dot seems to lay out the graphs slightly better too. :)
llvm-svn: 4488
2002-11-02 00:13:20 +00:00
Chris Lattner
251a8d9df5
Fix comments, steens is context sensitive, we just haven't implemented
...
mod/ref apis yet
llvm-svn: 4485
2002-11-01 17:34:23 +00:00
Chris Lattner
52b845cd0c
Add a fixme
...
llvm-svn: 4479
2002-10-31 23:24:00 +00:00
Chris Lattner
32eb8c3659
* Minor optimization: when merging nodes, merge the smaller one into the
...
larger one.
* Handle the case where we are merging two nodes of different size better.
llvm-svn: 4476
2002-10-31 22:41:15 +00:00
Chris Lattner
07c1f70586
Remove dead code
...
llvm-svn: 4467
2002-10-31 06:52:26 +00:00
Chris Lattner
317daff9bf
This fixes all kinds of problems with array handling. There are still bugs to
...
be fixed, but we are getting much closer now.
* Make DSNode::TypeRec a full fledged DSTypeRec type.
* Add methods used to update and access the typerecords elements
* Add methods to query if and to cause a node to be completely folded
* DSGraph construction doesn't use the allocation type for anything at all,
now nodes get their type information based on how they are used.
* Fixed a bug with global value handling introduced in the last checkin
* GEP support is now much better, arrays are handled correctly. The array
flag is now updated in type records. There are still cases that are not
handled yet (we do not detect pessimizations), but getting much closer.
llvm-svn: 4465
2002-10-31 05:45:02 +00:00
Chris Lattner
296c58a00c
- Make sure to only keep track of mappings that the TD pass may need in the
...
future. This prevents having spurious map entries to nodes that we really
don't care about. This allows us to reenable the DeadNodeElim, which was
disabled.
llvm-svn: 4260
2002-10-22 16:01:03 +00:00
Chris Lattner
61b32b3ab0
The callee is not correct, and confuses the TD pass. Null it out.
...
llvm-svn: 4259
2002-10-22 15:58:46 +00:00
Chris Lattner
1157e5dafb
Delete unused arguments to DSGraph::cloneInto method
...
llvm-svn: 4253
2002-10-21 19:50:29 +00:00
Chris Lattner
4410178282
- Add "ResolvingCaller" to the CallSite record. This keeps track of which
...
function was finally able to resolve the function call. Adding this allows
the TD pass to actually work right!
- Temporarily disable dead node pruning. This will be reenabled soon.
llvm-svn: 4252
2002-10-21 19:47:18 +00:00
Chris Lattner
7588e35aa8
Add another copy ctor form
...
llvm-svn: 4251
2002-10-21 15:32:34 +00:00
Chris Lattner
1276c50e7b
As it turns out, we don't need a fully generic mapping copy ctor, we just need
...
something that maps through a std::map. Since this simplified the client and
implementation code, do so now.
llvm-svn: 4250
2002-10-21 15:04:18 +00:00
Chris Lattner
8929f75913
Don't create a new node for every reference to a global. This caused a huge
...
node explosion that doesn't help anything at all. In previous versions of
the representation this DID help, but not anymore.
llvm-svn: 4249
2002-10-21 13:51:30 +00:00
Chris Lattner
9f6ddf9bdd
Fix a confusing bug that caused return value and callee pointers to not
...
be printed!
llvm-svn: 4248
2002-10-21 13:47:57 +00:00
Chris Lattner
01fc78de5f
Remove some unneccesary 'using' directives
...
llvm-svn: 4246
2002-10-21 13:31:48 +00:00
Chris Lattner
1953a9de17
Fix bug with prior checkin
...
llvm-svn: 4242
2002-10-21 02:18:55 +00:00
Chris Lattner
2914391ab6
- Make DSCallSite not inherit from std::vector. Renamed methods slightly.
...
Make copy ctor have two versions to avoid dealing with conditional template
argument. DSCallSite ctor now takes all arguments instead of taking one
and being populated later.
llvm-svn: 4240
2002-10-21 02:08:03 +00:00
Chris Lattner
189b9b5397
Avoid extra copy
...
llvm-svn: 4239
2002-10-20 22:12:06 +00:00
Chris Lattner
9d0418d007
Simplify code a bit, add comment flyer
...
llvm-svn: 4238
2002-10-20 22:11:44 +00:00
Chris Lattner
4eec37a762
Split some long lines
...
llvm-svn: 4237
2002-10-20 22:11:17 +00:00
Vikram S. Adve
85a358583f
Remove spurious caller pointer in DSCallSite.
...
Also add functions to access pointer argument nodes cleanly.
llvm-svn: 4235
2002-10-20 21:41:02 +00:00
Chris Lattner
ff8176c481
This function can be static
...
llvm-svn: 4234
2002-10-20 20:39:31 +00:00
Chris Lattner
cf6f36ae27
Fix previous checkin :(
...
llvm-svn: 4233
2002-10-20 20:39:17 +00:00
Chris Lattner
2f778ae5aa
Avoid extra callSite copy
...
llvm-svn: 4232
2002-10-20 20:32:13 +00:00
Chris Lattner
3af7377974
Print the array flag
...
llvm-svn: 4231
2002-10-20 20:29:10 +00:00
Vikram S. Adve
c02c96c3de
Added a first-class representation for each call site that can be
...
used in the DS graphs. Essentially, what was vector<DSNodeHandle>
before is now a DSCallSite with the same vector, plus pointers to the
CallInst and the caller Function. The special-purpose class
BUDataStructure::CallSite is no longer needed.
llvm-svn: 4228
2002-10-20 18:07:37 +00:00
Chris Lattner
efc251af3d
Convert typerec to be a structure instead of a pair
...
llvm-svn: 4226
2002-10-18 18:22:46 +00:00
Chris Lattner
bd5e932aeb
Print Mod/ref info
...
llvm-svn: 4224
2002-10-17 22:13:28 +00:00
Chris Lattner
51b2abb899
Calculate mod/ref info
...
llvm-svn: 4223
2002-10-17 22:13:19 +00:00
Chris Lattner
4e44ccce8a
Remove more obsolete code
...
llvm-svn: 4221
2002-10-17 20:53:12 +00:00
Chris Lattner
2ffe6a8e0b
* Make the DSGraph cloner automatically merge global nodes
...
* BUClosure doesn't have to worry about global nodes
* TDClosure now works with global nodes
* Reenable DNE on TD pass, now that globals work right
llvm-svn: 4220
2002-10-17 20:09:52 +00:00
Chris Lattner
920190f83a
Remove obsolete code
...
llvm-svn: 4218
2002-10-17 04:58:10 +00:00
Chris Lattner
90ccd73585
Enable incompleteness marking
...
llvm-svn: 4217
2002-10-17 04:57:28 +00:00
Chris Lattner
5028142e9a
* First try at implementing TD pass this does not merge global nodes yet,
...
among other things.
* Significant rewrite of TD pass to avoid potentially N^2 algorithms if
possible. It is still not complete, but at least it's checked in now.
llvm-svn: 4215
2002-10-17 04:26:54 +00:00
Chris Lattner
b61fe19f98
Reenable printing of TD analysis
...
llvm-svn: 4214
2002-10-17 04:24:30 +00:00
Chris Lattner
0c48561a9e
* Add data structures and code to track the call sites for each function
...
llvm-svn: 4213
2002-10-17 04:24:08 +00:00
Chris Lattner
516c8391c7
Cleanup data structure graph printer, eliminate hard coded printing in
...
favor of generic printer.
llvm-svn: 4209
2002-10-17 01:02:46 +00:00
Chris Lattner
1e46327844
Make sure to print out the call nodes as well
...
llvm-svn: 4203
2002-10-16 20:16:16 +00:00
Chris Lattner
278e5a3fe6
* Print the "return" node in the graphs
...
llvm-svn: 4199
2002-10-16 02:04:36 +00:00
Chris Lattner
3702063ff3
The second element of the iterator is really an offset, not a link
...
llvm-svn: 4196
2002-10-16 01:43:11 +00:00
Chris Lattner
9ed6bfa052
Specify the graph name
...
llvm-svn: 4195
2002-10-16 01:34:28 +00:00
Chris Lattner
afeca1f7f6
- DSGraph Printing Improvements:
...
* Print edge source labels again
* Override node shape to be Mrecord again, instead of just record.
llvm-svn: 4193
2002-10-16 01:18:27 +00:00
Chris Lattner
ee64370eb5
Halfway conversion from custom printing to GraphWriter printing
...
llvm-svn: 4146
2002-10-13 19:31:57 +00:00
Chris Lattner
eeecc3e1b3
Prune function nodes that are no longer referenced due to inlining
...
llvm-svn: 4036
2002-10-03 21:55:28 +00:00
Chris Lattner
8f603615d8
sgefa uses truely huge data structures nodes. Only print part of them if they
...
are so big
llvm-svn: 4035
2002-10-03 21:55:13 +00:00
Chris Lattner
31d4a68166
Handle bug exposed by power benchmark
...
llvm-svn: 4033
2002-10-03 21:06:38 +00:00
Chris Lattner
fcdb95cd42
Reimplement/port the Bottom Up Closure pass
...
llvm-svn: 4031
2002-10-03 20:38:41 +00:00
Chris Lattner
e52f808665
DataStructure.h doesn't include DSGraph.h
...
llvm-svn: 4029
2002-10-02 22:14:38 +00:00
Chris Lattner
62ca2aa593
* Implement fully general merging of array subscripts on demand! This
...
does not handle the initial pointer index case yet though.
llvm-svn: 4012
2002-10-02 06:24:36 +00:00
Chris Lattner
5f38d9c112
When printing DS nodes, print the mergemap index as well to allow easier
...
debugging of merging process.
llvm-svn: 4010
2002-10-02 05:17:55 +00:00
Chris Lattner
8c25c1a641
* Significant rework of DSNode to support arbitrary aliasing due to merging
...
* Now all and any bytes of a DSNode can be merged together individually. This
is neccesary to support the full generality of C and support aliasing
correctly.
llvm-svn: 4008
2002-10-02 04:57:39 +00:00
Chris Lattner
9fc451723d
Initial checkin of Steensgaards context insensitive flow insensitive
...
alias analysis
llvm-svn: 3997
2002-10-01 22:34:12 +00:00
Chris Lattner
c1b7de86d5
Checkin some major reworks of data structure analysis. This is not done,
...
nor does it work very well, but I need to get it checked in before I break
the tree unintentionally.
llvm-svn: 3996
2002-10-01 22:33:50 +00:00
Chris Lattner
9f18db8156
Eliminated the MemAccessInst class, folding contents into GEP class.
...
llvm-svn: 3488
2002-08-22 23:37:24 +00:00
Chris Lattner
969c616d51
Load & StoreInst no longer derive from MemAccessInst, so we don't have
...
to handle indexing anymore
llvm-svn: 3485
2002-08-22 22:49:05 +00:00
Chris Lattner
b90f78e2b3
- Do not expose ::ID from any of the analyses anymore.
...
llvm-svn: 3416
2002-08-21 17:09:45 +00:00
Chris Lattner
75f1e2a970
Minor changes to DEBUG()'s
...
llvm-svn: 3261
2002-08-07 21:41:11 +00:00
Chris Lattner
d9530f6734
Reorder #includes to be right
...
llvm-svn: 3260
2002-08-07 21:41:03 +00:00
Chris Lattner
303fa649e3
Changes to be GCC3.1 friendly
...
llvm-svn: 3186
2002-07-31 19:32:12 +00:00
Chris Lattner
d376feeb74
Add new -only-print-main-ds option that causes mains ds graph to be
...
printed, but no others.
llvm-svn: 3178
2002-07-31 17:15:40 +00:00
Vikram S. Adve
6162134b47
Add GlobalDSGraph -- a common graph that holds externally visible nodes.
...
llvm-svn: 3173
2002-07-30 22:08:08 +00:00
Vikram S. Adve
abafb80e33
Print globals graph after either the BU or the TD pass.
...
llvm-svn: 3172
2002-07-30 22:07:26 +00:00
Vikram S. Adve
6152aa7f73
This file implements the top-down propagation pass for data structure graphs.
...
Also, we now use a separate globals graph to hold externally visible nodes.
This changes both the bottom-up and top-down propagation so that
globals and other external objects do not have to appear in every
function, but only in functions in which they are referenced or
they can be used to access something else that is referenced.
llvm-svn: 3171
2002-07-30 22:06:40 +00:00
Vikram S. Adve
b9c05cf65b
Use a separate globals graph to hold externally visible nodes.
...
This changes both the bottom-up and top-down propagation so that
globals and other external objects do not have to appear in every
function, but only in functions in which they are referenced or
they can be used to access something else that is referenced.
llvm-svn: 3170
2002-07-30 22:05:22 +00:00
Chris Lattner
3f47f1065b
* Standardize how analysis results/passes as printed with the print() virtual
...
methods
* Eliminate AnalysisID: Now it is just a typedef for const PassInfo*
* Simplify how AnalysisID's are initialized
* Eliminate Analysis/Writer.cpp/.h: incorporate printing functionality into
the analyses themselves.
llvm-svn: 3115
2002-07-27 01:12:15 +00:00
Chris Lattner
b934722f1b
* Add support for different "PassType's"
...
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses
llvm-svn: 3112
2002-07-26 21:12:44 +00:00
Chris Lattner
f155fe7c7b
Changes for GCC 3.1
...
llvm-svn: 3068
2002-07-24 22:33:50 +00:00
Chris Lattner
24bcbdd155
*** empty log message ***
...
llvm-svn: 3002
2002-07-23 17:52:38 +00:00
Chris Lattner
748999282f
Always create a shadow node for a store instruction, even if it's storing
...
a scalar value. Likewise for load instructions.
llvm-svn: 2990
2002-07-22 16:35:53 +00:00
Chris Lattner
01d2b4702f
Ignore some common varargs functions.
...
llvm-svn: 2973
2002-07-19 18:11:43 +00:00
Chris Lattner
5bda0e50a5
* Inline CopyFunctionCallsList
...
* Don't clone OrigCallList
* Rename removeDeadNodes -> removeTriviallyDeadNodes
* Implement new removeDeadNodes method
llvm-svn: 2970
2002-07-18 18:22:40 +00:00
Chris Lattner
556ab513cc
Rename removeDeadNodes to removeTriviallyDeadNodes
...
llvm-svn: 2969
2002-07-18 18:19:09 +00:00
Vikram S. Adve
9841c396cf
Add support for a top-down propagation pass:
...
-- Save a copy of the original call nodes in DSGraph before inlining bottom-up.
-- Also, save a list of the callers of each function in DSGraph.
llvm-svn: 2966
2002-07-18 16:13:52 +00:00
Vikram S. Adve
a6647796e3
Add support for a top-down propagation pass.
...
Each DSGraph now keeps a list of pending callers that have not
been inlined into the function represented by that graph.
It also keeps a copy of the original call nodes before the BU pass
eliminates some of them.
llvm-svn: 2965
2002-07-18 16:12:08 +00:00
Chris Lattner
da58a2a5ed
Implement cast nodes correctly.
...
llvm-svn: 2964
2002-07-18 15:54:42 +00:00
Chris Lattner
1cdccbde31
The graph is more accurate when I don't completely ignore the return value.
...
llvm-svn: 2952
2002-07-18 01:58:24 +00:00
Chris Lattner
9c49e62315
Lots of bug fixes, add BottomUpClosure, which has bugs, but is a start.
...
llvm-svn: 2945
2002-07-18 00:12:30 +00:00
Anand Shukla
1c8b99ff5a
added std:: to string
...
llvm-svn: 2915
2002-07-16 00:03:10 +00:00
Chris Lattner
f528333ecf
* Pass the DSGraph around instead of the Function to printing fns
...
* Print the globals list in the node
* Print the scalars in the scalar node
* Eliminate Scalar "label" edges in the graph
* Print fake edges lighter instead of dotted
llvm-svn: 2880
2002-07-11 20:33:32 +00:00
Chris Lattner
61d394e66f
* Nodes now keep track of any global variables in them
...
llvm-svn: 2879
2002-07-11 20:32:22 +00:00
Chris Lattner
809bd75ead
* Nodes now keep track of any global variables in them
...
* Only dead-node-eliminate nodes with no flags
* Don't merge scalars, only merge what they point to.
llvm-svn: 2878
2002-07-11 20:32:02 +00:00
Chris Lattner
5d62e136c5
New implementation of data structure analysis. Only local analysis has been
...
implemented so far.
llvm-svn: 2871
2002-07-10 22:38:08 +00:00
Chris Lattner
d00a93318e
Reimplement data structure analysis
...
llvm-svn: 2868
2002-07-10 22:36:26 +00:00
Chris Lattner
c645efd64c
Fix anand's last checkin
...
llvm-svn: 2804
2002-06-30 16:01:15 +00:00
Anand Shukla
3ab9ffd5b1
changes to make it compatible with 64bit gcc
...
llvm-svn: 2795
2002-06-25 21:18:19 +00:00
Anand Shukla
af8556bf5b
changes to make it compatible with 64bit gcc
...
llvm-svn: 2789
2002-06-25 20:35:19 +00:00
Chris Lattner
cee706572b
*** empty log message ***
...
llvm-svn: 2777
2002-06-25 16:12:52 +00:00
Chris Lattner
321a8cf4ba
Split ConstantVals.h into Constant.h and Constants.h
...
llvm-svn: 2378
2002-04-28 19:55:58 +00:00
Chris Lattner
e6d056f520
Fix signed/unsigned comparison warning
...
llvm-svn: 2350
2002-04-28 04:49:43 +00:00
Chris Lattner
3f7a62a960
Add support for tracking array allocations
...
llvm-svn: 2328
2002-04-27 02:28:41 +00:00
Chris Lattner
4e52f71340
Allow the inline limit to be modified on the commandline for debugging
...
llvm-svn: 2327
2002-04-27 02:27:48 +00:00
Chris Lattner
bde9202648
Print argument scalars as ellipses instead of boxes
...
llvm-svn: 2293
2002-04-18 18:14:19 +00:00
Chris Lattner
a4add093c6
Inline indirect function calls that are only capable of calling one function
...
llvm-svn: 2275
2002-04-17 03:42:51 +00:00
Chris Lattner
59927296e4
Make data structure acurately get ALL edges, even loads of null fields of
...
nodes that are not shadow nodes
This fixes em3d to be _correct_ if not optimial
llvm-svn: 2274
2002-04-17 03:24:59 +00:00
Chris Lattner
0cda7182ba
* Remove the concept of a critical shadow node
...
* Make the function pointer argument explicit for a call nodes
* Eliminate unreachable global values
* Merge call nodes that are identical
llvm-svn: 2266
2002-04-16 20:39:59 +00:00
Chris Lattner
11f9ff83ec
* Eliminate ArgDSNode's completely, now rely on scalar map
...
* Fold call nodes that are indistinguishable for each other. This is a big
win for external functions like sqrt, which would multiply dramatically
before.
* Global nodes with no edges to or from them are now eliminated from the graph.
llvm-svn: 2257
2002-04-16 03:44:03 +00:00
Chris Lattner
5e12c7caf5
Move FunctionArgument out of iOther.h into Argument.h and rename class to
...
be 'Argument' instead of FunctionArgument.
llvm-svn: 2216
2002-04-09 19:48:49 +00:00
Chris Lattner
b2038512b2
Add explicit #includes of Function.h to make up for the removed #include
...
in iOther.h
llvm-svn: 2209
2002-04-09 19:08:28 +00:00
Chris Lattner
7ae20d642d
Add #includes to make up for #includes pruned out of header files.
...
llvm-svn: 2207
2002-04-09 18:37:46 +00:00
Chris Lattner
0962b63d7c
Play around with #includes
...
llvm-svn: 2174
2002-04-08 21:58:53 +00:00
Chris Lattner
5cbfde5744
Call nodes are never equivalent
...
Shadow nodes are never critical.
llvm-svn: 2102
2002-04-04 19:21:51 +00:00
Chris Lattner
d4c7ce8d78
Add hack to get timing of analysis
...
llvm-svn: 2101
2002-04-04 19:21:27 +00:00
Chris Lattner
3b604e846a
* Eliminate commented out code
...
* Do not demand a shadow node when resolving
* Raise arbitrary inline limit
llvm-svn: 2100
2002-04-04 19:21:06 +00:00
Chris Lattner
19689af3bb
Support resolving function arguments/return values to pointers that index
...
into other objects.
llvm-svn: 2094
2002-04-01 22:20:48 +00:00
Chris Lattner
62756e4208
Avoid incorrectly adding null values to the scalar map!
...
llvm-svn: 2085
2002-04-01 00:45:09 +00:00
Chris Lattner
e66e651b68
Critical shadow nodes no do not know their parent explictly.
...
llvm-svn: 2084
2002-04-01 00:15:30 +00:00
Chris Lattner
61f6065cef
Minor cleanups (use dyn_cast instead of testing manually)
...
Shadow nodes now don't explicitly know their parent.
llvm-svn: 2083
2002-04-01 00:14:41 +00:00
Chris Lattner
a68c92a3d4
Allow merging of identical call nodes. Make the shadow node pointed to
...
by the call node noncritical before the call is destroyed.
llvm-svn: 2082
2002-04-01 00:13:56 +00:00
Chris Lattner
f9097b54be
Increase limit for perimeter
...
llvm-svn: 2081
2002-04-01 00:12:58 +00:00
Chris Lattner
42145d8a25
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.
llvm-svn: 2079
2002-03-31 19:57:44 +00:00
Chris Lattner
8528806b33
* Move the isEquivalentTo implementations here. They can probably be put
...
someplace nicer in the file though.
* Add new dump method for debugging
llvm-svn: 2064
2002-03-31 07:16:08 +00:00
Chris Lattner
d2c39a02f7
Print out the instruction instead of just the address!
...
llvm-svn: 2063
2002-03-31 07:15:20 +00:00
Chris Lattner
aba1ef6fc9
* 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
llvm-svn: 2062
2002-03-31 07:14:52 +00:00
Chris Lattner
f1a2a9c168
* 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!
llvm-svn: 2061
2002-03-31 07:13:27 +00:00
Chris Lattner
cab0ce8244
Implement getEscapingAllocations & getNonEscapingAllocations
...
llvm-svn: 2021
2002-03-28 19:33:00 +00:00
Chris Lattner
513ecd7256
* Rename UnlinkUndistinguishableShadowNodes & RemoveUnreachableShadowNodes
...
to reflect that they can eliminate arbitrary nodes.
* Rename the ShadowNodeEliminate.cpp file to EliminateNodes.cpp for the
same reason
llvm-svn: 2020
2002-03-28 19:16:48 +00:00
Chris Lattner
fa67ad938c
Ooops, I did such a great job pruning nodes, that I accidentally deleted
...
ALL allocation nodes... hrm... bad.
llvm-svn: 2018
2002-03-28 18:38:38 +00:00
Chris Lattner
55186e7abf
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
llvm-svn: 2010
2002-03-28 17:56:03 +00:00
Chris Lattner
d771725ed1
* 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.
llvm-svn: 2004
2002-03-27 19:48:03 +00:00
Chris Lattner
4c6e9cda3f
* Implement DSNode::removeAllIncomingEdges
...
* Implement Critical Shadow node handling
* Implement routines to determine whether an allocation node is a malloc
or alloca
llvm-svn: 2003
2002-03-27 19:46:05 +00:00
Chris Lattner
a16c85b43d
* Add critical node support
...
* Optimize graph after building it. This should be unneccesary in the future
llvm-svn: 2002
2002-03-27 19:45:12 +00:00
Chris Lattner
9aff5a8047
* Destroy alloca nodes when a graph gets inlined
...
* Add links to all subtrees when a shadow node gets resolved
* Add critical node handling
llvm-svn: 2001
2002-03-27 19:44:33 +00:00
Chris Lattner
2a3d6c83ff
* Optimizers return true on change
...
* Implement indistinguishable shadow node elimination
llvm-svn: 1999
2002-03-27 00:55:13 +00:00
Chris Lattner
ae0192e2f6
Fix long line
...
llvm-svn: 1998
2002-03-27 00:54:31 +00:00
Chris Lattner
8a44f81684
* Because of optimization, the shadow nodes between arguments might get
...
removed. Check to see if they are there.
* Repeat optimizations while changing
llvm-svn: 1997
2002-03-27 00:53:57 +00:00
Chris Lattner
d5b115e687
Initial checkin of Datastructure analysis.
...
Has bugs, but shouldn't crash in theory.
llvm-svn: 1994
2002-03-26 22:39:06 +00:00