LLVM  5.0.0
Macros | Functions | Variables
PHIElimination.cpp File Reference
#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/CodeGen/Passes.h"
#include "llvm/IR/Function.h"
#include "llvm/Support/CommandLine.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   "phi-node-elimination"
 

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, DEBUG_TYPE,"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< bool > DisableEdgeSplitting ("disable-phi-elim-edge-splitting", cl::init(false), cl::Hidden, cl::desc("Disable critical edge splitting ""during PHI elimination"))
 
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 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."))
 
 DEBUG_TYPE
 
Eliminate PHI nodes for register allocation
 
Eliminate PHI nodes for register false
 

Macro Definition Documentation

#define DEBUG_TYPE   "phi-node-elimination"

Definition at line 37 of file PHIElimination.cpp.

Function Documentation

INITIALIZE_PASS_BEGIN ( PHIElimination  ,
DEBUG_TYPE  ,
"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 204 of file PHIElimination.cpp.

References llvm::MachineRegisterInfo::def_instructions().

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 214 of file PHIElimination.cpp.

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

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

Variable Documentation

Eliminate PHI nodes for register allocation

Definition at line 119 of file PHIElimination.cpp.

DEBUG_TYPE

Definition at line 119 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
Eliminate PHI nodes for register false

Definition at line 119 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