LLVM 24.0.0git
llvm::Rematerializer::Reg Struct Reference

A rematerializable register defined by a single machine instruction. More...

#include "llvm/CodeGen/Rematerializer.h"

Public Types

using RegionUsers = SmallDenseSet<MachineInstr *, 4>

Public Member Functions

Register getDefReg () const
 Returns the rematerializable register from its defining instruction.
bool hasUsersInDefRegion () const
bool hasUsersOutsideDefRegion () const
LLVM_ABI std::pair< MachineInstr *, MachineInstr * > getRegionUseBounds (unsigned UseRegion, const LiveIntervals &LIS) const
 Returns the first and last user of the register in region UseRegion.
bool isAlive () const

Public Attributes

MachineInstrDefMI
 Single MI defining the rematerializable register.
unsigned DefRegion
 Defining region of DefMI.
LaneBitmask Mask
 The rematerializable register's lane bitmask.
SmallDenseMap< unsigned, RegionUsers, 2 > Uses
 Uses of the register, mapped by region.
SmallVector< RegisterIdx, 2 > Dependencies
 This register's rematerializable dependencies, one per unique rematerializable register operand.

Detailed Description

A rematerializable register defined by a single machine instruction.

A rematerializable register has a set of dependencies, which correspond to the unique read register operands of its defining instruction and which can themselves be rematerializable. Operand indices corresponding to unrematerializable dependencies are managed by and queried from the rematerializer, whereas rematerializable ones are part of this struct and identified through their register index.

A rematerializable register also has an arbitrary number of users in an arbitrary number of regions, potentially including its own defining region. When rematerializations lead to operand changes in users, a register may find itself without any user left, at which point the rematerializer deletes it (setting its defining MI to nullptr).

Definition at line 115 of file Rematerializer.h.

Member Typedef Documentation

◆ RegionUsers

Member Function Documentation

◆ getDefReg()

Register llvm::Rematerializer::Reg::getDefReg ( ) const
inline

Returns the rematerializable register from its defining instruction.

Definition at line 131 of file Rematerializer.h.

References assert(), and DefMI.

Referenced by llvm::Rematerializer::printID(), llvm::Rematerializer::printRematReg(), and llvm::Rematerializer::rematerializeReg().

◆ getRegionUseBounds()

std::pair< MachineInstr *, MachineInstr * > Rematerializer::Reg::getRegionUseBounds ( unsigned UseRegion,
const LiveIntervals & LIS ) const

Returns the first and last user of the register in region UseRegion.

If the register has no user in the region, returns a pair of nullptr's.

Definition at line 798 of file Rematerializer.cpp.

References assert(), and Uses.

Referenced by llvm::Rematerializer::rematerializeToRegion().

◆ hasUsersInDefRegion()

bool llvm::Rematerializer::Reg::hasUsersInDefRegion ( ) const
inline

Definition at line 137 of file Rematerializer.h.

References DefRegion, and Uses.

◆ hasUsersOutsideDefRegion()

bool llvm::Rematerializer::Reg::hasUsersOutsideDefRegion ( ) const
inline

Definition at line 141 of file Rematerializer.h.

References DefRegion, and Uses.

◆ isAlive()

bool llvm::Rematerializer::Reg::isAlive ( ) const
inline

Member Data Documentation

◆ DefMI

◆ DefRegion

◆ Dependencies

SmallVector<RegisterIdx, 2> llvm::Rematerializer::Reg::Dependencies

This register's rematerializable dependencies, one per unique rematerializable register operand.

Definition at line 128 of file Rematerializer.h.

Referenced by llvm::PreRARematStage::initGCNSchedStage(), and llvm::Rematerializer::rematerializeReg().

◆ Mask

LaneBitmask llvm::Rematerializer::Reg::Mask

The rematerializable register's lane bitmask.

Definition at line 121 of file Rematerializer.h.

Referenced by llvm::Rematerializer::rematerializeReg().

◆ Uses


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