summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* cleanups, factor some code out to a helper functionChris Lattner2009-08-311-22/+39
| | | | llvm-svn: 80542
* Fix some nasty callgraph dangling pointer problems in Chris Lattner2009-08-311-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | argpromotion and structretpromote. Basically, when replacing a function, they used the 'changeFunction' api which changes the entry in the function map (and steals/reuses the callgraph node). This has some interesting effects: first, the problem is that it doesn't update the "callee" edges in any callees of the function in the call graph. Second, this covers for a major problem in all the CGSCC pass stuff, which is that it is completely broken when functions are deleted if they *don't* reuse a CGN. (there is a cute little fixme about this though :). This patch changes the protocol that CGSCC passes must obey: now the CGSCC pass manager copies the SCC and preincrements its iterator to avoid passes invalidating it. This allows CGSCC passes to mutate the current SCC. However multiple passes may be run on that SCC, so if passes do this, they are now required to *update* the SCC to be current when they return. Other less interesting parts of this patch are that it makes passes update the CG more directly, eliminates changeFunction, and requires clients of replaceCallSite to specify the new callee CGN if they are changing it. llvm-svn: 80527
* Change Pass::print to take a raw ostream instead of std::ostream,Chris Lattner2009-08-231-4/+4
| | | | | | update all code that this affects. llvm-svn: 79830
* Remove Value::getName{Start,End}, the last of the old Name APIs.Daniel Dunbar2009-07-261-1/+1
| | | | llvm-svn: 77152
* Reapply r64300:Nick Lewycky2009-02-131-2/+12
| | | | | | | | | Make sure the SCC pass manager initializes any contained function pass managers. Without this, simplify-libcalls would add nocapture attributes when run on its own, but not when run as part of -std-compile-opts or similar. llvm-svn: 64443
* Revert r64300 and r64301. These were causing the following errors respectively:Bill Wendling2009-02-111-18/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During llvm-gcc bootstrap: Undefined symbols: "llvm::FPPassManager::doFinalization(llvm::Module&)", referenced from: (anonymous namespace)::CGPassManager::doFinalization(llvm::CallGraph&, llvm::Module&) in libLLVMipa.a(CallGraphSCCPass.o) "llvm::FPPassManager::doInitialization(llvm::Module&)", referenced from: (anonymous namespace)::CGPassManager::doInitialization(llvm::CallGraph&, llvm::Module&) in libLLVMipa.a(CallGraphSCCPass.o) ld: symbol(s) not found collect2: ld returned 1 exit status make[3]: *** [/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore.roots/llvmCore~obj/obj-llvm/Release/bin/opt] Error 1 During an LLVM release build: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-register-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenRegisterInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td instruction names with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-enums -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrNames.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td instruction information with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-instr-desc -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenInstrInfo.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Building X86.td assembly writer with tblgen /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/Release/bin/tblgen -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86 -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target -gen-asm-writer -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Target/X86/Release/X86GenAsmWriter.inc.tmp /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Target/X86/X86.td llvm[3]: Compiling InstructionCombining.cpp for Release build if /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmgcc42.roots/llvmgcc42~dst/Developer/usr/bin/llvm-g++-4.2 -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -Woverloaded-virtual -pedantic -Wall -W -Wwrite-strings -Wno-long-long -Wunused -Wno-unused-parameter -fstrict-aliasing -Wstrict-aliasing -c -MMD -MP -MF "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.lo" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o" -MT "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d" /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/lib/Transforms/Scalar/InstructionCombining.cpp -o /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.o ; \ then /bin/mv -f "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Transforms/Scalar/Release/InstructionCombining.d.tmp" "/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.sh.build/lib/Trans llvm-svn: 64311
* Make sure the SCC pass manager initializes any containedDuncan Sands2009-02-111-8/+18
| | | | | | | | function pass managers. Without this, simplify-libcalls would add nocapture attributes when run on its own, but not when run as part of -std-compile-opts or similar. llvm-svn: 64300
* Tidy up several unbeseeming casts from pointer to intptr_t.Dan Gohman2008-09-041-1/+1
| | | | llvm-svn: 55779
* Don't call getAnalysisUsage unless -debug-pass is enabled. This speedsChris Lattner2008-08-081-4/+2
| | | | | | up the passmgr by avoiding useless work. llvm-svn: 54528
* Clean up the use of static and anonymous namespaces. This turned upDan Gohman2008-05-131-0/+4
| | | | | | | several things that were neither in an anonymous namespace nor static but not intended to be global. llvm-svn: 51017
* Add assert.Devang Patel2008-05-021-0/+1
| | | | llvm-svn: 50596
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Do not overuse std::string. Pass around char * directly.Devang Patel2007-08-101-1/+1
| | | | llvm-svn: 41001
* More explicit keywords.Dan Gohman2007-08-011-1/+1
| | | | llvm-svn: 40673
* Verify loop info.Devang Patel2007-07-191-1/+2
| | | | llvm-svn: 40062
* Replace mysterious code causing a g++-4.2 warningDuncan Sands2007-07-191-6/+3
| | | | | | with hopefully correct code that pleases g++-4.2. llvm-svn: 40051
* CallGraphSCCPass manager may require other passes.Devang Patel2007-06-211-1/+1
| | | | | | | Use schedulePass() to accomodate these requirement instead of directly assigning a manager to new CallGraph PassManager. llvm-svn: 37695
* Drop 'const'Devang Patel2007-05-031-2/+2
| | | | llvm-svn: 36662
* Use 'static const char' instead of 'static const int'.Devang Patel2007-05-021-2/+2
| | | | | | | Due to darwin gcc bug, one version of darwin linker coalesces static const int, which defauts PassID based pass identification. llvm-svn: 36652
* Do not use typeinfo to identify pass in pass manager.Devang Patel2007-05-011-1/+4
| | | | llvm-svn: 36632
* Removed tabs everywhere except autogenerated & external files. Add makeAnton Korobeynikov2007-04-161-13/+12
| | | | | | target for tabs checking. llvm-svn: 36146
* Avoid constructing std::strings unless pass debugging is ON.Devang Patel2007-03-051-10/+5
| | | | llvm-svn: 34933
* Make getPassManagerType() const.Devang Patel2007-02-271-1/+1
| | | | llvm-svn: 34669
* Dump function names when debug-pass=Executions is used.Devang Patel2007-02-011-1/+5
| | | | llvm-svn: 33772
* Pretty print pass managerDevang Patel2007-02-011-0/+4
| | | | llvm-svn: 33766
* Use StartPassTimer() and StopPassManager()Devang Patel2007-01-291-3/+2
| | | | llvm-svn: 33640
* Measure timings.Devang Patel2007-01-291-2/+3
| | | | llvm-svn: 33627
* Remove dead code.Devang Patel2007-01-261-9/+0
| | | | | | | CallGraphSCCPass does not need to implement runOnModule(). It supports runOnSCC(). llvm-svn: 33516
* Fix typo.Devang Patel2007-01-231-1/+1
| | | | llvm-svn: 33467
* Add CallGraphSCCPass::assignPassManager().Devang Patel2007-01-231-0/+38
| | | | | | This enables CalLGraphPassManager. llvm-svn: 33466
* Add CGPassManager.Devang Patel2007-01-171-0/+124
| | | | llvm-svn: 33309
* Remove trailing whitespaceMisha Brukman2005-04-211-2/+2
| | | | llvm-svn: 21416
* 'Pass' should now not be derived from by clients. Instead, they should deriveChris Lattner2004-09-201-1/+1
| | | | | | | from ModulePass. Instead of implementing Pass::run, then should implement ModulePass::runOnModule. llvm-svn: 16436
* Changes For Bug 352Reid Spencer2004-09-011-1/+1
| | | | | | | | Move include/Config and include/Support into include/llvm/Config, include/llvm/ADT and include/llvm/Support. From here on out, all LLVM public header files must be under include/llvm/. llvm-svn: 16137
* Pass the callgraph not the moduleChris Lattner2004-04-201-2/+2
| | | | llvm-svn: 13087
* Add the ability for SCC passes to initialize and finalize themselvesChris Lattner2004-04-201-6/+3
| | | | llvm-svn: 13084
* Put all LLVM code into the llvm namespace, as per bug 109.Brian Gaeke2003-11-111-0/+4
| | | | llvm-svn: 9903
* Added LLVM project notice to the top of every C++ source file.John Criswell2003-10-201-0/+7
| | | | | | Header files will be on the way. llvm-svn: 9298
OpenPOWER on IntegriCloud