LLVM  5.0.0
Macros | Functions | Variables
ShrinkWrap.cpp File Reference
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/PostOrderIterator.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachinePostDominators.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/CodeGen/RegisterClassInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetSubtargetInfo.h"
Include dependency graph for ShrinkWrap.cpp:

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")
 
template<typename ListOfBBs , typename DominanceAnalysis >
static MachineBasicBlock * FindIDom (MachineBasicBlock &Block, ListOfBBs BBs, DominanceAnalysis &Dom)
 Helper function to find the immediate (post) dominator. More...
 
static bool isProperBackedge (const MachineLoopInfo &MLI, const MachineBasicBlock *SrcBB, const MachineBasicBlock *DestBB)
 Check whether the edge (SrcBB, DestBB) is a backedge according to MLI. More...
 
static bool isIrreducibleCFG (const MachineFunction &MF, const MachineLoopInfo &MLI)
 Check if the CFG of MF is irreducible. More...
 

Variables

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

Macro Definition Documentation

#define DEBUG_TYPE   "shrink-wrap"

Definition at line 78 of file ShrinkWrap.cpp.

Function Documentation

template<typename ListOfBBs , typename DominanceAnalysis >
static MachineBasicBlock* FindIDom ( MachineBasicBlock &  Block,
ListOfBBs  BBs,
DominanceAnalysis &  Dom 
)
static

Helper function to find the immediate (post) dominator.

Definition at line 256 of file ShrinkWrap.cpp.

static bool isIrreducibleCFG ( const MachineFunction &  MF,
const MachineLoopInfo &  MLI 
)
static
static bool isProperBackedge ( const MachineLoopInfo &  MLI,
const MachineBasicBlock *  SrcBB,
const MachineBasicBlock *  DestBB 
)
static

Check whether the edge (SrcBB, DestBB) is a backedge according to MLI.

I.e., check if it exists a loop that contains SrcBB and where DestBB is the loop header.

Definition at line 394 of file ShrinkWrap.cpp.

References llvm::LoopBase< N, M >::getHeader(), llvm::MachineLoopInfo::getLoopFor(), and llvm::LoopBase< N, M >::getParentLoop().

Referenced by isIrreducibleCFG().

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

Variable Documentation

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