LLVM 22.0.0git
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...

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.
static bool isCrossCopy (const MachineRegisterInfo &MRI, const MachineInstr &MI, const TargetRegisterClass *DstRC, const MachineOperand &MO)
 INITIALIZE_PASS (DetectDeadLanesLegacy, DEBUG_TYPE, "Detect Dead Lanes", false, false) bool DetectDeadLanes

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: %0 = some definition %1 = IMPLICIT_DEF %2 = REG_SEQUENCE %0, sub0, %1, sub1 %3 = EXTRACT_SUBREG %2, sub1 = use %3 The %0 definition is dead and %3 contains an undefined value.

Definition in file DetectDeadLanes.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "detect-dead-lanes"

Definition at line 39 of file DetectDeadLanes.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( DetectDeadLanesLegacy ,
DEBUG_TYPE ,
"Detect Dead Lanes" ,
false ,
false  )

Definition at line 421 of file DetectDeadLanes.cpp.

References const, DEBUG_TYPE, SubReg, and TRI.

◆ isCrossCopy()

◆ lowersToCopies()

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 52 of file DetectDeadLanes.cpp.

References MI.

Referenced by isCrossCopy(), and llvm::DeadLaneDetector::transferUsedLanes().