LLVM API Documentation

Public Types | Public Member Functions | Static Public Attributes | Friends
llvm::LoopInfo Class Reference

#include <LoopInfo.h>

Inheritance diagram for llvm::LoopInfo:
Inheritance graph
[legend]
Collaboration diagram for llvm::LoopInfo:
Collaboration graph
[legend]

List of all members.

Public Types

typedef LoopInfoBase
< BasicBlock, Loop >::iterator 
iterator
typedef LoopInfoBase
< BasicBlock, Loop >
::reverse_iterator 
reverse_iterator

Public Member Functions

 LoopInfo ()
LoopInfoBase< BasicBlock, Loop > & getBase ()
iterator begin () const
iterator end () const
reverse_iterator rbegin () const
reverse_iterator rend () const
bool empty () const
LoopgetLoopFor (const BasicBlock *BB) const
const Loopoperator[] (const BasicBlock *BB) const
unsigned getLoopDepth (const BasicBlock *BB) const
bool isLoopHeader (BasicBlock *BB) const
bool runOnFunction (Function &F) override
void verifyAnalysis () const override
void releaseMemory () override
void print (raw_ostream &O, const Module *M=nullptr) const override
void getAnalysisUsage (AnalysisUsage &AU) const override
LoopremoveLoop (iterator I)
void changeLoopFor (BasicBlock *BB, Loop *L)
void changeTopLevelLoop (Loop *OldLoop, Loop *NewLoop)
void addTopLevelLoop (Loop *New)
void removeBlock (BasicBlock *BB)
void updateUnloop (Loop *Unloop)
bool replacementPreservesLCSSAForm (Instruction *From, Value *To)

Static Public Attributes

static char ID = 0

Friends

class LoopBase< BasicBlock, Loop >

Detailed Description

Definition at line 629 of file LoopInfo.h.


Member Typedef Documentation

iterator/begin/end - The interface to the top-level loops in the current function.

Definition at line 647 of file LoopInfo.h.

Definition at line 648 of file LoopInfo.h.


Constructor & Destructor Documentation

llvm::LoopInfo::LoopInfo ( ) [inline]

Member Function Documentation

void llvm::LoopInfo::addTopLevelLoop ( Loop New) [inline]

addTopLevelLoop - This adds the specified loop to the collection of top-level loops.

Definition at line 712 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::addTopLevelLoop().

Referenced by llvm::LPPassManager::insertLoop().

iterator llvm::LoopInfo::begin ( ) const [inline]

Definition at line 649 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::begin().

Referenced by verifyAnalysis().

void llvm::LoopInfo::changeLoopFor ( BasicBlock BB,
Loop L 
) [inline]

changeLoopFor - Change the top-level loop that contains BB to the specified loop. This should be used by transformations that restructure the loop hierarchy tree.

Definition at line 700 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::changeLoopFor().

Referenced by separateNestedLoop().

void llvm::LoopInfo::changeTopLevelLoop ( Loop OldLoop,
Loop NewLoop 
) [inline]

changeTopLevelLoop - Replace the specified loop in the top-level loops list with the indicated loop.

Definition at line 706 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::changeTopLevelLoop().

Referenced by separateNestedLoop().

bool llvm::LoopInfo::empty ( ) const [inline]

Definition at line 653 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::empty().

iterator llvm::LoopInfo::end ( ) const [inline]

Definition at line 650 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::end().

Referenced by verifyAnalysis().

void LoopInfo::getAnalysisUsage ( AnalysisUsage ) const [override, virtual]

getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. If a pass specifies that it uses a particular analysis result to this function, it can then use the getAnalysis<AnalysisType>() function, below.

Reimplemented from llvm::Pass.

Definition at line 704 of file LoopInfo.cpp.

References llvm::AnalysisUsage::addRequired(), and llvm::AnalysisUsage::setPreservesAll().

getLoopDepth - Return the loop nesting level of the specified block. A depth of 0 means the block is not inside any loop.

Definition at line 671 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::getLoopDepth().

Loop* llvm::LoopInfo::getLoopFor ( const BasicBlock BB) const [inline]
bool llvm::LoopInfo::isLoopHeader ( BasicBlock BB) const [inline]

Definition at line 676 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::isLoopHeader().

const Loop* llvm::LoopInfo::operator[] ( const BasicBlock BB) const [inline]

operator[] - same as getLoopFor...

Definition at line 664 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::getLoopFor().

void LoopInfo::print ( raw_ostream O,
const Module M = nullptr 
) const [override, virtual]

print - Print out the internal state of the pass. This is called by Analyze to print out the contents of an analysis. Otherwise it is not necessary to implement this method. Beware that the module pointer MAY be null. This automatically forwards to a virtual function that does not provide the Module* in case the analysis doesn't need it it can just be ignored.

Reimplemented from llvm::Pass.

Definition at line 709 of file LoopInfo.cpp.

References llvm::LoopInfoBase< BlockT, LoopT >::print().

void llvm::LoopInfo::releaseMemory ( ) [inline, override, virtual]

releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. The default behavior of passes is to hold onto memory for the entire duration of their lifetime (which is the entire compile time). For pipelined passes, this is not a big deal because that memory gets recycled every time the pass is invoked on another program unit. For IP passes, it is more important to free memory when it is unused.

Optionally implement this function to release pass memory when it is no longer used.

Reimplemented from llvm::Pass.

Definition at line 686 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::releaseMemory().

Referenced by runOnFunction().

void llvm::LoopInfo::removeBlock ( BasicBlock BB) [inline]

removeBlock - This method completely removes BB from all data structures, including all of the Loop objects it is nested in and our mapping from BasicBlocks to loops.

Definition at line 719 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::removeBlock().

Referenced by FoldBlockIntoPredecessor(), and simplifyOneLoop().

removeLoop - This removes the specified top-level loop from this loop info object. The loop is not deleted, as it will presumably be inserted into another loop.

Definition at line 695 of file LoopInfo.h.

References llvm::LoopInfoBase< BlockT, LoopT >::removeLoop().

replacementPreservesLCSSAForm - Returns true if replacing From with To everywhere is guaranteed to preserve LCSSA form.

Definition at line 731 of file LoopInfo.h.

References llvm::LoopBase< BlockT, LoopT >::contains(), llvm::dyn_cast(), llvm::Instruction::getParent(), and I.

Referenced by llvm::UnrollLoop().

bool LoopInfo::runOnFunction ( Function F) [override, virtual]

runOnFunction - Calculate the natural loop information.

Implements llvm::FunctionPass.

Definition at line 613 of file LoopInfo.cpp.

References llvm::LoopInfoBase< BlockT, LoopT >::Analyze(), and releaseMemory().

void LoopInfo::updateUnloop ( Loop Unloop)

updateUnloop - Update LoopInfo after removing the last backedge from a loop--now the "unloop". This updates the loop forest and parent loops for each block so that Unloop is no longer referenced, but the caller must actually delete the Unloop object.

updateUnloop - The last backedge has been removed from a loop--now the "unloop". Find a new parent for the blocks contained within unloop and update the loop tree. We don't necessarily have valid dominators at this point, but LoopInfo is still valid except for the removal of this loop.

Note that Unloop may now be an empty loop. Calling Loop::getHeader without checking first is illegal.

Definition at line 626 of file LoopInfo.cpp.

References llvm::LoopInfoBase< BlockT, LoopT >::addTopLevelLoop(), llvm::LoopBase< BlockT, LoopT >::begin(), llvm::LoopInfoBase< BlockT, LoopT >::begin(), llvm::LoopBase< BlockT, LoopT >::block_begin(), llvm::LoopBase< BlockT, LoopT >::block_end(), llvm::LoopInfoBase< BlockT, LoopT >::changeLoopFor(), llvm::LoopBase< BlockT, LoopT >::empty(), llvm::LoopBase< BlockT, LoopT >::end(), llvm::LoopInfoBase< BlockT, LoopT >::end(), getLoopFor(), llvm::LoopBase< BlockT, LoopT >::getParentLoop(), I, llvm::LoopBase< BlockT, LoopT >::removeChildLoop(), and llvm::LoopInfoBase< BlockT, LoopT >::removeLoop().

Referenced by llvm::LPPassManager::deleteLoopFromQueue().

void LoopInfo::verifyAnalysis ( ) const [override, virtual]

verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.

Reimplemented from llvm::Pass.

Definition at line 681 of file LoopInfo.cpp.

References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), begin(), llvm::DenseSet< ValueT, ValueInfoT >::count(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), end(), I, Loops, and VerifyLoopInfo.


Friends And Related Function Documentation

friend class LoopBase< BasicBlock, Loop > [friend]

Definition at line 631 of file LoopInfo.h.


Member Data Documentation

char LoopInfo::ID = 0 [static]

Definition at line 636 of file LoopInfo.h.


The documentation for this class was generated from the following files: