LLVM
8.0.1
|
#include "CodeGen/BranchFolding.h"
Classes | |
class | MBFIWrapper |
This class keeps track of branch frequencies of newly created blocks and tail-merged blocks. More... | |
Public Member Functions | |
BranchFolder (bool defaultEnableTailMerge, bool CommonHoist, MBFIWrapper &FreqInfo, const MachineBranchProbabilityInfo &ProbInfo, unsigned MinTailLength=0) | |
bool | OptimizeFunction (MachineFunction &MF, const TargetInstrInfo *tii, const TargetRegisterInfo *tri, MachineModuleInfo *mmi, MachineLoopInfo *mli=nullptr, bool AfterPlacement=false) |
Perhaps branch folding, tail merging and other CFG optimizations on the given function. More... | |
Definition at line 35 of file BranchFolding.h.
|
explicit |
Definition at line 138 of file BranchFolding.cpp.
References assert(), llvm::cl::BOU_FALSE, llvm::cl::BOU_TRUE, llvm::cl::BOU_UNSET, llvm::dbgs(), llvm::MachineFunction::erase(), FlagEnableTailMerge, llvm::MachineBasicBlock::getParent(), LLVM_DEBUG, llvm::MachineBasicBlock::pred_empty(), llvm::MachineLoopInfo::removeBlock(), llvm::MachineBasicBlock::removeSuccessor(), llvm::MachineBasicBlock::succ_empty(), llvm::MachineBasicBlock::succ_end(), and TailMergeSize.
bool BranchFolder::OptimizeFunction | ( | MachineFunction & | MF, |
const TargetInstrInfo * | tii, | ||
const TargetRegisterInfo * | tri, | ||
MachineModuleInfo * | mmi, | ||
MachineLoopInfo * | mli = nullptr , |
||
bool | AfterPlacement = false |
||
) |
Perhaps branch folding, tail merging and other CFG optimizations on the given function.
Block placement changes the layout and may create new tail merging opportunities.
Definition at line 172 of file BranchFolding.cpp.
References llvm::TargetInstrInfo::analyzeBranch(), llvm::MachineBasicBlock::CorrectExtraCFGEdges(), llvm::SmallVectorBase::empty(), llvm::getEHScopeMembership(), llvm::MachineJumpTableInfo::getJumpTables(), llvm::MachineFunction::getRegInfo(), I, llvm::MachineRegisterInfo::invalidateLiveness(), llvm::MachineJumpTableInfo::RemoveJumpTable(), llvm::BitVector::set(), llvm::TargetRegisterInfo::trackLivenessAfterRegAlloc(), and llvm::MachineRegisterInfo::tracksLiveness().
Referenced by getLayoutSuccessorProbThreshold(), and INITIALIZE_PASS().