summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reapply r138695. Fix PassManager stack depths.Andrew Trick2011-08-291-3/+3
| | | | | | Patch by Xiaoyi Guo! llvm-svn: 138737
* Reverting r138695 to see if it fixes clang self host.Andrew Trick2011-08-271-3/+3
| | | | llvm-svn: 138701
* Fix PassManager stack depths.Andrew Trick2011-08-271-3/+3
| | | | | | Patch by Xiaoyi Guo! llvm-svn: 138695
* Silence a bunch (but not all) "variable written but not read" warningsDuncan Sands2011-08-121-0/+1
| | | | | | when building with assertions disabled. llvm-svn: 137460
* Teach the CallGraph to ignore calls to intrinsics.John McCall2011-06-091-2/+2
| | | | llvm-svn: 132797
* dead method.Chris Lattner2010-09-041-1/+0
| | | | llvm-svn: 113077
* Revert r111199; it breaks -debug-pass=Structure output.Dan Gohman2010-08-191-1/+1
| | | | llvm-svn: 111500
* Make dumpPassStructure be a PMDataManager abstraction, rather thanDan Gohman2010-08-161-1/+1
| | | | | | | | | | a Pass abstraction, since that's the level it's actually used at. Rename Pass' dumpPassStructure to dumpPass. This eliminates an awkward use of getAsPass() to convert a PMDataManager* into a Pass* just to permit a dumpPassStructure call. llvm-svn: 111199
* 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 site, and ↵Gabor Greif2010-07-281-3/+3
| | | | | | test that llvm-svn: 109580
* fix PR5009 by making CGSCCPM realize that a call was devirtualizedChris Lattner2010-05-011-5/+36
| | | | | | | if an indirect call site was removed and a direct one was added, not just if an indirect call site was modified to be direct. llvm-svn: 102830
* Implement rdar://6295824 and PR6724 with two tiny changesChris Lattner2010-05-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that can have a big effect :). The first is to enable the iterative SCC passmanager juice that kicks in when the scc passmgr detects that a function pass has devirtualized a call. In this case, it will rerun all the passes it manages on the SCC, up to the iteration count limit (4). This is useful because a function pass may devirualize a call, and we want the inliner to inline it, or pruneeh to infer stuff about it, etc. The second patch is to add *all* call sites to the DevirtualizedCalls list the inliner uses. This list is about to get renamed, but the jist of this is that the inliner now reconsiders *all* inlined call sites as candidates for further inlining. The intuition is this that in cases like this: f() { g(1); } g(int x) { h(x); } We analyze this bottom up, and may decide that it isn't profitable to inline H into G. Next step, we decide that it is profitable to inline G into F, and do so, which means that F now calls H. Even though the call from G -> H may not have been profitable to inline, the call from F -> H may be (in this case because a constant allows folding etc). In my spot checks, this doesn't have a big impact on code. For example, the LLC output for 252.eon grew from 0.02% (from 317252 to 317308) and 176.gcc actually shrunk by .3% (from 1525612 to 1520964 bytes). 252.eon never iterated in the SCC Passmgr, 176.gcc iterated at most 1 time. llvm-svn: 102823
* add a DEBUG call so that -debug lists when CGSCCPM iterates.Chris Lattner2010-04-221-7/+4
| | | | | | | | | Fix RefreshCallGraph to use CGN->replaceCallEdge instead of hand rolling its own loop. replaceCallEdge properly maintains the reference counts of the nodes, fixing a crash exposed by the iterative callgraph stuff. llvm-svn: 102120
* Implement (but don't enable) PR6724 and rdar://6295824. In short,Chris Lattner2010-04-211-56/+122
| | | | | | | | | | | | | | | we have RefreshCallGraph detect when a function pass devirtualizes a call, and have CGSCCPassMgr iterate (up to a count) when this happens. This allows (in the example) GVN to devirtualize the call in foo, then the inliner to inline it away. This is not currently enabled because I haven't done any analysis on the (potentially substantial) code size or performance impact of doing this, and guess what, it exposes callgraph updating bugs in various passes. This is progress though, and you can play with it by passing -max-cg-scc-iterations=5 to opt. llvm-svn: 101973
* reenable r101565, removing a problematic assertion.Chris Lattner2010-04-171-2/+0
| | | | | | | | | | | CGSCC can delete nodes in regions of the callgraph that have already been visited. If new CG nodes are allocated to the same pointer, we shouldn't abort, just handle it correctly by assigning a new number. This should restore stability by removing invalidated pointers that *will* be reused from the densemap in the iterator. llvm-svn: 101628
* disable r101565: an assert is getting triggered. More lurking badness no doubt.Chris Lattner2010-04-171-0/+2
| | | | llvm-svn: 101583
* building on the new CallGraphSCC abstraction, teach CallGraphSCCPassManager Chris Lattner2010-04-161-0/+5
| | | | | | | | | | | | to keep the node entries in scc_iterator up to date instead of dangling as the SCC mutates. This is a really terrible problem which was causing -g to affect codegen because it would permute the memory image of the compiler process. Thanks to Dale for expertly hunting it down. llvm-svn: 101565
* move ReplaceNode out of line, rename scc_iterator::fini -> isAtEnd().Chris Lattner2010-04-161-5/+15
| | | | | | No functionality change. llvm-svn: 101562
* introduce a new CallGraphSCC class, and pass it aroundChris Lattner2010-04-161-21/+34
| | | | | | | | to CallGraphSCCPass's instead of passing around a std::vector<CallGraphNode*>. No functionality change, but now we have a much tidier interface. llvm-svn: 101558
* move PrintCallGraphPass out of the middle of CGPassManager.Chris Lattner2010-04-161-33/+43
| | | | llvm-svn: 101543
* Ok, third time's the charm. No changes from last time except the CMakeDavid Greene2010-04-021-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | source addition. Apparently the buildbots were wrong about failures. --- Add some switches helpful for debugging: -print-before=<Pass Name> Dump IR before running pass <Pass Name>. -print-before-all Dump IR before running each pass. -print-after-all Dump IR after running each pass. These are helpful when tracking down a miscompilation. It is easy to get IR dumps and do diffs on them, etc. To make this work well, add a new getPrinterPass API to Pass so that each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass suitable for dumping out the kind of object the Pass works on. llvm-svn: 100249
* Revert 100204. It broke a bunch of tests and apparently changed what passes ↵Evan Cheng2010-04-021-35/+0
| | | | | | are run during codegen. llvm-svn: 100207
* Let's try this again. Re-apply 100143 including an apparent missingDavid Greene2010-04-021-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <string> include. For some reason the buildbot choked on this while my builds did not. It's probably due to a difference in system headers. --- Add some switches helpful for debugging: -print-before=<Pass Name> Dump IR before running pass <Pass Name>. -print-before-all Dump IR before running each pass. -print-after-all Dump IR after running each pass. These are helpful when tracking down a miscompilation. It is easy to get IR dumps and do diffs on them, etc. To make this work well, add a new getPrinterPass API to Pass so that each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass suitable for dumping out the kind of object the Pass works on. llvm-svn: 100204
* Revert r100143.Eric Christopher2010-04-011-35/+0
| | | | llvm-svn: 100146
* Add some switches helpful for debugging:David Greene2010-04-011-0/+35
| | | | | | | | | | | | | | | | | | | | | | | -print-before=<Pass Name> Dump IR before running pass <Pass Name>. -print-before-all Dump IR before running each pass. -print-after-all Dump IR after running each pass. These are helpful when tracking down a miscompilation. It is easy to get IR dumps and do diffs on them, etc. To make this work well, add a new getPrinterPass API to Pass so that each kind of pass (ModulePass, FunctionPass, etc.) can create a Pass suitable for dumping out the kind of object the Pass works on. llvm-svn: 100143
* reapply my timer rewrite with a change for PassManager to store Chris Lattner2010-03-301-8/+9
| | | | | | timers by pointer instead of by-value. llvm-svn: 99871
* revert r99862 which is causing FNT failures.Chris Lattner2010-03-301-9/+8
| | | | llvm-svn: 99870
* fairly major rewrite of various timing related stuff.Chris Lattner2010-03-301-8/+9
| | | | llvm-svn: 99862
* eliminate dynamic_cast from this file.Chris Lattner2010-01-221-17/+20
| | | | llvm-svn: 94157
* eliminate a bunch more unneeded dynamic_cast's.Chris Lattner2010-01-221-8/+9
| | | | llvm-svn: 94156
* eliminate a bunch of dynamic_cast's.Chris Lattner2010-01-221-0/+3
| | | | llvm-svn: 94155
* Change dbgs() back to errs() for assert messages as Chris requested.David Greene2009-12-231-1/+1
| | | | llvm-svn: 92080
* Convert debug messages to use dbgs(). Generally this meansDavid Greene2009-12-231-5/+5
| | | | | | s/errs/dbgs/g except for certain special cases. llvm-svn: 92035
* Extend the StartPassTimer and StopPassTimer functions so that theDan Gohman2009-09-281-4/+4
| | | | | | | | code that stops the timer doesn't have to search to find the timer object before it stops the timer. This avoids a lock acquisition and a few other things done with the timer running. llvm-svn: 82949
* make -debug-pass=Executions show information about what call graph nodesChris Lattner2009-09-151-1/+14
| | | | | | are in the SCC for each execution of a CGSCC pass. llvm-svn: 81838
* Fix uppercaseo.Dale Johannesen2009-09-101-1/+1
| | | | llvm-svn: 81463
* revert my patch, duncan points out what is wrong with my logic. AddChris Lattner2009-09-021-4/+8
| | | | | | a comment so that I don't change this in the future :) llvm-svn: 80760
* one more try at making this simpler, hopefully it won't break everything :)Chris Lattner2009-09-021-4/+4
| | | | llvm-svn: 80759
* Complicate Chris's simplification, avoiding complaintsDuncan Sands2009-09-021-1/+5
| | | | | | | about singular iterators when building with expensive checks turned on. llvm-svn: 80757
* debug intrinsics do not go in the callgraph, this fixes a coupleChris Lattner2009-09-011-1/+2
| | | | | | clang regtest failures. llvm-svn: 80724
* Fix a regression I introduced in r80708, found by llvm-test.Chris Lattner2009-09-011-5/+12
| | | | llvm-svn: 80718
* remove CallGraphNode::replaceCallSite, it is redundant with other APIs.Chris Lattner2009-09-011-1/+1
| | | | llvm-svn: 80708
* doxygenate RefreshCallGraph, add a new 'verification mode', and run it after Chris Lattner2009-09-011-4/+37
| | | | | | | CGSCC passes make change to ensure they are updating the callgraph correctly (when assertions are enabled). llvm-svn: 80698
* simpler solution to iterator invalidation "problem" foundChris Lattner2009-09-011-11/+6
| | | | | | by expensive checking. llvm-svn: 80695
* Do not manipulate invalid iterators. This fixes theDuncan Sands2009-09-011-6/+11
| | | | | | llvm-gcc build when expensive checking is turned on. llvm-svn: 80671
* Change CallGraphNode to maintain it's Function as an AssertingVHChris Lattner2009-09-011-18/+30
| | | | | | | | | | | | for sanity. This didn't turn up any bugs. Change CallGraphNode to maintain its "callsite" information in the call edges list as a WeakVH instead of as an instruction*. This fixes a broad class of dangling pointer bugs, and makes CallGraph have a number of useful invariants again. This fixes the class of problem indicated by PR4029 and PR3601. llvm-svn: 80663
* cleanups pointed out by duncanChris Lattner2009-08-311-2/+1
| | | | llvm-svn: 80595
* Step #1 to giving Callgraph some sane invariants. The problems with callgraphChris Lattner2009-08-311-3/+136
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 80566
OpenPOWER on IntegriCloud