20 #include "llvm/Config/llvm-config.h" 35 "Machine Natural Loop Construction",
true,
true)
43 calculate(getAnalysis<MachineDominatorTree>());
90 if (isLoopExiting(Latch))
93 return getExitingBlock();
101 if (
const BasicBlock *PHeadBB = PHeadMBB->getBasicBlock())
102 if (
DebugLoc DL = PHeadBB->getTerminator()->getDebugLoc())
108 if (
const BasicBlock *HeadBB = HeadMBB->getBasicBlock())
109 return HeadBB->getTerminator()->getDebugLoc();
116 bool SpeculativePreheader)
const {
120 if (!SpeculativePreheader)
149 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP) BlockT * getLoopLatch() const
If there is a single latch block for this loop, return it.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
coro Split coroutine into a set of functions driving its state machine
This class represents lattice values for constants.
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds...
DebugLoc getStartLoc() const
Return the debug location of the start of this loop.
BlockT * getLoopPreheader() const
If there is a preheader for this loop, return it.
void initializeMachineLoopInfoPass(PassRegistry &)
machine Machine Natural Loop true
return AArch64::GPR64RegClass contains(Reg)
iterator_range< succ_iterator > successors()
AnalysisUsage & addRequired()
#define INITIALIZE_PASS_DEPENDENCY(depName)
MachineBasicBlock * 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.
char & MachineLoopInfoID
MachineLoopInfo - This pass is a loop analysis pass.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
MachineBasicBlock * 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.
BlockT * getHeader() const
MachineBasicBlock * findLoopControlBlock()
Find the block that contains the loop control variable and the loop test.
void calculate(MachineDominatorTree &MDT)
COFF::MachineTypes Machine
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
LLVM Basic Block Representation.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
Represent the analysis usage information of a pass.
self_iterator getIterator()
iterator_range< pred_iterator > predecessors()
bool hasAddressTaken() const
Test whether this block is potentially the target of an indirect branch.
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
INITIALIZE_PASS_END(RegBankSelect, DEBUG_TYPE, "Assign register bank of generic virtual registers", false, false) RegBankSelect
Iterator for intrusive lists based on ilist_node.
unsigned pred_size() const
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
void setPreservesAll()
Set by analyses that do not transform their input at all.
bool runOnMachineFunction(MachineFunction &F) override
Calculate the natural loop information.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
Represents a single loop in the control flow graph.
INITIALIZE_PASS_BEGIN(MachineLoopInfo, "machine-loops", "Machine Natural Loop Construction", true, true) INITIALIZE_PASS_END(MachineLoopInfo
virtual void print(raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
MachineBasicBlock * findLoopPreheader(MachineLoop *L, bool SpeculativePreheader=false) const
Find the block that either is the loop preheader, or could speculatively be used as the preheader...
machine Machine Natural Loop Construction
MachineLoop * getLoopFor(const MachineBasicBlock *BB) const
Return the innermost loop that BB lives in.
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
This class builds and contains all of the top-level loop structures in the specified function...