LLVM: llvm::ARMBlockPlacement Class Reference (original) (raw)

Public Member Functions
ARMBlockPlacement ()
bool runOnMachineFunction (MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
void moveBasicBlock (MachineBasicBlock *BB, MachineBasicBlock *Before)
bool blockIsBefore (MachineBasicBlock *BB, MachineBasicBlock *Other)
bool fixBackwardsWLS (MachineLoop *ML)
Checks if loop has a backwards branching WLS, and if possible, fixes it.
bool processPostOrderLoops (MachineLoop *ML)
Updates ordering (of WLS BB and their loopExits) in inner loops first Returns true if any change was made in any of the loops.
bool revertWhileToDoLoop (MachineInstr *WLS)
void getAnalysisUsage (AnalysisUsage &AU) const override
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job.
Public Member Functions inherited from llvm::MachineFunctionPass
bool doInitialization (Module &) override
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run.
Public Member Functions inherited from llvm::FunctionPass
FunctionPass (char &pid)
void assignPassManager (PMStack &PMS, PassManagerType T) override
Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that manager.
PassManagerType getPotentialPassManagerType () const override
Return what kind of Pass Manager can manage this pass.
Public Member Functions inherited from llvm::Pass
Pass (PassKind K, char &pid)
Pass (const Pass &)=delete
Pass & operator= (const Pass &)=delete
virtual ~Pass ()
PassKind getPassKind () const
virtual StringRef getPassName () const
getPassName - Return a nice clean name for a pass.
StringRef getPassArgument () const
Return a nice clean name for a pass corresponding to that used to enable the pass in opt.
AnalysisID getPassID () const
getPassID - Return the PassID number that corresponds to this pass.
virtual bool doFinalization (Module &)
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run.
virtual void print (raw_ostream &OS, const Module *M) const
print - Print out the internal state of the pass.
void dump () const
virtual void preparePassManager (PMStack &)
Check if available pass managers are suitable for this pass or not.
void setResolver (AnalysisResolver *AR)
AnalysisResolver * getResolver () const
virtual void releaseMemory ()
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.
virtual ImmutablePass * getAsImmutablePass ()
virtual PMDataManager * getAsPMDataManager ()
virtual void verifyAnalysis () const
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information.
virtual void dumpPassStructure (unsigned Offset=0)
template
AnalysisType * getAnalysisIfAvailable () const
getAnalysisIfAvailable() - Subclasses use this function to get analysis information that might be around, for example to update it.
bool mustPreserveAnalysisID (char &AID) const
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID.
template
AnalysisType & getAnalysis () const
getAnalysis() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
template
AnalysisType & getAnalysis (Function &F, bool *Changed=nullptr)
getAnalysis() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function.
template
AnalysisType & getAnalysisID (AnalysisID PI) const
template
AnalysisType & getAnalysisID (AnalysisID PI, Function &F, bool *Changed=nullptr)
Static Public Attributes
static char ID = 0
Additional Inherited Members
Static Public Member Functions inherited from llvm::Pass
static const PassInfo * lookupPassInfo (const void *TI)
static const PassInfo * lookupPassInfo (StringRef Arg)
static Pass * createPass (AnalysisID ID)
Protected Member Functions inherited from llvm::MachineFunctionPass
MachineFunctionPass (char &ID)
void getAnalysisUsage (AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
virtual MachineFunctionProperties getRequiredProperties () const
virtual MachineFunctionProperties getSetProperties () const
virtual MachineFunctionProperties getClearedProperties () const
Protected Member Functions inherited from llvm::FunctionPass
bool skipFunction (const Function &F) const
Optional passes call this function to check whether the pass should be skipped.

Definition at line 30 of file ARMBlockPlacement.cpp.

llvm::ARMBlockPlacement::ARMBlockPlacement ( ) inline

blockIsBefore()

fixBackwardsWLS()

Checks if loop has a backwards branching WLS, and if possible, fixes it.

This requires checking the predecessor (ie. preheader or it's predecessor) for a WLS and if its loopExit/target is before it. If moving the predecessor won't convert a WLS (to the predecessor) from a forward to a backward branching WLS, then move the predecessor block to before the loopExit/target.

Definition at line 154 of file ARMBlockPlacement.cpp.

References blockIsBefore(), llvm::dbgs(), DEBUG_PREFIX, findWLS(), llvm::MachineBasicBlock::getFullName(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getParent(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getPrevNode(), llvm::getWhileLoopStartTargetBB(), llvm::isWhileLoopStart(), LLVM_DEBUG, MBB, ML, and moveBasicBlock().

Referenced by processPostOrderLoops().

getAnalysisUsage()

void llvm::ARMBlockPlacement::getAnalysisUsage ( AnalysisUsage & ) const inlineoverridevirtual

moveBasicBlock()

Definition at line 246 of file ARMBlockPlacement.cpp.

References llvm::MachineInstrBuilder::addImm(), llvm::MachineInstrBuilder::addMBB(), llvm::MachineInstrBuilder::addReg(), llvm::ARMCC::AL, assert(), llvm::BuildMI(), llvm::dbgs(), DEBUG_PREFIX, F, llvm::MachineInstrBuilder::getInstr(), llvm::MachineBasicBlock::getName(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::MachineBasicBlock::getParent(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getPrevNode(), llvm::isIndirectBranchOpcode(), llvm::isJumpTableBranchOpcode(), llvm::MachineBasicBlock::isSuccessor(), llvm::isUncondBranchOpcode(), LLVM_DEBUG, llvm::MachineBasicBlock::moveBefore(), and llvm::MachineBasicBlock::terminators().

Referenced by fixBackwardsWLS().

processPostOrderLoops()

revertWhileToDoLoop()

Definition at line 90 of file ARMBlockPlacement.cpp.

References llvm::MachineInstrBuilder::add(), llvm::MachineBasicBlock::addSuccessor(), assert(), llvm::MachineBasicBlock::back(), llvm::BuildMI(), llvm::computeAndAddLiveIns(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::dbgs(), DEBUG_PREFIX, llvm::MachineBasicBlock::end(), llvm::MDNode::get(), llvm::MachineBasicBlock::getBasicBlock(), llvm::MachineInstr::getDebugLoc(), llvm::MachineOperand::getImm(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineOperand::getMBB(), llvm::ilist_node_with_parent< NodeTy, ParentTy, Options >::getNextNode(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::MachineInstr::getParent(), llvm::MachineBasicBlock::insert(), llvm::MachineFunction::insert(), LLVM_DEBUG, llvm::MachineInstr::removeFromParent(), llvm::MachineFunction::RenumberBlocks(), llvm::MachineBasicBlock::replaceSuccessor(), llvm::RevertWhileLoopStartLR(), and llvm::MachineOperand::setIsKill().

Referenced by runOnMachineFunction().

runOnMachineFunction()

runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.

Implements llvm::MachineFunctionPass.

Definition at line 213 of file ARMBlockPlacement.cpp.

References Changed, llvm::dbgs(), DEBUG_PREFIX, llvm::MachineFunction::front(), llvm::Pass::getAnalysis(), llvm::MachineFunction::getFunction(), llvm::MachineFunction::getName(), llvm::MachineFunction::getSubtarget(), LLVM_DEBUG, ML, processPostOrderLoops(), llvm::MachineFunction::RenumberBlocks(), revertWhileToDoLoop(), and llvm::FunctionPass::skipFunction().

ID

char ARMBlockPlacement::ID = 0 static

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