LLVM  6.0.0svn
Macros | Functions
DetectDeadLanes.cpp File Reference

Analysis that tracks defined/used subregister lanes across COPY instructions and instructions that get lowered to a COPY (PHI, REG_SEQUENCE, INSERT_SUBREG, EXTRACT_SUBREG). More...

#include <deque>
#include <vector>
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
#include "llvm/CodeGen/Passes.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/PassRegistry.h"
#include "llvm/Support/Debug.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 DetectDeadLanes.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "detect-dead-lanes"
 

Functions

static bool lowersToCopies (const MachineInstr &MI)
 Returns true if MI will get lowered to a series of COPY instructions. More...
 
static bool isCrossCopy (const MachineRegisterInfo &MRI, const MachineInstr &MI, const TargetRegisterClass *DstRC, const MachineOperand &MO)
 

Detailed Description

Analysis that tracks defined/used subregister lanes across COPY instructions and instructions that get lowered to a COPY (PHI, REG_SEQUENCE, INSERT_SUBREG, EXTRACT_SUBREG).

The information is used to detect dead definitions and the usage of (completely) undefined values and mark the operands as such. This pass is necessary because the dead/undef status is not obvious anymore when subregisters are involved.

Example: vreg0 = some definition vreg1 = IMPLICIT_DEF vreg2 = REG_SEQUENCE vreg0, sub0, vreg1, sub1 vreg3 = EXTRACT_SUBREG vreg2, sub1 = use vreg3 The vreg0 definition is dead and vreg3 contains an undefined value.

Definition in file DetectDeadLanes.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "detect-dead-lanes"

Definition at line 48 of file DetectDeadLanes.cpp.

Function Documentation

◆ isCrossCopy()

static bool isCrossCopy ( const MachineRegisterInfo MRI,
const MachineInstr MI,
const TargetRegisterClass DstRC,
const MachineOperand MO 
)
static

Definition at line 154 of file DetectDeadLanes.cpp.

References llvm::LaneBitmask::any(), assert(), llvm::TargetRegisterInfo::composeSubRegIndices(), llvm::TargetRegisterClass::CoveredBySubRegs, llvm::dbgs(), DEBUG, llvm::tgtok::Def, DefMI, llvm::MachineInstr::defs(), llvm::LaneBitmask::getAll(), llvm::TargetRegisterInfo::getCommonSubClass(), llvm::TargetRegisterInfo::getCommonSuperRegClass(), llvm::MachineInstr::getDesc(), llvm::MachineOperand::getImm(), llvm::TargetRegisterInfo::getMatchingSuperRegClass(), llvm::LaneBitmask::getNone(), llvm::MCInstrDesc::getNumDefs(), llvm::MachineInstr::getOpcode(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getOperandNo(), llvm::MachineOperand::getParent(), llvm::MachineOperand::getReg(), llvm::MachineRegisterInfo::getRegClass(), llvm::MachineFunction::getRegInfo(), llvm::MachineOperand::getSubReg(), llvm::MachineRegisterInfo::getTargetRegisterInfo(), llvm::TargetRegisterInfo::index2VirtReg(), llvm::MachineOperand::isDead(), llvm::MachineOperand::isDef(), llvm::MachineInstr::isImplicitDef(), llvm::MachineInstr::isKill(), llvm::TargetRegisterInfo::isPhysicalRegister(), llvm::MachineOperand::isReg(), llvm::MachineOperand::isUse(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::TargetRegisterClass::LaneMask, llvm_unreachable, lowersToCopies(), llvm::BitmaskEnumDetail::Mask(), MI, MRI, llvm::MachineInstr::operands(), llvm::PrintLaneMask(), llvm::PrintReg(), llvm::VRegInfo::RC, llvm::MachineOperand::readsReg(), llvm::MachineOperand::setIsDead(), llvm::MachineOperand::setIsUndef(), SubReg, UseMI, llvm::MachineInstr::uses(), and llvm::TargetRegisterInfo::virtReg2Index().

◆ lowersToCopies()

static bool lowersToCopies ( const MachineInstr MI)
static

Returns true if MI will get lowered to a series of COPY instructions.

We call this a COPY-like instruction.

Definition at line 139 of file DetectDeadLanes.cpp.

Referenced by isCrossCopy().