LLVM 20.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::RegisterBankInfo::PartialMapping Struct Reference

Helper struct that represents how a value is partially mapped into a register. More...

#include "llvm/CodeGen/RegisterBankInfo.h"

Public Member Functions

 PartialMapping ()=default
 
constexpr PartialMapping (unsigned StartIdx, unsigned Length, const RegisterBank &RegBank)
 Provide a shortcut for quickly building PartialMapping.
 
unsigned getHighBitIdx () const
 
void dump () const
 Print this partial mapping on dbgs() stream.
 
void print (raw_ostream &OS) const
 Print this partial mapping on OS;.
 
bool verify (const RegisterBankInfo &RBI) const
 Check that the Mask is compatible with the RegBank.
 

Public Attributes

unsigned StartIdx
 Number of bits at which this partial mapping starts in the original value.
 
unsigned Length
 Length of this mapping in bits.
 
const RegisterBankRegBank
 Register bank where the partial value lives.
 

Detailed Description

Helper struct that represents how a value is partially mapped into a register.

The StartIdx and Length represent what region of the orginal value this partial mapping covers. This can be represented as a Mask of contiguous bit starting at StartIdx bit and spanning Length bits. StartIdx is the number of bits from the less significant bits.

Definition at line 49 of file RegisterBankInfo.h.

Constructor & Destructor Documentation

◆ PartialMapping() [1/2]

llvm::RegisterBankInfo::PartialMapping::PartialMapping ( )
default

◆ PartialMapping() [2/2]

constexpr llvm::RegisterBankInfo::PartialMapping::PartialMapping ( unsigned  StartIdx,
unsigned  Length,
const RegisterBank RegBank 
)
inlineconstexpr

Provide a shortcut for quickly building PartialMapping.

Definition at line 66 of file RegisterBankInfo.h.

Member Function Documentation

◆ dump()

LLVM_DUMP_METHOD void RegisterBankInfo::PartialMapping::dump ( ) const

Print this partial mapping on dbgs() stream.

Definition at line 517 of file RegisterBankInfo.cpp.

References llvm::dbgs(), and print().

◆ getHighBitIdx()

unsigned llvm::RegisterBankInfo::PartialMapping::getHighBitIdx ( ) const
inline
Returns
the index of in the original value of the most significant bit that this partial mapping covers.

Definition at line 72 of file RegisterBankInfo.h.

References Length, and StartIdx.

Referenced by llvm::RegisterBankInfo::ValueMapping::verify().

◆ print()

void RegisterBankInfo::PartialMapping::print ( raw_ostream OS) const

Print this partial mapping on OS;.

Definition at line 534 of file RegisterBankInfo.cpp.

References OS.

Referenced by dump(), and llvm::operator<<().

◆ verify()

bool RegisterBankInfo::PartialMapping::verify ( const RegisterBankInfo RBI) const

Check that the Mask is compatible with the RegBank.

Indeed, if the RegBank cannot accomadate the "active bits" of the mask, there is no way this mapping is valid.

Note
This method does not check anything when assertions are disabled.
Returns
True is the check was successful.

Definition at line 523 of file RegisterBankInfo.cpp.

References assert(), llvm::RegisterBankInfo::getMaximumSize(), and llvm::Length.

Referenced by llvm::RegisterBankInfo::ValueMapping::verify().

Member Data Documentation

◆ Length

unsigned llvm::RegisterBankInfo::PartialMapping::Length

Length of this mapping in bits.

This is how many bits this partial mapping covers in the original value: from StartIdx to StartIdx + Length -1.

Definition at line 58 of file RegisterBankInfo.h.

Referenced by llvm::ARM::checkPartMapping(), llvm::RegisterBankInfo::OperandsMapper::createVRegs(), llvm::AMDGPURegisterBankInfo::getBreakDownCost(), getHighBitIdx(), llvm::hash_value(), and llvm::RegBankSelect::repairReg().

◆ RegBank

const RegisterBank* llvm::RegisterBankInfo::PartialMapping::RegBank

◆ StartIdx

unsigned llvm::RegisterBankInfo::PartialMapping::StartIdx

Number of bits at which this partial mapping starts in the original value.

The bits are counted from less significant bits to most significant bits.

Definition at line 53 of file RegisterBankInfo.h.

Referenced by llvm::ARM::checkPartMapping(), llvm::AMDGPURegisterBankInfo::getBreakDownCost(), getHighBitIdx(), llvm::hash_value(), and llvm::RegisterBankInfo::ValueMapping::verify().


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