LLVM 24.0.0git
llvm::RegisterOperands Class Reference

List of registers defined and used by a machine instruction. More...

#include "llvm/CodeGen/RegisterPressure.h"

Public Member Functions

LLVM_ABI void collect (const MachineInstr &MI, const TargetRegisterInfo &TRI, const MachineRegisterInfo &MRI, bool TrackLaneMasks, bool IgnoreDead)
 Analyze the given instruction MI and fill in the Uses, Defs and DeadDefs list based on the MachineOperand flags.
LLVM_ABI void detectDeadDefs (const MachineInstr &MI, const LiveIntervals &LIS, const MachineRegisterInfo &MRI)
 Use liveness information to find dead defs at MI's dead slot not marked with a dead flag and move them to the DeadDefs vector.
LLVM_ABI void adjustLaneLiveness (const LiveIntervals &LIS, const MachineRegisterInfo &MRI, SlotIndex Pos)
 Use liveness information to find out which uses/defs are partially undefined/dead at Pos and adjust the VRegMaskOrUnits accordingly.
LLVM_ABI void adjustLaneLiveness (const LiveIntervals &LIS, const MachineRegisterInfo &MRI, MachineInstr &MI)
 Use liveness information to find out which uses/defs are partially undefined/dead at the MI's position and adjust the VRegMaskOrUnits accordingly.

Public Attributes

SmallVector< VRegMaskOrUnit, 8 > Uses
 List of virtual registers and register units read by the instruction.
SmallVector< VRegMaskOrUnit, 8 > Defs
 List of virtual registers and register units defined by the instruction which are not dead.
SmallVector< VRegMaskOrUnit, 8 > DeadDefs
 List of virtual registers and register units defined by the instruction but dead.

Detailed Description

List of registers defined and used by a machine instruction.

Definition at line 167 of file RegisterPressure.h.

Member Function Documentation

◆ adjustLaneLiveness() [1/2]

void RegisterOperands::adjustLaneLiveness ( const LiveIntervals & LIS,
const MachineRegisterInfo & MRI,
MachineInstr & MI )

Use liveness information to find out which uses/defs are partially undefined/dead at the MI's position and adjust the VRegMaskOrUnits accordingly.

Missing read-undef and dead flags are added to MI.

Definition at line 594 of file RegisterPressure.cpp.

References llvm::VirtRegOrUnit::asVirtualReg(), llvm::SmallVectorTemplateCommon< T, typename >::back(), DeadDefs, Defs, llvm::SlotIndex::getDeadSlot(), llvm::LiveIntervals::getInstructionIndex(), llvm::LiveIntervals::getInterval(), getLiveLanesAt(), llvm::MachineRegisterInfo::getTargetRegisterInfo(), I, llvm::VirtRegOrUnit::isVirtualReg(), MI, llvm::LaneBitmask::none(), P, llvm::LiveRange::segments, and TRI.

◆ adjustLaneLiveness() [2/2]

◆ collect()

◆ detectDeadDefs()

void RegisterOperands::detectDeadDefs ( const MachineInstr & MI,
const LiveIntervals & LIS,
const MachineRegisterInfo & MRI )

Use liveness information to find dead defs at MI's dead slot not marked with a dead flag and move them to the DeadDefs vector.

This only considers the merged live interval for defs, not the per-lane sub-ranges.

Definition at line 572 of file RegisterPressure.cpp.

References Defs, llvm::SlotIndex::getDeadSlot(), llvm::LiveIntervals::getInstructionIndex(), getLiveLanesAt(), I, and MI.

Referenced by llvm::RegPressureTracker::bumpUpwardPressure(), llvm::GCNSchedStage::modifyRegionSchedule(), llvm::RegPressureTracker::recede(), and llvm::ScheduleDAGMILive::scheduleMI().

Member Data Documentation

◆ DeadDefs

SmallVector<VRegMaskOrUnit, 8> llvm::RegisterOperands::DeadDefs

List of virtual registers and register units defined by the instruction but dead.

Dead definitions should not necessarily be marked with a dead flag. In this context a dead definition is just a definition which doesn't define any register lane that remains live after the defining instruction.

Definition at line 179 of file RegisterPressure.h.

Referenced by adjustLaneLiveness(), llvm::RegPressureTracker::advance(), llvm::RegPressureTracker::bumpDownwardPressure(), llvm::RegPressureTracker::bumpUpwardPressure(), and llvm::RegPressureTracker::recede().

◆ Defs

◆ Uses


The documentation for this class was generated from the following files: