LLVM  6.0.0svn
Public Member Functions | Friends | List of all members
llvm::MachineLoop Class Reference

#include "llvm/CodeGen/MachineLoopInfo.h"

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

Public Member Functions

MachineBasicBlockgetTopBlock ()
 Return the "top" block in the loop, which is the first block in the linear layout, ignoring any parts of the loop not contiguous with the part that contains the header. More...
 
MachineBasicBlockgetBottomBlock ()
 Return the "bottom" block in the loop, which is the last block in the linear layout, ignoring any parts of the loop not contiguous with the part that contains the header. More...
 
MachineBasicBlockfindLoopControlBlock ()
 Find the block that contains the loop control variable and the loop test. More...
 
DebugLoc getStartLoc () const
 Return the debug location of the start of this loop. More...
 
void dump () const
 
- Public Member Functions inherited from llvm::LoopBase< MachineBasicBlock, MachineLoop >
unsigned getLoopDepth () const
 Return the nesting level of this loop. More...
 
MachineBasicBlockgetHeader () const
 
MachineLoopgetParentLoop () const
 
void setParentLoop (MachineLoop *L)
 This is a raw interface for bypassing addChildLoop. More...
 
bool contains (const MachineLoop *L) const
 Return true if the specified loop is contained within in this loop. More...
 
bool contains (const MachineBasicBlock *BB) const
 Return true if the specified basic block is in this loop. More...
 
bool contains (const InstT *Inst) const
 Return true if the specified instruction is in this loop. More...
 
const std::vector< MachineLoop *> & getSubLoops () const
 Return the loops contained entirely within this loop. More...
 
std::vector< MachineLoop *> & getSubLoopsVector ()
 
iterator begin () const
 
iterator end () const
 
reverse_iterator rbegin () const
 
reverse_iterator rend () const
 
bool empty () const
 
const std::vector< MachineBasicBlock *> & getBlocks () const
 Get a list of the basic blocks which make up this loop. More...
 
block_iterator block_begin () const
 
block_iterator block_end () const
 
iterator_range< block_iteratorblocks () const
 
unsigned getNumBlocks () const
 Get the number of blocks in this loop in constant time. More...
 
bool isInvalid () const
 Return true if this loop is no longer valid. More...
 
bool isLoopExiting (const MachineBasicBlock *BB) const
 True if terminator in the block can branch to another block that is outside of the current loop. More...
 
bool isLoopLatch (const MachineBasicBlock *BB) const
 
unsigned getNumBackEdges () const
 Calculate the number of back edges to the loop header. More...
 
void getExitingBlocks (SmallVectorImpl< MachineBasicBlock * > &ExitingBlocks) const
 Return all blocks inside the loop that have successors outside of the loop. More...
 
MachineBasicBlockgetExitingBlock () const
 If getExitingBlocks would return exactly one block, return that block. More...
 
void getExitBlocks (SmallVectorImpl< MachineBasicBlock * > &ExitBlocks) const
 Return all of the successor blocks of this loop. More...
 
MachineBasicBlockgetExitBlock () const
 If getExitBlocks would return exactly one block, return that block. More...
 
void getExitEdges (SmallVectorImpl< Edge > &ExitEdges) const
 Return all pairs of (inside_block,outside_block). More...
 
MachineBasicBlockgetLoopPreheader () const
 If there is a preheader for this loop, return it. More...
 
MachineBasicBlockgetLoopPredecessor () const
 If the given loop's header has exactly one unique predecessor outside the loop, return it. More...
 
MachineBasicBlockgetLoopLatch () const
 If there is a single latch block for this loop, return it. More...
 
void getLoopLatches (SmallVectorImpl< MachineBasicBlock * > &LoopLatches) const
 Return all loop latch blocks of this loop. More...
 
void addBasicBlockToLoop (MachineBasicBlock *NewBB, LoopInfoBase< MachineBasicBlock, MachineLoop > &LI)
 This method is used by other analyses to update loop information. More...
 
void replaceChildLoopWith (MachineLoop *OldChild, MachineLoop *NewChild)
 This is used when splitting loops up. More...
 
void addChildLoop (MachineLoop *NewChild)
 Add the specified loop to be a child of this loop. More...
 
MachineLoopremoveChildLoop (iterator I)
 This removes the specified child from being a subloop of this loop. More...
 
void addBlockEntry (MachineBasicBlock *BB)
 This adds a basic block directly to the basic block list. More...
 
void reverseBlock (unsigned from)
 interface to reverse Blocks[from, end of loop] in this loop More...
 
void reserveBlocks (unsigned size)
 interface to do reserve() for Blocks More...
 
void moveToHeader (MachineBasicBlock *BB)
 This method is used to move BB (which must be part of this loop) to be the loop header of the loop (the block that dominates all others). More...
 
void removeBlockFromLoop (MachineBasicBlock *BB)
 This removes the specified basic block from the current loop, updating the Blocks as appropriate. More...
 
void verifyLoop () const
 Verify loop structure. More...
 
void verifyLoopNest (DenseSet< const MachineLoop * > *Loops) const
 Verify loop structure of this loop and all nested loops. More...
 
void print (raw_ostream &OS, unsigned Depth=0, bool Verbose=false) const
 Print loop with all the BBs inside it. More...
 

Friends

class LoopInfoBase< MachineBasicBlock, MachineLoop >
 

Additional Inherited Members

- Public Types inherited from llvm::LoopBase< MachineBasicBlock, MachineLoop >
typedef std::vector< MachineLoop *>::const_iterator iterator
 
typedef std::vector< MachineLoop *>::const_reverse_iterator reverse_iterator
 
typedef std::vector< MachineBasicBlock *>::const_iterator block_iterator
 
typedef std::pair< const MachineBasicBlock *, const MachineBasicBlock *> Edge
 Edge type. More...
 
- Protected Member Functions inherited from llvm::LoopBase< MachineBasicBlock, MachineLoop >
 LoopBase ()
 This creates an empty loop. More...
 
 LoopBase (MachineBasicBlock *BB)
 
 ~LoopBase ()
 

Detailed Description

Definition at line 45 of file MachineLoopInfo.h.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void MachineLoop::dump ( ) const

Definition at line 142 of file MachineLoopInfo.cpp.

References llvm::dbgs(), and llvm::Pass::print().

Referenced by llvm::createHexagonHardwareLoops().

◆ findLoopControlBlock()

MachineBasicBlock * MachineLoop::findLoopControlBlock ( )

Find the block that contains the loop control variable and the loop test.

This will return the latch block if it's one of the exiting blocks. Otherwise, return the exiting block. Return 'null' when multiple exiting blocks are present.

Definition at line 80 of file MachineLoopInfo.cpp.

Referenced by llvm::createHexagonHardwareLoops(), and isImmValidForOpcode().

◆ getBottomBlock()

MachineBasicBlock * MachineLoop::getBottomBlock ( )

Return the "bottom" block in the loop, which is the last block in the linear layout, ignoring any parts of the loop not contiguous with the part that contains the header.

Definition at line 65 of file MachineLoopInfo.cpp.

References contains(), llvm::WebAssembly::End, llvm::MachineFunction::end(), llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::MachineBasicBlock::getParent().

Referenced by llvm::HexagonInstrInfo::analyzeLoop().

◆ getStartLoc()

DebugLoc MachineLoop::getStartLoc ( ) const

Return the debug location of the start of this loop.

This looks for a BB terminating instruction with a known debug location by looking at the preheader and header blocks. If it cannot find a terminating instruction with location information, it returns an unknown location.

Definition at line 90 of file MachineLoopInfo.cpp.

◆ getTopBlock()

MachineBasicBlock * MachineLoop::getTopBlock ( )

Return the "top" block in the loop, which is the first block in the linear layout, ignoring any parts of the loop not contiguous with the part that contains the header.

Definition at line 50 of file MachineLoopInfo.cpp.

References llvm::MachineFunction::begin(), contains(), llvm::ilist_node_impl< OptionsT >::getIterator(), and llvm::MachineBasicBlock::getParent().

Referenced by llvm::createHexagonHardwareLoops().

Friends And Related Function Documentation

◆ LoopInfoBase< MachineBasicBlock, MachineLoop >

friend class LoopInfoBase< MachineBasicBlock, MachineLoop >
friend

Definition at line 73 of file MachineLoopInfo.h.


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