Commit Graph

417 Commits

Author SHA1 Message Date
Misha Brukman
f4445dfcb7 'graph' is spelled without a 'c'.
Also added Statistic counters for NoAlias and MayAlias.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4972 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-12 05:34:10 +00:00
Chris Lattner
3fc46450b7 Remove #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4968 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-12 03:47:27 +00:00
Vikram S. Adve
e12c74c07b This file implements a pass that automatically parallelizes a program,
using the Cilk multi-threaded runtime system to execute parallel code.
The current version inserts too many sync() operations in the program
because it does not attempt to optimize their placement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4962 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-10 00:43:34 +00:00
Vikram S. Adve
0d4f76637d Iterator that enumerates the ProgramDependenceGraph (PDG) for a function,
i.e., enumerates all data and control dependences for the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4958 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-08 14:13:19 +00:00
Vikram S. Adve
96b21c1054 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4957 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-08 13:26:29 +00:00
Chris Lattner
a1af8bd72b Add total instruction, bb, & function counts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4954 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-07 23:24:24 +00:00
Vikram S. Adve
bac0622ef9 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4948 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-06 21:17:10 +00:00
Vikram S. Adve
2b7a92c72f 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().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4947 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-06 21:15:21 +00:00
Vikram S. Adve
c102cb7359 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4933 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-05 17:17:26 +00:00
Chris Lattner
149a5203a9 Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4886 91177308-0d34-0410-b5e6-96231b3b80d8
2002-12-03 19:40:16 +00:00
Vikram S. Adve
61ff02982f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4836 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-27 17:41:13 +00:00
Vikram S. Adve
9a96428297 (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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4833 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-27 17:37:46 +00:00
Vikram S. Adve
e31267dd9a Keep global nodes in each DS Graph (by forcing them to be marked live).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4831 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-25 18:21:25 +00:00
Chris Lattner
1855292172 Add peak memory usage measurement stuff
Add structure padding optimizations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4749 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 21:44:46 +00:00
Chris Lattner
4fe346184a Add peak memory usage support
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4748 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 21:44:19 +00:00
Chris Lattner
49a1ed07ab Add stats
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4747 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-18 21:42:45 +00:00
Chris Lattner
ed806bf9fc Add hack to only consider indirect calls indirect if they do more than cast
their source function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4723 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:17:12 +00:00
Chris Lattner
ae5f603665 Add MaxSCC statistics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4722 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:16:28 +00:00
Chris Lattner
db85e389ae Count CallInsts correctly, remove unneccesary initializers
S: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4721 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-17 22:15:40 +00:00
Dinakar Dhurjati
e555460e4e Gives the count for various instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4706 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-13 18:22:13 +00:00
Vikram S. Adve
586aa3c801 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4705 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-13 15:41:00 +00:00
Chris Lattner
5f1f2c6162 Inline graphs from outside the SCC into the SCC before SCC resolution starts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4701 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-12 15:58:08 +00:00
Chris Lattner
5190ce8374 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4699 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-12 07:20:45 +00:00
Chris Lattner
3ba8893af5 Fix bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4697 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 22:23:56 +00:00
Chris Lattner
0ecc42619f Handle a mismatch between # function args and call site args
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4696 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 21:36:05 +00:00
Chris Lattner
e425844d8c Elimiante calls to a node with nothing in it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4695 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 21:35:38 +00:00
Chris Lattner
a9c9c0216e Complete rewrite of BU code to use Tarjan's SCC finding algorithm to drive
the algorithm instead of hand coded depth first iteration


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4694 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 21:35:13 +00:00
Chris Lattner
e71ffc291c Mark stuff reachable by _AUX_ calls as incomplete in the BU graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4690 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 03:36:55 +00:00
Chris Lattner
8a5db46967 Fix infinite loop in the BU algorithm. Unfortunately this dies a serious
death when handling moderately sized SCC's, but what can you do


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4689 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 00:01:34 +00:00
Chris Lattner
6052594209 Print the right call set size
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4688 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 00:01:02 +00:00
Chris Lattner
998c49c247 Use call site mergeWith method to simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4687 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-11 00:00:46 +00:00
Chris Lattner
d11e954f08 Fix a bug that could trigger when varargs call sites had non-matching number of arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4683 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 07:46:08 +00:00
Chris Lattner
aa8146f5c4 * 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4681 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 06:59:55 +00:00
Chris Lattner
4f7815f684 Honor the shouldPrintAuxCalls flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4678 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 06:53:59 +00:00
Chris Lattner
2a06886759 Initialize PrintAuxCalls member
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4677 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 06:53:38 +00:00
Chris Lattner
a1079051d8 * 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4675 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-10 06:52:47 +00:00
Chris Lattner
f40f0a39bd 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4666 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 22:07:02 +00:00
Chris Lattner
dd398486ca Remove obsolete code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4665 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:41:44 +00:00
Chris Lattner
f76e754c2e Fix logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4664 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:40:58 +00:00
Chris Lattner
aa0b468f6d Add globals graphs to all three passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4663 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:12:07 +00:00
Chris Lattner
7900ed146f Move maskNodeTypes to header file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4661 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:02:26 +00:00
Chris Lattner
65f2897f2c Clean up DSGraph::removeDeadNodes interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4660 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 21:00:49 +00:00
Chris Lattner
96517253a1 Make removeTriviallyDeadNodes a private interface of DSGraph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4659 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 20:55:24 +00:00
Chris Lattner
2cfbaaf3b9 Don't put constants into the scalar map!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4657 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 20:14:03 +00:00
Chris Lattner
2e4f9bf86e Add initial support for a globals graph
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4656 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 20:01:01 +00:00
Chris Lattner
d888893a54 Tighten up array handling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4655 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 19:25:27 +00:00
Chris Lattner
0779ba6c47 #include Datastructure.h first
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4654 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 19:25:10 +00:00
Chris Lattner
0006bd7520 Fix warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4649 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 00:49:43 +00:00
Chris Lattner
bf10f05bf7 Fix warning & release build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4648 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-09 00:49:05 +00:00
Chris Lattner
23f83dce3f 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4643 91177308-0d34-0410-b5e6-96231b3b80d8
2002-11-08 22:49:57 +00:00