aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/RegionInfo.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-08-09Consistently use FunctionAnalysisManagerSean Silva1-2/+2
Besides a general consistently benefit, the extra layer of indirection allows the mechanical part of https://reviews.llvm.org/D23256 that requires touching every transformation and analysis to be factored out cleanly. Thanks to David for the suggestion. llvm-svn: 278077
2016-04-18[NFC] Header cleanupMehdi Amini1-3/+0
Removed some unused headers, replaced some headers with forward class declarations. Found using simple scripts like this one: clear && ack --cpp -l '#include "llvm/ADT/IndexedMap.h"' | xargs grep -L 'IndexedMap[<]' | xargs grep -n --color=auto 'IndexedMap' Patch by Eugene Kosov <claprix@yandex.ru> Differential Revision: http://reviews.llvm.org/D19219 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266595
2016-03-11[PM] Make the AnalysisManager parameter to run methods a reference.Chandler Carruth1-9/+9
This was originally a pointer to support pass managers which didn't use AnalysisManagers. However, that doesn't realistically come up much and the complexity of supporting it doesn't really make sense. In fact, *many* parts of the pass manager were just assuming the pointer was never null already. This at least makes it much more explicit and clear. llvm-svn: 263219
2016-03-11[PM] Implement the final conclusion as to how the analysis IDs shouldChandler Carruth1-1/+1
work in the face of the limitations of DLLs and templated static variables. This requires passes that use the AnalysisBase mixin provide a static variable themselves. So as to keep their APIs clean, I've made these private and befriended the CRTP base class (which is the common practice). I've added documentation to AnalysisBase for why this is necessary and at what point we can go back to the much simpler system. This is clearly a better pattern than the extern template as it caught *numerous* places where the template magic hadn't been applied and things were "just working" but would eventually have broken mysteriously. llvm-svn: 263216
2016-02-28[PM] Appease mingw32's auto-import DLL build with minimal tweaks, with fix ↵NAKAMURA Takumi1-0/+2
for clang. char AnalysisBase::ID should be declared as extern and defined in one module. llvm-svn: 262188
2016-02-28Revert r262185, "[PM] Appease mingw32's auto-import DLL build with minimal ↵NAKAMURA Takumi1-2/+0
tweaks." I'll rework soon. llvm-svn: 262186
2016-02-28[PM] Appease mingw32's auto-import DLL build with minimal tweaks.NAKAMURA Takumi1-0/+2
char AnalysisBase::ID should be declared as extern and defined in one module. llvm-svn: 262185
2016-02-26[PM] Introduce CRTP mixin base classes to help define passes andChandler Carruth1-2/+0
analyses in the new pass manager. These just handle really basic stuff: turning a type name into a string statically that is nice to print in logs, and getting a static unique ID for each analysis. Sadly, the format of passes in anonymous namespaces makes using their names in tests really annoying so I've customized the names of the no-op passes to keep tests sane to read. This is the first of a few simplifying refactorings for the new pass manager that should reduce boilerplate and confusion. llvm-svn: 262004
2016-02-25Introduce RegionInfoAnalysis, which compute Region Tree in the new ↵Hongbin Zheng1-0/+34
PassManager. NFC Differential Revision: http://reviews.llvm.org/D17571 llvm-svn: 261904
2016-02-25Introduce DominanceFrontierAnalysis to the new PassManager to compute ↵Hongbin Zheng1-3/+3
DominanceFrontier. NFC Differential Revision: http://reviews.llvm.org/D17570 llvm-svn: 261903
2016-02-25Introduce analysis pass to compute PostDominators in the new pass manager. NFCHongbin Zheng1-3/+3
Differential Revision: http://reviews.llvm.org/D17537 llvm-svn: 261902
2016-02-25Revert "Introduce analysis pass to compute PostDominators in the new pass ↵Hongbin Zheng1-3/+3
manager. NFC" This reverts commit a3e5cc6a51ab5ad88d1760c63284294a4e34c018. llvm-svn: 261891
2016-02-25Revert "Introduce DominanceFrontierAnalysis to the new PassManager to ↵Hongbin Zheng1-3/+3
compute DominanceFrontier. NFC" This reverts commit 109c38b2226a87b0be73fa7a0a8c1a81df20aeb2. llvm-svn: 261890
2016-02-25Revert "Introduce RegionInfoAnalysis, which compute Region Tree in the new ↵Hongbin Zheng1-34/+0
PassManager. NFC" This reverts commit 8228b4d374edeb4cc0c5fddf6e1ab876918ee126. llvm-svn: 261889
2016-02-25Introduce RegionInfoAnalysis, which compute Region Tree in the new ↵Hongbin Zheng1-0/+34
PassManager. NFC Differential Revision: http://reviews.llvm.org/D17571 llvm-svn: 261884
2016-02-25Introduce DominanceFrontierAnalysis to the new PassManager to compute ↵Hongbin Zheng1-3/+3
DominanceFrontier. NFC Differential Revision: http://reviews.llvm.org/D17570 llvm-svn: 261883
2016-02-25Introduce analysis pass to compute PostDominators in the new pass manager. NFCHongbin Zheng1-3/+3
Differential Revision: http://reviews.llvm.org/D17537 llvm-svn: 261882
2016-01-29Annotate dump() methods with LLVM_DUMP_METHOD, addressing Richard Smith ↵Yaron Keren1-1/+1
r259192 post commit comment. clang part in r259232, this is the LLVM part of the patch. llvm-svn: 259240
2015-08-10[RegionInfo] Add debug-time region viewer functionsMichael Kruse1-0/+9
Summary: Analogously to Function::viewCFG(), RegionInfo::view() and RegionInfo::viewOnly() are meant to be called in debugging sessions. They open a viewer to show how RegionInfo currently understands the region hierarchy. The functions viewRegion(Function*) and viewRegionOnly(Function*) invoke a fresh region analysis of the function in contrast to viewRegion(RegionInfo*) and viewRegionOnly(RegionInfo*) which show the current analysis result. Reviewers: grosser Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11875 llvm-svn: 244444
2015-01-14[cleanup] Re-sort all the #include lines in LLVM usingChandler Carruth1-1/+1
utils/sort_includes.py. I clearly haven't done this in a while, so more changed than usual. This even uncovered a missing include from the InstrProf library that I've added. No functionality changed here, just mechanical cleanup of the include order. llvm-svn: 225974
2014-07-20Fix msc17 build. RegionInfo::RegionInfo::recalculate() doesn't make sense.NAKAMURA Takumi1-4/+2
llvm-svn: 213466
2014-07-20Fix -Asserts build introduced since r213456.NAKAMURA Takumi1-0/+2
llvm-svn: 213465
2014-07-19Templatify RegionInfo so it works on MachineBasicBlocksMatt Arsenault1-762/+66
llvm-svn: 213456
2014-04-22[Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth1-1/+2
definition below all the header #include lines, lib/Analysis/... edition. This one has a bit extra as there were *other* #define's before #include lines in addition to DEBUG_TYPE. I've sunk all of them as a block. llvm-svn: 206843
2014-04-15RegionInfo: Do not access a value that was just moved awayTobias Grosser1-1/+1
This fixes a regression introduced in r206310. llvm-svn: 206328
2014-04-15Use unique_ptr to manage ownership of child Regions within llvm::RegionDavid Blaikie1-15/+19
llvm-svn: 206310
2014-04-15[C++11] More 'nullptr' conversion. In some cases just using a boolean check ↵Craig Topper1-24/+24
instead of comparing to nullptr. llvm-svn: 206243
2014-03-03[C++11] Add a basic block range view for RegionInfoTobias Grosser1-2/+2
This also switches the users in LLVM to ensure this functionality is tested. llvm-svn: 202705
2014-01-13[PM] Split DominatorTree into a concrete analysis result object whichChandler Carruth1-3/+3
can be used by both the new pass manager and the old. This removes it from any of the virtual mess of the pass interfaces and lets it derive cleanly from the DominatorTreeBase<> template. In turn, tons of boilerplate interface can be nuked and it turns into a very straightforward extension of the base DominatorTree interface. The old analysis pass is now a simple wrapper. The names and style of this split should match the split between CallGraph and CallGraphWrapperPass. All of the users of DominatorTree have been updated to match using many of the same tricks as with CallGraph. The goal is that the common type remains the resulting DominatorTree rather than the pass. This will make subsequent work toward the new pass manager significantly easier. Also in numerous places things became cleaner because I switched from re-running the pass (!!! mid way through some other passes run!!!) to directly recomputing the domtree. llvm-svn: 199104
2014-01-09Put the functionality for printing a value to a raw_ostream as anChandler Carruth1-3/+2
operand into the Value interface just like the core print method is. That gives a more conistent organization to the IR printing interfaces -- they are all attached to the IR objects themselves. Also, update all the users. This removes the 'Writer.h' header which contained only a single function declaration. llvm-svn: 198836
2014-01-07Move the LLVM IR asm writer header files into the IR directory, as theyChandler Carruth1-1/+1
are part of the core IR library in order to support dumping and other basic functionality. Rename the 'Assembly' include directory to 'AsmParser' to match the library name and the only functionality left their -- printing has been in the core IR library for quite some time. Update all of the #includes to match. All of this started because I wanted to have the layering in good shape before I started adding support for printing LLVM IR using the new pass infrastructure, and commandline support for the new pass infrastructure. llvm-svn: 198688
2014-01-07Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth1-1/+1
subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
2013-08-21Reorder headers according to lint.Bill Wendling1-4/+2
llvm-svn: 188932
2013-05-03RegionInfo: Do not crash if unreachable block is foundTobias Grosser1-1/+2
llvm-svn: 181025
2013-04-10RegionInfo: Add helpers to replace entry/exit recursivelyTobias Grosser1-0/+32
Contributed by: Star Tan <tanmx_star@yeah.net> llvm-svn: 179157
2012-12-03Use the new script to sort the includes of every file under lib.Chandler Carruth1-4/+3
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
2012-09-12Release build: guard dump functions withManman Ren1-1/+1
"#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)" No functional change. Update r163344. llvm-svn: 163679
2012-09-06Release build: guard dump functions with "ifndef NDEBUG"Manman Ren1-0/+2
No functional change. llvm-svn: 163344
2012-08-27Remove the the block_node_iterator of Region, replace it by the block_iterator.Hongbin Zheng1-21/+3
llvm-svn: 162672
2012-08-02Implement the block_iterator of Region based on df_iterator.Hongbin Zheng1-16/+0
llvm-svn: 161177
2012-05-04Rename the Region::block_iterator to Region::block_node_iterator, andChandler Carruth1-6/+24
add a new Region::block_iterator which actually iterates over the basic blocks of the region. The old iterator, now call 'block_node_iterator' iterates over RegionNodes which contain a single basic block. This works well with the GraphTraits-based iterator design, however most users actually want an iterator over the BasicBlocks inside these RegionNodes. Now the 'block_iterator' is a wrapper which exposes exactly this interface. Internally it uses the block_node_iterator to walk all nodes which are single basic blocks, but transparently unwraps the basic block to make user code simpler. While this patch is a bit of a wash, most of the updates are to internal users, not external users of the RegionInfo. I have an accompanying patch to Polly that is a strict simplification of every user of this interface, and I'm working on a pass that also wants the same simplified interface. This patch alone should have no functional impact. llvm-svn: 156202
2012-02-22Remove extra semi-colons.Chad Rosier1-1/+1
llvm-svn: 151169
2011-11-15Missed some users of Value::getNameStr.Benjamin Kramer1-4/+2
llvm-svn: 144656
2011-04-04Region: Allow user control the printing style of the print function.Tobias Grosser1-16/+16
Contributed by: etherzhhb@gmail.com llvm-svn: 128808
2011-01-13Add single entry / single exit accessors.Tobias Grosser1-23/+32
Add methods for accessing the (single) entry / exit edge of a region. If no such edge exists, null is returned. Both accessors return the start block of the corresponding edge. The edge can finally be formed by utilizing Region::getEntry() or Region::getExit(); Contributed by: Andreas Simbuerger <simbuerg@fim.uni-passau.de> llvm-svn: 123410
2011-01-02split dom frontier handling stuff out to its own DominanceFrontier header,Chris Lattner1-1/+1
so that Dominators.h is *just* domtree. Also prune #includes a bit. llvm-svn: 122714
2010-10-22Make some symbols static, move classes into anonymous namespaces.Benjamin Kramer1-1/+1
llvm-svn: 117111
2010-10-19Get rid of static constructors for pass registration. Instead, every pass ↵Owen Anderson1-0/+1
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
2010-10-13Add Region::isTopLevelRegion().Tobias Grosser1-3/+3
llvm-svn: 116402
2010-10-13RegionInfo: Fix trivial error that slipped in last minute.Tobias Grosser1-1/+1
llvm-svn: 116400