LLVM API Documentation

Defines | Typedefs | Functions | Variables
TailDuplication.cpp File Reference
#include "llvm/CodeGen/Passes.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/MachineSSAUpdater.h"
#include "llvm/CodeGen/RegisterScavenging.h"
#include "llvm/IR/Function.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/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
Include dependency graph for TailDuplication.cpp:

Go to the source code of this file.

Defines

#define DEBUG_TYPE   "tailduplication"

Typedefs

typedef std::vector< std::pair
< MachineBasicBlock
*, unsigned > > 
AvailableValsTy

Functions

 STATISTIC (NumTails,"Number of tails duplicated")
 STATISTIC (NumTailDups,"Number of tail duplicated blocks")
 STATISTIC (NumInstrDups,"Additional instructions due to tail duplication")
 STATISTIC (NumDeadBlocks,"Number of dead blocks removed")
 STATISTIC (NumAddedPHIs,"Number of phis added")
 INITIALIZE_PASS (TailDuplicatePass,"tailduplication","Tail Duplication", false, false) bool TailDuplicatePass
static void VerifyPHIs (MachineFunction &MF, bool CheckExtra)
static bool isDefLiveOut (unsigned Reg, MachineBasicBlock *BB, const MachineRegisterInfo *MRI)
static unsigned getPHISrcRegOpIdx (MachineInstr *MI, MachineBasicBlock *SrcBB)
static void getRegsUsedByPHIs (const MachineBasicBlock &BB, DenseSet< unsigned > *UsedByPhi)
static bool bothUsedInPHI (const MachineBasicBlock &A, SmallPtrSet< MachineBasicBlock *, 8 > SuccsB)

Variables

static cl::opt< unsignedTailDuplicateSize ("tail-dup-size", cl::desc("Maximum instructions to consider tail duplicating"), cl::init(2), cl::Hidden)
static cl::opt< boolTailDupVerify ("tail-dup-verify", cl::desc("Verify sanity of PHI instructions during taildup"), cl::init(false), cl::Hidden)
static cl::opt< unsignedTailDupLimit ("tail-dup-limit", cl::init(~0U), cl::Hidden)

Define Documentation

#define DEBUG_TYPE   "tailduplication"

Definition at line 37 of file TailDuplication.cpp.


Typedef Documentation

typedef std::vector<std::pair<MachineBasicBlock*,unsigned> > AvailableValsTy

Definition at line 59 of file TailDuplication.cpp.


Function Documentation

static bool bothUsedInPHI ( const MachineBasicBlock A,
SmallPtrSet< MachineBasicBlock *, 8 >  SuccsB 
) [static]
static unsigned getPHISrcRegOpIdx ( MachineInstr MI,
MachineBasicBlock SrcBB 
) [static]
static void getRegsUsedByPHIs ( const MachineBasicBlock BB,
DenseSet< unsigned > *  UsedByPhi 
) [static]
INITIALIZE_PASS ( TailDuplicatePass  ,
"tailduplication"  ,
"Tail Duplication"  ,
false  ,
false   
)

Definition at line 132 of file TailDuplication.cpp.

References llvm::HexagonInstrInfo::getRegisterInfo(), and TII.

static bool isDefLiveOut ( unsigned  Reg,
MachineBasicBlock BB,
const MachineRegisterInfo MRI 
) [static]
STATISTIC ( NumTails  ,
"Number of tails duplicated"   
)
STATISTIC ( NumTailDups  ,
"Number of tail duplicated blocks"   
)
STATISTIC ( NumInstrDups  ,
"Additional instructions due to tail duplication"   
)
STATISTIC ( NumDeadBlocks  ,
"Number of dead blocks removed"   
)
STATISTIC ( NumAddedPHIs  ,
"Number of phis added"   
)
static void VerifyPHIs ( MachineFunction MF,
bool  CheckExtra 
) [static]

Variable Documentation

cl::opt<unsigned> TailDuplicateSize("tail-dup-size", cl::desc("Maximum instructions to consider tail duplicating"), cl::init(2), cl::Hidden) [static]
cl::opt<unsigned> TailDupLimit("tail-dup-limit", cl::init(~0U), cl::Hidden) [static]
cl::opt<bool> TailDupVerify("tail-dup-verify", cl::desc("Verify sanity of PHI instructions during taildup"), cl::init(false), cl::Hidden) [static]