LLVM  3.7.0
Macros | Functions | Variables
PHIElimination.cpp File Reference
#include "llvm/CodeGen/Passes.h"
#include "PHIEliminationUtils.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/CodeGen/LiveIntervalAnalysis.h"
#include "llvm/CodeGen/LiveVariables.h"
#include "llvm/CodeGen/MachineDominators.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineLoopInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
#include <algorithm>
Include dependency graph for PHIElimination.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "phielim"
 

Functions

 STATISTIC (NumLowered,"Number of phis lowered")
 
 STATISTIC (NumCriticalEdgesSplit,"Number of critical edges split")
 
 STATISTIC (NumReused,"Number of reused lowered phis")
 
 INITIALIZE_PASS_BEGIN (PHIElimination,"phi-node-elimination","Eliminate PHI nodes for register allocation", false, false) INITIALIZE_PASS_END(PHIElimination
 
static bool isImplicitlyDefined (unsigned VirtReg, const MachineRegisterInfo *MRI)
 isImplicitlyDefined - Return true if all defs of VirtReg are implicit-defs. More...
 
static bool isSourceDefinedByImplicitDef (const MachineInstr *MPhi, const MachineRegisterInfo *MRI)
 isSourceDefinedByImplicitDef - Return true if all sources of the phi node are implicit_def's. More...
 

Variables

static cl::opt< boolDisableEdgeSplitting ("disable-phi-elim-edge-splitting", cl::init(false), cl::Hidden, cl::desc("Disable critical edge splitting ""during PHI elimination"))
 
static cl::opt< boolSplitAllCriticalEdges ("phi-elim-split-all-critical-edges", cl::init(false), cl::Hidden, cl::desc("Split all critical edges during ""PHI elimination"))
 
static cl::opt< boolNoPhiElimLiveOutEarlyExit ("no-phi-elim-live-out-early-exit", cl::init(false), cl::Hidden, cl::desc("Do not use an early exit if isLiveOutPastPHIs returns true."))
 
phi node elimination
 
phi node Eliminate PHI nodes
for register 
allocation
 
phi node Eliminate PHI nodes
for register 
false
 

Macro Definition Documentation

#define DEBUG_TYPE   "phielim"

Definition at line 38 of file PHIElimination.cpp.

Function Documentation

INITIALIZE_PASS_BEGIN ( PHIElimination  ,
"phi-node-elimination ,
"Eliminate PHI nodes for register allocation ,
false  ,
false   
)
static bool isImplicitlyDefined ( unsigned  VirtReg,
const MachineRegisterInfo MRI 
)
static

isImplicitlyDefined - Return true if all defs of VirtReg are implicit-defs.

This includes registers with no defs.

Definition at line 203 of file PHIElimination.cpp.

References llvm::MachineRegisterInfo::def_instructions(), and llvm::DI.

Referenced by isSourceDefinedByImplicitDef().

static bool isSourceDefinedByImplicitDef ( const MachineInstr MPhi,
const MachineRegisterInfo MRI 
)
static

isSourceDefinedByImplicitDef - Return true if all sources of the phi node are implicit_def's.

Definition at line 213 of file PHIElimination.cpp.

References llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), and isImplicitlyDefined().

STATISTIC ( NumLowered  ,
"Number of phis lowered"   
)
STATISTIC ( NumCriticalEdgesSplit  ,
"Number of critical edges split  
)
STATISTIC ( NumReused  ,
"Number of reused lowered phis"   
)

Variable Documentation

phi node Eliminate PHI nodes for register allocation

Definition at line 120 of file PHIElimination.cpp.

cl::opt<bool> DisableEdgeSplitting("disable-phi-elim-edge-splitting", cl::init(false), cl::Hidden, cl::desc("Disable critical edge splitting ""during PHI elimination"))
static
phi node elimination

Definition at line 120 of file PHIElimination.cpp.

phi node Eliminate PHI nodes for register false

Definition at line 120 of file PHIElimination.cpp.

cl::opt<bool> NoPhiElimLiveOutEarlyExit("no-phi-elim-live-out-early-exit", cl::init(false), cl::Hidden, cl::desc("Do not use an early exit if isLiveOutPastPHIs returns true."))
static
cl::opt<bool> SplitAllCriticalEdges("phi-elim-split-all-critical-edges", cl::init(false), cl::Hidden, cl::desc("Split all critical edges during ""PHI elimination"))
static