LLVM  6.0.0svn
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/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineFrameInfo.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachinePostDominators.h"
#include "llvm/CodeGen/RegisterClassInfo.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/IR/Attributes.h"
#include "llvm/IR/Function.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetFrameLowering.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <cassert>
#include <cstdint>
#include <memory>
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 MachineBasicBlockFindIDom (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::boolOrDefaultEnableShrinkWrapOpt ("enable-shrink-wrap", cl::Hidden, cl::desc("enable the shrink-wrapping pass"))
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "shrink-wrap"

Definition at line 87 of file ShrinkWrap.cpp.

Function Documentation

◆ FindIDom()

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

◆ isIrreducibleCFG()

static bool isIrreducibleCFG ( const MachineFunction MF,
const MachineLoopInfo MLI 
)
static

◆ isProperBackedge()

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 415 of file ShrinkWrap.cpp.

References llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::MachineLoopInfo::getLoopFor(), and llvm::LoopBase< BlockT, LoopT >::getParentLoop().

Referenced by isIrreducibleCFG().

◆ STATISTIC() [1/3]

STATISTIC ( NumFunc  ,
"Number of functions  
)

◆ STATISTIC() [2/3]

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

◆ STATISTIC() [3/3]

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

Variable Documentation

◆ EnableShrinkWrapOpt

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

Referenced by isIrreducibleCFG().