Commit Graph

41 Commits

Author SHA1 Message Date
Chris Lattner 3b83d797d6 * 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 715a3a3b5c 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 4b1be35569 Add globals graphs to all three passes
llvm-svn: 4663
2002-11-09 21:12:07 +00:00
Chris Lattner 380d1ad4ab Clean up DSGraph::removeDeadNodes interface
llvm-svn: 4660
2002-11-09 21:00:49 +00:00
Chris Lattner e703c52b20 Make removeTriviallyDeadNodes a private interface of DSGraph
llvm-svn: 4659
2002-11-09 20:55:24 +00:00
Chris Lattner 09a21dc2f5 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 639898c9bb Remove gunk used by broken TD pass
llvm-svn: 4632
2002-11-08 21:25:24 +00:00
Chris Lattner 5e865cdbe2 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 df307e6fd0 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 ca03c3b516 Rename DataStructureAnalysis namespace to DS
llvm-svn: 4596
2002-11-07 05:20:53 +00:00
Chris Lattner 230f6926b0 Delete "StripScalars" argument to cloneInto method
llvm-svn: 4560
2002-11-06 06:16:30 +00:00
Chris Lattner cd691d2047 Give a better error message in an unhandled case
llvm-svn: 4521
2002-11-04 02:29:15 +00:00
Chris Lattner a20fabc7ec Rename ValueMap to ScalarMap
llvm-svn: 4516
2002-11-03 21:27:48 +00:00
Chris Lattner 364e6e82fd Oops, this was not meant to be checked in
llvm-svn: 4489
2002-11-02 00:26:32 +00:00
Chris Lattner a7b0d4eb08 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 8c68d869e5 Add a fixme
llvm-svn: 4479
2002-10-31 23:24:00 +00:00
Chris Lattner d90e74ae13 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 155fffd350 Delete unused arguments to DSGraph::cloneInto method
llvm-svn: 4253
2002-10-21 19:50:29 +00:00
Chris Lattner f76087336f - 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 5c3ce31e1f - 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 fd16b72fc7 Split some long lines
llvm-svn: 4237
2002-10-20 22:11:17 +00:00
Vikram S. Adve e85319693e 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 28bef38c56 Avoid extra callSite copy
llvm-svn: 4232
2002-10-20 20:32:13 +00:00
Vikram S. Adve dc9e142686 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 b182216df8 * 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 981c92a9e2 Remove obsolete code
llvm-svn: 4218
2002-10-17 04:58:10 +00:00
Chris Lattner a1cfcf4dff * 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 9df1cf3034 Prune function nodes that are no longer referenced due to inlining
llvm-svn: 4036
2002-10-03 21:55:28 +00:00
Chris Lattner c9c681e4f5 Reimplement/port the Bottom Up Closure pass
llvm-svn: 4031
2002-10-03 20:38:41 +00:00
Chris Lattner 193e6924ca 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 c869ecbe42 - Do not expose ::ID from any of the analyses anymore.
llvm-svn: 3416
2002-08-21 17:09:45 +00:00
Chris Lattner b3ce9fc449 Minor changes to DEBUG()'s
llvm-svn: 3261
2002-08-07 21:41:11 +00:00
Chris Lattner c70601cd67 Changes to be GCC3.1 friendly
llvm-svn: 3186
2002-07-31 19:32:12 +00:00
Vikram S. Adve 0d66177bc8 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 96a0dfa33e * 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 a2c0985980 * 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 4fcf153ffd Changes for GCC 3.1
llvm-svn: 3068
2002-07-24 22:33:50 +00:00
Chris Lattner 20695cba3c Ignore some common varargs functions.
llvm-svn: 2973
2002-07-19 18:11:43 +00:00
Vikram S. Adve 94c8e5da41 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
Chris Lattner 140153f357 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 4c0d620a82 Lots of bug fixes, add BottomUpClosure, which has bugs, but is a start.
llvm-svn: 2945
2002-07-18 00:12:30 +00:00