llvm-6502/lib/Analysis
Chris Lattner be577659d3 Step #1 to giving Callgraph some sane invariants. The problems with callgraph
stem from the fact that we have two types of passes that need to update it:

1. callgraphscc and module passes that are explicitly aware of it
2. Functionpasses (and loop passes etc) that are interlaced with CGSCC passes
   by the CGSCC Passmgr.

In the case of #1, we can reasonably expect the passes to update the call
graph just like any analysis.  However, functionpasses are not and generally
should not be CG aware.  This has caused us no end of problems, so this takes
a new approach.  Logically, the CGSCC Pass manager can rescan every function 
after it runs a function pass over it to see if the functionpass made any 
updates to the IR that affect the callgraph.  This allows it to catch new calls
introduced by the functionpass.

In practice, doing this would be slow.  This implementation keeps track of
whether or not the current scc is dirtied by a function pass, and, if so, 
delays updating the callgraph until it is actually needed again.  This was
we avoid extraneous rescans, but we still have good invariants when the
callgraph is needed.

Step #2 of the "give Callgraph some sane invariants" is to change CallGraphNode
to use a CallBackVH for the callsite entry of the CallGraphNode.  This way
we can immediately remove entries from the callgraph when a FunctionPass is
active instead of having dangling pointers.  The current pass tries to tolerate
these dangling pointers, but it is just an evil hack.

This is related to PR3601/4835/4029.  This also reverts r80541, a hack working
around the sad lack of invariants.





git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-31 07:23:46 +00:00
..
IPA Step #1 to giving Callgraph some sane invariants. The problems with callgraph 2009-08-31 07:23:46 +00:00
AliasAnalysis.cpp Global Aliases are not identifiable objects. 2009-08-27 17:52:56 +00:00
AliasAnalysisCounter.cpp default count-aa to -print-all. The whole reason to use count-aa is 2009-08-30 04:25:40 +00:00
AliasAnalysisEvaluator.cpp Fix a missing newline, now that Value's operator<< doesn't add one of its own. 2009-08-26 14:34:12 +00:00
AliasDebugger.cpp Refactor my previous change to maintain the distinction between AliasAnalysis and BasicAliasAnalysis. This involves some wider changes because it 2009-02-05 23:36:27 +00:00
AliasSetTracker.cpp eliminate the std::ostream form of WriteAsOperand and update clients. 2009-08-23 05:17:37 +00:00
Analysis.cpp Tidy #includes. 2009-08-11 16:02:12 +00:00
BasicAliasAnalysis.cpp Use stripPointerCasts instead of doing the same manually. 2009-08-27 18:02:03 +00:00
CaptureTracking.cpp Push LLVMContexts through the IntegerType APIs. 2009-08-13 21:58:54 +00:00
CFGPrinter.cpp Make LLVM command-line tools overwrite their output files without -f. 2009-08-25 15:34:52 +00:00
CMakeLists.txt Unbreak CMake build 2009-08-26 16:33:57 +00:00
ConstantFolding.cpp Don't assume that the operand of an inttoptr is an pointer-sized integer. 2009-08-21 18:27:26 +00:00
DbgInfoPrinter.cpp Reapply 79977. 2009-08-28 23:24:31 +00:00
DebugInfo.cpp Reapply 79977. 2009-08-28 23:24:31 +00:00
InstCount.cpp Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00
Interval.cpp Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00
IntervalPartition.cpp Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00
IVUsers.cpp remove a few dead insertion methods. 2009-08-24 02:39:26 +00:00
LibCallAliasAnalysis.cpp LibCallAliasAnalysis doesn't use TargetData. 2009-07-31 20:56:29 +00:00
LibCallSemantics.cpp Remove Value::getNameLen 2009-07-26 08:34:35 +00:00
LiveValues.cpp Delete an obsolete sentance from a comment. 2009-05-31 16:18:57 +00:00
LoopDependenceAnalysis.cpp remove a few dead insertion methods. 2009-08-24 02:39:26 +00:00
LoopInfo.cpp remove uses of llvm/Support/Streams.h. 2009-08-23 07:33:14 +00:00
LoopPass.cpp convert LoopInfo.h and GraphWriter.h to use raw_ostream 2009-08-23 07:19:13 +00:00
LoopVR.cpp Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00
Makefile Removed trailing whitespace from Makefiles. 2009-01-09 16:44:42 +00:00
MemoryDependenceAnalysis.cpp Make TargetData optional in MemoryDependenceAnalysis. 2009-07-31 20:53:12 +00:00
PointerTracking.cpp remove a few dead insertion methods. 2009-08-24 02:39:26 +00:00
PostDominators.cpp Change Pass::print to take a raw ostream instead of std::ostream, 2009-08-23 06:03:38 +00:00
ProfileEstimatorPass.cpp Implemented comments from Daniel Dunbar. 2009-08-26 15:13:44 +00:00
ProfileInfo.cpp Move ProfileInfo::Edge's operator<< out of line. Among other benefits, 2009-08-26 15:56:38 +00:00
ProfileInfoLoader.cpp Read profile files as binary as proposed in 2009-08-25 12:53:27 +00:00
ProfileInfoLoaderPass.cpp remove uses of llvm/Support/Streams.h. 2009-08-23 07:33:14 +00:00
ScalarEvolution.cpp Don't assume that two identical instructions that read from memory 2009-08-25 17:56:57 +00:00
ScalarEvolutionAliasAnalysis.cpp Add some comments. 2009-08-29 23:36:57 +00:00
ScalarEvolutionExpander.cpp Various comment and whitespace cleanups. 2009-08-20 16:42:55 +00:00
SparsePropagation.cpp eliminate the "Value" printing methods that print to a std::ostream. 2009-08-23 04:37:46 +00:00
Trace.cpp eliminate the "Value" printing methods that print to a std::ostream. 2009-08-23 04:37:46 +00:00
ValueTracking.cpp Handle TargetData with const. 2009-08-27 17:51:25 +00:00