LLVM  8.0.1
Macros | Functions
MachineCopyPropagation.cpp File Reference
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/CodeGen/MachineBasicBlock.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineInstr.h"
#include "llvm/CodeGen/MachineOperand.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/TargetInstrInfo.h"
#include "llvm/CodeGen/TargetRegisterInfo.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/DebugCounter.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <iterator>
Include dependency graph for MachineCopyPropagation.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "machine-cp"
 

Functions

 STATISTIC (NumDeletes, "Number of dead copies deleted")
 
 STATISTIC (NumCopyForwards, "Number of copy uses forwarded")
 
 DEBUG_COUNTER (FwdCounter, "machine-cp-fwd", "Controls which register COPYs are forwarded")
 
 INITIALIZE_PASS (MachineCopyPropagation, DEBUG_TYPE, "Machine Copy Propagation Pass", false, false) void MachineCopyPropagation
 
static bool isNopCopy (const MachineInstr &PreviousCopy, unsigned Src, unsigned Def, const TargetRegisterInfo *TRI)
 Return true if PreviousCopy did copy register Src to register Def. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "machine-cp"

Definition at line 68 of file MachineCopyPropagation.cpp.

Function Documentation

◆ DEBUG_COUNTER()

DEBUG_COUNTER ( FwdCounter  ,
"machine-cp-fwd"  ,
"Controls which register COPYs are forwarded"   
)

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( MachineCopyPropagation  ,
DEBUG_TYPE  ,
"Machine Copy Propagation Pass ,
false  ,
false   
)

◆ isNopCopy()

static bool isNopCopy ( const MachineInstr PreviousCopy,
unsigned  Src,
unsigned  Def,
const TargetRegisterInfo TRI 
)
static

Return true if PreviousCopy did copy register Src to register Def.

This fact may have been obscured by sub register usage or may not be true at all even though Src and Def are subregisters of the registers used in PreviousCopy. e.g. isNopCopy("ecx = COPY eax", AX, CX) == true isNopCopy("ecx = COPY eax", AH, CL) == false

Definition at line 252 of file MachineCopyPropagation.cpp.

References assert(), llvm::SetVector< T, Vector, Set >::begin(), llvm::MachineBasicBlock::begin(), llvm::MachineInstr::clearRegisterKills(), llvm::MachineOperand::clobbersPhysReg(), llvm::TargetRegisterClass::contains(), llvm::dbgs(), llvm::MachineInstr::dump(), E, llvm::MachineBasicBlock::end(), llvm::MachineInstr::eraseFromParent(), llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::TargetRegisterInfo::getMinimalPhysRegClass(), llvm::MachineBasicBlock::getName(), llvm::MachineInstr::getNumOperands(), llvm::MachineInstr::getOperand(), llvm::MachineOperand::getReg(), llvm::MachineInstr::getRegClassConstraint(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MCRegisterInfo::getSubRegIndex(), llvm::MachineFunction::getSubtarget(), llvm::TargetRegisterClass::getSuperClasses(), I, llvm::MachineInstr::implicit_operands(), llvm::MachineRegisterInfo::isConstantPhysReg(), llvm::MachineInstr::isCopy(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isDef(), llvm::MachineOperand::isImplicit(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isRenamable(), llvm::MachineRegisterInfo::isReserved(), llvm::MCRegisterInfo::isSubRegister(), llvm::MachineOperand::isTied(), llvm::MachineOperand::isUndef(), llvm::TargetRegisterInfo::isVirtualRegister(), LLVM_DEBUG, llvm::make_range(), llvm::MachineInstr::operands(), llvm::printReg(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::TargetRegisterInfo::regsOverlap(), llvm::MachineOperand::setIsRenamable(), llvm::MachineOperand::setReg(), llvm::DebugCounter::shouldExecute(), llvm::MachineBasicBlock::succ_empty(), TRI, and llvm::MachineInstr::uses().

◆ STATISTIC() [1/2]

STATISTIC ( NumDeletes  ,
"Number of dead copies deleted"   
)

◆ STATISTIC() [2/2]

STATISTIC ( NumCopyForwards  ,
"Number of copy uses forwarded"   
)