LLVM: lib/CodeGen/ShrinkWrap.cpp File Reference (original) (raw)

Go to the source code of this file.

Macros
#define DEBUG_TYPE "shrink-wrap"
Functions
STATISTIC (NumFunc, "Number of functions")
STATISTIC (NumCandidates, "Number of shrink-wrapping candidates")
STATISTIC (NumCandidatesDropped, "Number of shrink-wrapping candidates dropped because of frequency")
INITIALIZE_PASS_BEGIN (ShrinkWrapLegacy, DEBUG_TYPE, "Shrink Wrap Pass", false, false) INITIALIZE_PASS_END(ShrinkWrapLegacy
template<typename ListOfBBs, typename DominanceAnalysis>
static MachineBasicBlock * FindIDom (MachineBasicBlock &Block, ListOfBBs BBs, DominanceAnalysis &Dom, bool Strict=true)
Helper function to find the immediate (post) dominator.
static bool isAnalyzableBB (const TargetInstrInfo &TII, MachineBasicBlock &Entry)
static bool hasDirtyPred (const DenseSet< const MachineBasicBlock * > &ReachableByDirty, const MachineBasicBlock &MBB)
Determines if any predecessor of MBB is on the path from block that has use or def of CSRs/FI to MBB.
static void markAllReachable (DenseSet< const MachineBasicBlock * > &Visited, const MachineBasicBlock &MBB)
Derives the list of all the basic blocks reachable from MBB.
static void collectBlocksReachableByDirty (const DenseSet< const MachineBasicBlock * > &DirtyBBs, DenseSet< const MachineBasicBlock * > &ReachableByDirty)
Collect blocks reachable by use or def of CSRs/FI.
static bool isSaveReachableThroughClean (const MachineBasicBlock *SavePoint, ArrayRef< MachineBasicBlock * > CleanPreds)
static void updateTerminator (MachineBasicBlock *BBToUpdate, MachineBasicBlock *NMBB, const TargetInstrInfo *TII)
This function updates the branches post restore point split.
static MachineBasicBlock * tryToSplitRestore (MachineBasicBlock *MBB, ArrayRef< MachineBasicBlock * > DirtyPreds, const TargetInstrInfo *TII)
This function splits the restore point and returns new restore point/BB.
static void rollbackRestoreSplit (MachineFunction &MF, MachineBasicBlock *NMBB, MachineBasicBlock *MBB, ArrayRef< MachineBasicBlock * > DirtyPreds, const TargetInstrInfo *TII)
This function undoes the restore point split done earlier.
static bool giveUpWithRemarks (MachineOptimizationRemarkEmitter *ORE, StringRef RemarkName, StringRef RemarkMessage, const DiagnosticLocation &Loc, const MachineBasicBlock *MBB)
Variables
static cl::opt< cl::boolOrDefault > EnableShrinkWrapOpt ("enable-shrink-wrap", cl::Hidden, cl::desc("enable the shrink-wrapping pass"))
static cl::opt< bool > EnablePostShrinkWrapOpt ("enable-shrink-wrap-region-split", cl::init(true), cl::Hidden, cl::desc("enable splitting of the restore block if possible"))
DEBUG_TYPE
Shrink Wrap Pass
Shrink Wrap false

DEBUG_TYPE

#define DEBUG_TYPE "shrink-wrap"

collectBlocksReachableByDirty()

FindIDom()

template<typename ListOfBBs, typename DominanceAnalysis>

giveUpWithRemarks()

hasDirtyPred()

INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( ShrinkWrapLegacy ,
DEBUG_TYPE ,
"Shrink Wrap Pass" ,
false ,
false )

isAnalyzableBB()

isSaveReachableThroughClean()

markAllReachable()

rollbackRestoreSplit()

STATISTIC() [1/3]

STATISTIC ( NumCandidates ,
"Number of shrink-wrapping candidates" )

STATISTIC() [2/3]

STATISTIC ( NumCandidatesDropped ,
"Number of shrink-wrapping candidates dropped because of frequency" )

STATISTIC() [3/3]

STATISTIC ( NumFunc ,
"Number of functions" )

tryToSplitRestore()

updateTerminator()

DEBUG_TYPE

EnablePostShrinkWrapOpt

EnableShrinkWrapOpt

cl::opt< cl::boolOrDefault > EnableShrinkWrapOpt("enable-shrink-wrap", cl::Hidden, cl::desc("enable the shrink-wrapping pass")) ( "enable-shrink-wrap" , cl::Hidden , cl::desc("enable the shrink-wrapping pass") ) static

false

Pass