summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraph.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [PM/AA] Remove the last relics of the separate IPA library from LLVM,Chandler Carruth2015-08-181-309/+0
| | | | | | | | | | | | | | | | | | | | | folding the code into the main Analysis library. There already wasn't much of a distinction between Analysis and IPA. A number of the passes in Analysis are actually IPA passes, and there doesn't seem to be any advantage to separating them. Moreover, it makes it hard to have interactions between analyses that are both local and interprocedural. In trying to make the Alias Analysis infrastructure work with the new pass manager, it becomes particularly awkward to navigate this split. I've tried to find all the places where we referenced this, but I may have missed some. I have also adjusted the C API to continue to be equivalently functional after this change. Differential Revision: http://reviews.llvm.org/D12075 llvm-svn: 245318
* Revert r244127: [PM] Remove a failed attempt to port the CallGraphChandler Carruth2015-08-161-0/+15
| | | | | | | | | | | | | analysis ... It turns out that we *do* need the old CallGraph ported to the new pass manager. There are times where this model of a call graph is really superior to the one provided by the LazyCallGraph. For example, GlobalsModRef very specifically needs the model provided by CallGraph. While here, I've tried to make the move semantics actually work. =] llvm-svn: 245170
* [PM] Remove a failed attempt to port the CallGraph analysis to the newChandler Carruth2015-08-051-6/+0
| | | | | | | | | | | | | pass manager. This never worked, and won't ever work. It was actually why I ended up building the LazyCallGraph set of code which is more more effectively wired up to the new pass manager. This accidentally got committed when I was trying to land a cleanup of the code organization in the other parts of this file. =[ My bad, but fortunately Dave was keen eyed enough to spot that this code couldn't possibly work. =] llvm-svn: 244127
* -Wdeprecated cleanup: Make CallGraph movable by default by using unique_ptr ↵David Blaikie2015-08-051-13/+11
| | | | | | | | | | members rather than raw pointers. The only place that tries to return a CallGraph by value (CallGraphAnalysis::run) doesn't seem to be used right now, but it's a reasonable bit of cleanup anyway. llvm-svn: 244122
* [CallGraph] Given -print-callgraph a stable printing order.Sanjoy Das2015-06-191-2/+20
| | | | | | | | | | | | | | | | Summary: Since FunctionMap has llvm::Function pointers as keys, the order in which the traversal happens can differ from run to run, causing spurious FileCheck failures. Have CallGraph::print sort the CallGraphNodes by name before printing them. Reviewers: bogner, chandlerc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10575 llvm-svn: 240191
* [CallGraph] Teach the CallGraph about non-leaf intrinsics.Sanjoy Das2015-06-181-1/+3
| | | | | | | | | | | | | | | | | | | | Summary: Currently intrinsics don't affect the creation of the call graph. This is not accurate with respect to statepoint and patchpoint intrinsics -- these do call (or invoke) LLVM level functions. This change fixes this inconsistency by adding a call to the external node for call sites that call these non-leaf intrinsics. This coupled with the fact that these intrinsics also escape the function pointer they call gives us a conservatively correct call graph. Reviewers: reames, chandlerc, atrick, pgavlin Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D10526 llvm-svn: 240039
* Rangify for loops, NFC.Yaron Keren2015-06-121-8/+6
| | | | llvm-svn: 239596
* Remove Support/IncludeFile.h and its only user. This is actively harmful, sinceRichard Smith2014-08-071-3/+0
| | | | | | | | | | | | | it breaks the modules builds (where CallGraph.h can be quite reasonably transitively included by an unimported portion of a module, and CallGraph.cpp not linked in), and appears to have been entirely redundant since PR780 was fixed back in 2008. If this breaks anything, please revert; I have only tested this with a single configuration, and it's possible that this is still somehow fixing something (though I doubt it, since no other similar file uses this mechanism any more). llvm-svn: 215142
* Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ↵David Blaikie2014-07-191-1/+1
| | | | | | | | | | | ".reset()" It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave it up to authors to pick which they prefer for now. If we want to discuss standardizing on one or the other, we can do that at some point in the future. llvm-svn: 213438
* [C++] Use 'nullptr'.Craig Topper2014-04-281-1/+1
| | | | llvm-svn: 207394
* [C++] Use 'nullptr'.Craig Topper2014-04-241-5/+5
| | | | llvm-svn: 207083
* [Modules] Move CallSite into the IR library where it belogs. It isChandler Carruth2014-03-041-1/+1
| | | | | | | abstracting between a CallInst and an InvokeInst, both of which are IR concepts. llvm-svn: 202816
* [PM] Add a definition for the static PassID in the CallGraphAnalysis.Chandler Carruth2014-01-051-0/+6
| | | | | | | Missed this when adding the skeleton analysis. Caught by a build break in the next patch I'm working on when trying to use the analysis. llvm-svn: 198556
* [PM] Split the CallGraph out from the ModulePass which creates theChandler Carruth2013-11-261-67/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CallGraph. This makes the CallGraph a totally generic analysis object that is the container for the graph data structure and the primary interface for querying and manipulating it. The pass logic is separated into its own class. For compatibility reasons, the pass provides wrapper methods for most of the methods on CallGraph -- they all just forward. This will allow the new pass manager infrastructure to provide its own analysis pass that constructs the same CallGraph object and makes it available. The idea is that in the new pass manager, the analysis pass's 'run' method returns a concrete analysis 'result'. Here, that result is a 'CallGraph'. The 'run' method will typically do only minimal work, deferring much of the work into the implementation of the result object in order to be lazy about computing things, but when (like DomTree) there is *some* up-front computation, the analysis does it prior to handing the result back to the querying pass. I know some of this is fairly ugly. I'm happy to change it around if folks can suggest a cleaner interim state, but there is going to be some amount of unavoidable ugliness during the transition period. The good thing is that this is very limited and will naturally go away when the old pass infrastructure goes away. It won't hang around to bother us later. Next up is the initial new-PM-style call graph analysis. =] llvm-svn: 195722
* [PM] Rename the 'Mod' member to the more idiomatic 'M'. No functionalityChandler Carruth2013-11-261-3/+3
| | | | | | changed. llvm-svn: 195701
* Merge CallGraph and BasicCallGraph.Rafael Espindola2013-10-311-156/+78
| | | | llvm-svn: 193734
* Call destroy from ~BasicCallGraph.Rafael Espindola2013-10-251-0/+4
| | | | | | | | | | | | This fix a memory leak found by valgrind. Calling it from the base class destructor would not destroy the BasicCallGraph bits. FIXME: BasicCallGraph is the only thing that inherits from CallGraph. Can we merge the two? llvm-svn: 193412
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-3/+3
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-1/+1
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Now that invoke of an intrinsic is possible (for the llvm.do.nothing intrinsic)Duncan Sands2012-09-261-4/+5
| | | | | | | teach the callgraph logic to not create callgraph edges to intrinsics for invoke instructions; it already skips this for call instructions. Fixes PR13903. llvm-svn: 164707
* Release build: guard dump functions withManman Ren2012-09-121-2/+2
| | | | | | | | "#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163344. llvm-svn: 163679
* Release build: guard dump functions with "ifndef NDEBUG"Manman Ren2012-09-061-0/+4
| | | | | | No functional change. llvm-svn: 163344
* Simplify; no intended functional change.Eli Friedman2011-10-201-10/+3
| | | | llvm-svn: 142567
* Teach the CallGraph to ignore calls to intrinsics.John McCall2011-06-091-1/+1
| | | | llvm-svn: 132797
* Add spliceFunction to the CallGraph interface. This allows users to efficientlyNick Lewycky2011-01-031-1/+15
| | | | | | | | | | update a callGraph when performing the common operation of splicing the body to a new function and updating all callers (such as via RAUW). No users yet, though this is intended for DeadArgumentElimination as part of PR8887. llvm-svn: 122728
* Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson2010-10-191-1/+3
| | | | | | | | | | | | | | | | | exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
* Analysis groups need to initialize their default implementations.Owen Anderson2010-10-131-1/+1
| | | | llvm-svn: 116441
* Now with fewer extraneous semicolons!Owen Anderson2010-10-071-2/+2
| | | | llvm-svn: 115996
* Hide analysis group registration behind a macro, just like pass registration.Owen Anderson2010-10-061-1/+1
| | | | llvm-svn: 115835
* Reapply r110396, with fixes to appease the Linux buildbot gods.Owen Anderson2010-08-061-3/+3
| | | | llvm-svn: 110460
* Revert r110396 to fix buildbots.Owen Anderson2010-08-061-3/+3
| | | | llvm-svn: 110410
* Don't use PassInfo* as a type identifier for passes. Instead, use the ↵Owen Anderson2010-08-051-3/+3
| | | | | | | | address of the static ID member as the sole unique type identifier. Clean up APIs related to this change. llvm-svn: 110396
* use Value* constructor of CallSite to create potentially improper siteGabor Greif2010-07-281-2/+2
| | | | llvm-svn: 109579
* Add INSTANTIATE_AG_PASS, which combines RegisterPass<> with ↵Owen Anderson2010-07-211-3/+2
| | | | | | RegisterAnalysisGroup<> for pass registration. llvm-svn: 109058
* Speculatively revert r108813, in an attempt to get the self-host buildbots ↵Owen Anderson2010-07-201-1/+1
| | | | | | | | working again. I don't see why this patch would cause them to fail the way they are, but none of the other intervening patches seem likely either. llvm-svn: 108818
* Reapply r108794, a fix for the failing test from last time.Owen Anderson2010-07-201-1/+1
| | | | llvm-svn: 108813
* Revert r108794, "Separate PassInfo into two classes: a constructor-freeDaniel Dunbar2010-07-201-1/+1
| | | | | | | superclass (StaticPassInfo) and a constructor-ful subclass (PassInfo).", it is breaking teh everything. llvm-svn: 108805
* Separate PassInfo into two classes: a constructor-free superclass ↵Owen Anderson2010-07-201-1/+1
| | | | | | (StaticPassInfo) and a constructor-ful subclass (PassInfo). llvm-svn: 108794
* do not repeatedly dereference use_iteratorGabor Greif2010-07-091-3/+5
| | | | llvm-svn: 107963
* fix callgraph dump to not print 0x0x1234 for nodes.Chris Lattner2010-04-231-6/+8
| | | | | | | | | | | | | | | | Add the instruction pointer value for debuggability. We now get dump output that looks like this: Call graph node for function: 'f1'<<0x1017086b0>> #uses=1 CS<0x1017046f8> calls external node Call graph node for function: '_ZNSt6vectorIdSaIdEEC1EmRKdRKS0_'<<0x1017086f0>> #uses=1 CS<0x0> calls external node Call graph node for function: 'f4'<<0x1017087a0>> #uses=1 CS<0x101708c88> calls function 'f3' llvm-svn: 102194
* PR6880: Don't dereference CallsExternalNode if it's NULL.Benjamin Kramer2010-04-201-3/+5
| | | | llvm-svn: 101897
* make CallGraphNode dtor abort if a node is deleted when there are stillChris Lattner2010-04-201-0/+9
| | | | | | references to it. llvm-svn: 101847
* adopt getAdjustedAnalysisPointer in BasicCallGraph.Chris Lattner2010-01-201-1/+11
| | | | llvm-svn: 94015
* Convert debug messages to use dbgs(). Generally this meansDavid Greene2009-12-231-2/+3
| | | | | | s/errs/dbgs/g except for certain special cases. llvm-svn: 92034
* Reverting 85714, 85715, 85716, which are breaking the buildDouglas Gregor2009-11-011-1/+0
| | | | llvm-svn: 85717
* Don't #include Pass.h from CallGraph.h.Dan Gohman2009-11-011-0/+1
| | | | llvm-svn: 85715
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* add a new CallGraphNode::replaceCallEdge method and use it fromChris Lattner2009-09-151-0/+17
| | | | | | | | argpromote to avoid invalidating an iterator. This fixes PR4977. All clang tests now pass with expensive checking (on my system at least). llvm-svn: 81843
* remove CallGraphNode::replaceCallSite, it is redundant with other APIs.Chris Lattner2009-09-011-22/+0
| | | | llvm-svn: 80708
OpenPOWER on IntegriCloud