LLVM
15.0.0git
|
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallSet.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/InitializePasses.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>
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") | |
STATISTIC (NumCopyBackwardPropagated, "Number of copy defs backward propagated") | |
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, MCRegister Src, MCRegister Def, const TargetRegisterInfo *TRI, const TargetInstrInfo *TII, bool UseCopyInstr) |
Return true if PreviousCopy did copy register Src to register Def . More... | |
static bool | isBackwardPropagatableCopy (MachineInstr &MI, const MachineRegisterInfo &MRI, const TargetInstrInfo &TII, bool UseCopyInstr) |
Variables | |
static cl::opt< bool > | MCPUseCopyInstr ("mcp-use-is-copy-instr", cl::init(false), cl::Hidden) |
#define DEBUG_TYPE "machine-cp" |
Definition at line 78 of file MachineCopyPropagation.cpp.
DEBUG_COUNTER | ( | FwdCounter | , |
"machine-cp-fwd" | , | ||
"Controls which register COPYs are forwarded" | |||
) |
INITIALIZE_PASS | ( | MachineCopyPropagation | , |
DEBUG_TYPE | , | ||
"Machine Copy Propagation Pass" | , | ||
false | , | ||
false | |||
) |
Definition at line 356 of file MachineCopyPropagation.cpp.
References llvm::dbgs(), llvm::MCRegisterInfo::DiffListIterator::isValid(), LLVM_DEBUG, and TRI.
|
static |
Definition at line 844 of file MachineCopyPropagation.cpp.
References assert(), llvm::tgtok::Def, llvm::DestSourcePair::Destination, llvm::MachineOperand::getReg(), llvm::MachineOperand::isKill(), llvm::MachineOperand::isRenamable(), llvm::MachineRegisterInfo::isReserved(), MI, MRI, llvm::DestSourcePair::Source, and TII.
|
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 382 of file MachineCopyPropagation.cpp.
References llvm::Register::asMCReg(), llvm::tgtok::Def, llvm::DestSourcePair::Destination, llvm::MachineOperand::getReg(), llvm::MCRegisterInfo::getSubRegIndex(), llvm::MCRegisterInfo::isSubRegister(), llvm::DestSourcePair::Source, TII, and TRI.