1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 13:33:37 +02:00
Commit Graph

648 Commits

Author SHA1 Message Date
Chris Lattner
e1d4fb3c2c Fix bug: LICM/2003-02-27-PreheaderProblem.ll
There may be a single outside predecessor and
still need a new loop-preheader if the predecessor has multiple
successors.

llvm-svn: 5656
2003-02-27 21:51:38 +00:00
Chris Lattner
ac72aab6e7 - LoopInfo now calculates and tracks loop exit blocks
llvm-svn: 5650
2003-02-27 00:38:34 +00:00
Chris Lattner
5baf8bb966 Make the aliassettracker much more precise by actually tracking size
information for various accesses.  What a concept.

llvm-svn: 5647
2003-02-26 22:11:00 +00:00
Chris Lattner
933b11a154 Fix bug: BasicAA/2003-02-26-AccessSizeTest.ll
llvm-svn: 5645
2003-02-26 21:57:23 +00:00
Chris Lattner
e923b037b7 Fix several bugs in basic-aa
llvm-svn: 5643
2003-02-26 21:28:49 +00:00
Chris Lattner
4e622afb23 Add new -no-aa implementation
llvm-svn: 5641
2003-02-26 19:57:10 +00:00
Chris Lattner
721f9fc770 Move BasicAA pass out to it's own header file
llvm-svn: 5640
2003-02-26 19:41:54 +00:00
Chris Lattner
4162adcfee Adjust to implement new AA interface
llvm-svn: 5638
2003-02-26 19:29:36 +00:00
Chris Lattner
4d57299049 Adjust to new AA interface
llvm-svn: 5637
2003-02-26 19:29:16 +00:00
Chris Lattner
92a8816086 Convert to work with new AliasAnalysis interface by conservatively assuming all pointers are arbitrarily large accesses
llvm-svn: 5636
2003-02-26 19:28:57 +00:00
Chris Lattner
5afbabc83b Calculate and pass load sizes to the alias analysis infrastructure
llvm-svn: 5635
2003-02-26 19:27:35 +00:00
Chris Lattner
d67ff79f57 Adjust to new AA interface
Add tracking for Mod/Ref info

llvm-svn: 5634
2003-02-26 19:27:05 +00:00
Chris Lattner
a84b1da40f - Checkin of the alias analysis work:
* Takes into account the size of the memory reference to determine aliasing.
    * Expose mod/ref information in a more consistent way
    * BasicAA can now disambiguate A[i][1] and A[j][2] for conservative request
      sizes

llvm-svn: 5633
2003-02-26 19:26:51 +00:00
Chris Lattner
f2009dbddb This is a substantial rewrite of the AliasSetTracker class which now uses
a union-find based algorithm, is significantly faster, and is more general.
It will also scale to handle call instructions correctly, which is a nice
added bonus.

This includes a new pass -print-alias-sets which can be used to show how
alias sets are formed for a particular analysis.

llvm-svn: 5619
2003-02-24 20:37:56 +00:00
Chris Lattner
4c2012352d Dramatically simplify building of natural loops and fix a bug where the BBMap
was not correctly computed.

llvm-svn: 5606
2003-02-22 21:33:11 +00:00
Chris Lattner
1fc8307d2a Fix the requisite bug that I introduced
llvm-svn: 5605
2003-02-20 00:28:00 +00:00
Chris Lattner
92bf8c2754 Fix 80 character formatting
llvm-svn: 5604
2003-02-20 00:18:07 +00:00
Chris Lattner
97d323caea Fix bug: 2003-02-19-LoopInfoNestingBug.ll
llvm-svn: 5603
2003-02-20 00:17:17 +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
e3c6f245cd Rename options
llvm-svn: 5537
2003-02-11 23:12:09 +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
59a935f381 Allow printing of various types of alias analysis results
llvm-svn: 5520
2003-02-09 20:40:13 +00:00
Chris Lattner
471d708ae0 Implement knowledge in BasicAA that &A->field != &A and (P+1) != P
llvm-svn: 5519
2003-02-09 19:38:11 +00:00
Chris Lattner
f3627e3ee3 - Fix BasicAA to correctly detect the non-aliasness of A[1] & A[2]
llvm-svn: 5518
2003-02-09 19:27:21 +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
31e95435b8 Fix division by zero problem
llvm-svn: 5509
2003-02-08 23:04:50 +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
2f75411136 Allow counting multiple passes, and print the pass name counted
llvm-svn: 5504
2003-02-07 20:39:17 +00:00
Chris Lattner
ed61b8ddef New general purpose alias analysis result auditor
llvm-svn: 5503
2003-02-07 19:46:03 +00:00
Chris Lattner
4c58f5252e Add a summary
llvm-svn: 5500
2003-02-06 22:06:08 +00:00
Chris Lattner
d4990fe1be Simple N^2 alias anlysis accuracy checker
llvm-svn: 5498
2003-02-06 21:29:49 +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
47929dacd2 Add statistics to basicAA pass
llvm-svn: 5480
2003-02-03 21:16:17 +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
77e422543e * Eliminate boolean arguments in favor of using enums
llvm-svn: 5420
2003-01-23 22:06:33 +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
Chris Lattner
07b0e49989 Rename llvm/Analysis/LiveVar/FunctionLiveVarInfo.h -> llvm/CodeGen/FunctionLiveVarInfo.h
llvm-svn: 5284
2003-01-14 23:05:08 +00:00
Chris Lattner
57b5e8891e Move llvm/Analysis/LiveVar/ValueSet.h to CodeGen/ValueSet.h
llvm-svn: 5282
2003-01-14 22:56:37 +00:00
Chris Lattner
4093c3b83f Move annotations to support library
llvm-svn: 5270
2003-01-14 21:31:39 +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
Chris Lattner
8d4b4b020e Remove #includes
llvm-svn: 4968
2002-12-12 03:47:27 +00:00
Vikram S. Adve
c9617fde54 Iterator that enumerates the ProgramDependenceGraph (PDG) for a function,
i.e., enumerates all data and control dependences for the function.

llvm-svn: 4958
2002-12-08 14:13:19 +00:00
Vikram S. Adve
90bc3110b6 An explicit representation of dependence graphs, and a pass that
computes a dependence graph for data dependences on memory locations
using interprocedural Mod/Ref information.

llvm-svn: 4957
2002-12-08 13:26:29 +00:00
Chris Lattner
5f4d7d2801 Add total instruction, bb, & function counts
llvm-svn: 4954
2002-12-07 23:24:24 +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
Chris Lattner
18b9a192e1 Simplify code
llvm-svn: 4886
2002-12-03 19:40:16 +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
8788221a72 (1) Bug fix that was causing nodes with dangling references to be freed.
We run removeDeadNodes() on the TD graph up front before using it.
(2) Major enhancement to printing of results: now we list the actual objects
    that are mod/ref instead of just printing the bit vectors.
Also an important bug fix in TDDataStructures pass (no change here):
clear Mod/Ref bits of callers before inlining into a function.

llvm-svn: 4833
2002-11-27 17:37:46 +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
Chris Lattner
acfc11664a Count CallInsts correctly, remove unneccesary initializers
S: ----------------------------------------------------------------------

llvm-svn: 4721
2002-11-17 22:15:40 +00:00
Dinakar Dhurjati
9da9f0534e Gives the count for various instructions.
llvm-svn: 4706
2002-11-13 18:22:13 +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
3b303e5ab8 Fix bug
llvm-svn: 4697
2002-11-11 22:23:56 +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
0141841bc4 Fix warning
llvm-svn: 4649
2002-11-09 00:49:43 +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
8cd66f734f Reduce amount of work needed to compute ip/modref
llvm-svn: 4637
2002-11-08 22:17:01 +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
30e3d26423 Fix IPModRef to use new DS interface
llvm-svn: 4628
2002-11-08 19:13:14 +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
f13f9c585e Implement ResolveCallSiteModRefInfo for IPModRef. computeModRef is not yet done though!
llvm-svn: 4602
2002-11-07 07:12:23 +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
a0d26350c6 Fix problem with dangling referrers
llvm-svn: 4595
2002-11-07 05:00:35 +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
9870fb032e Allow the ResolveCallSiteModRefInfo method to return a mapping of nodes,
implement the mod/ref bit masking

llvm-svn: 4578
2002-11-06 19:59:33 +00:00
Chris Lattner
f7e839f435 Add a stub to implement the context sensitive mod/ref info for call sites
llvm-svn: 4577
2002-11-06 19:38:43 +00:00
Chris Lattner
00de4338dc Give a back pointer to the IPModRef object to the FunctionModRefInfo object
llvm-svn: 4576
2002-11-06 19:07:13 +00:00
Chris Lattner
0e158e64ff Remove a couple of #includes, move some code from .h file
llvm-svn: 4575
2002-11-06 18:38:18 +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
Vikram S. Adve
201d4e3639 Make query operations non-const to allow demand-driven analyses.
llvm-svn: 4569
2002-11-06 17:17:55 +00:00
Vikram S. Adve
2a1c1171e7 An interprocedural analysis pass that computes flow-insensitive
IP Mod and Ref information for every function and every call site.

llvm-svn: 4567
2002-11-06 17:02:03 +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
Vikram S. Adve
b7afa2004a Simple passes that print out SCCs in the CFGs or in the CallGraph of a module.
llvm-svn: 4532
2002-11-04 14:20:22 +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
aaf17e11b1 Allow the call graph to be called from analyze naturally with print implemented
llvm-svn: 4517
2002-11-04 00:21:19 +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
d4c9998d7a Use new isCommutative interface, which gives us SetEQ and SetNE for free.
Thanks fly out to Casey Carter for this fix.

llvm-svn: 4460
2002-10-31 04:20:07 +00:00
Misha Brukman
c9c721edf0 Fix spelling of `propagate'.
llvm-svn: 4423
2002-10-29 23:06:16 +00:00
Chris Lattner
d6e5d73aa8 Eliminate uses of MachineBasicBlock::get
llvm-svn: 4340
2002-10-28 18:01:21 +00:00
Chris Lattner
b8c6acfbc0 Rename MachineCodeForBasicBlock to MachineBasicBlock
llvm-svn: 4318
2002-10-28 01:41:47 +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