class MachineLoopInfo

Declaration

class MachineLoopInfo : public MachineFunctionPass { /* full declaration omitted */ };

Description

MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of passes that operate on the MachineFunction representation. Instead of overriding runOnFunction, subclasses override runOnMachineFunction.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:89

Inherits from: MachineFunctionPass

Member Variables

private LoopInfoBase<llvm::MachineBasicBlock, llvm::MachineLoop> LI
public static char ID

Method Overview

  • public MachineLoopInfo(llvm::MachineDominatorTree & MDT)
  • public MachineLoopInfo(const llvm::MachineLoopInfo &)
  • public MachineLoopInfo()
  • public inline void addTopLevelLoop(llvm::MachineLoop * New)
  • public inline llvm::MachineLoopInfo::iterator begin() const
  • public void calculate(llvm::MachineDominatorTree & MDT)
  • public inline void changeLoopFor(llvm::MachineBasicBlock * BB, llvm::MachineLoop * L)
  • public inline void changeTopLevelLoop(llvm::MachineLoop * OldLoop, llvm::MachineLoop * NewLoop)
  • public bool empty() const
  • public inline llvm::MachineLoopInfo::iterator end() const
  • public llvm::MachineBasicBlock * findLoopPreheader(llvm::MachineLoop * L, bool SpeculativePreheader = false, bool FindMultiLoopPreheader = false) const
  • public void getAnalysisUsage(llvm::AnalysisUsage & AU) const
  • public LoopInfoBase<llvm::MachineBasicBlock, llvm::MachineLoop> & getBase()
  • public inline unsigned int getLoopDepth(const llvm::MachineBasicBlock * BB) const
  • public inline llvm::MachineLoop * getLoopFor(const llvm::MachineBasicBlock * BB) const
  • public inline bool isLoopHeader(const llvm::MachineBasicBlock * BB) const
  • public void releaseMemory()
  • public void removeBlock(llvm::MachineBasicBlock * BB)
  • public inline llvm::MachineLoop * removeLoop(llvm::MachineLoopInfo::iterator I)
  • public bool runOnMachineFunction(llvm::MachineFunction & F)

Inherited from MachineFunctionPass:

Inherited from FunctionPass:

Inherited from Pass:

Methods

MachineLoopInfo(llvm::MachineDominatorTree& MDT)

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:98

Parameters

llvm::MachineDominatorTree& MDT

MachineLoopInfo(const llvm::MachineLoopInfo&)

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:102

Parameters

const llvm::MachineLoopInfo&

MachineLoopInfo()

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:97

inline void addTopLevelLoop(
    llvm::MachineLoop* New)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:171

Parameters

llvm::MachineLoop* New

inline llvm::MachineLoopInfo::iterator begin()
    const

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:120

void calculate(llvm::MachineDominatorTree& MDT)

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:147

Parameters

llvm::MachineDominatorTree& MDT

inline void changeLoopFor(
    llvm::MachineBasicBlock* BB,
    llvm::MachineLoop* L)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:160

Parameters

llvm::MachineBasicBlock* BB
llvm::MachineLoop* L

inline void changeTopLevelLoop(
    llvm::MachineLoop* OldLoop,
    llvm::MachineLoop* NewLoop)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:166

Parameters

llvm::MachineLoop* OldLoop
llvm::MachineLoop* NewLoop

bool empty() const

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:122

inline llvm::MachineLoopInfo::iterator end() const

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:121

llvm::MachineBasicBlock* findLoopPreheader(
    llvm::MachineLoop* L,
    bool SpeculativePreheader = false,
    bool FindMultiLoopPreheader = false) const

Description

Find the block that either is the loop preheader, or could speculatively be used as the preheader. This is e.g. useful to place loop setup code. Code that cannot be speculated should not be placed here. SpeculativePreheader is controlling whether it also tries to find the speculative preheader if the regular preheader is not present. With FindMultiLoopPreheader = false, nullptr will be returned if the found preheader is the preheader of multiple loops.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:115

Parameters

llvm::MachineLoop* L
bool SpeculativePreheader = false
bool FindMultiLoopPreheader = false

void getAnalysisUsage(
    llvm::AnalysisUsage& AU) const

Description

getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:151

Parameters

llvm::AnalysisUsage& AU

LoopInfoBase<llvm::MachineBasicBlock,
             llvm::MachineLoop>&
getBase()

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:105

inline unsigned int getLoopDepth(
    const llvm::MachineBasicBlock* BB) const

Description

Return the loop nesting level of the specified block.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:136

Parameters

const llvm::MachineBasicBlock* BB

inline llvm::MachineLoop* getLoopFor(
    const llvm::MachineBasicBlock* BB) const

Description

Return the innermost loop that BB lives in. If a basic block is in no loop (for example the entry node), null is returned.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:126

Parameters

const llvm::MachineBasicBlock* BB

inline bool isLoopHeader(
    const llvm::MachineBasicBlock* BB) const

Description

True if the block is a loop header node.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:141

Parameters

const llvm::MachineBasicBlock* BB

void releaseMemory()

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:149

void removeBlock(llvm::MachineBasicBlock* BB)

Description

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

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:178

Parameters

llvm::MachineBasicBlock* BB

inline llvm::MachineLoop* removeLoop(
    llvm::MachineLoopInfo::iterator I)

Description

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.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:155

Parameters

llvm::MachineLoopInfo::iterator I

bool runOnMachineFunction(
    llvm::MachineFunction& F)

Description

Calculate the natural loop information.

Declared at: llvm/include/llvm/CodeGen/MachineLoopInfo.h:146

Parameters

llvm::MachineFunction& F