LLVM  8.0.1
Public Member Functions | Public Attributes | List of all members
PartialMapping Struct Reference

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

#include "llvm/CodeGen/GlobalISel/RegisterBankInfo.h"

Collaboration diagram for PartialMapping:
Collaboration graph
[legend]

Public Member Functions

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

Public Attributes

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

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 763 of file RegisterBankInfo.h.

Constructor & Destructor Documentation

◆ PartialMapping() [1/2]

PartialMapping::PartialMapping ( )
default

◆ PartialMapping() [2/2]

PartialMapping::PartialMapping ( unsigned  StartIdx,
unsigned  Length,
const RegisterBank &  RegBank 
)
inline

Provide a shortcut for quickly building PartialMapping.

Definition at line 780 of file RegisterBankInfo.h.

Member Function Documentation

◆ dump()

void PartialMapping::dump ( ) const

Print this partial mapping on dbgs() stream.

◆ getHighBitIdx()

unsigned 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 786 of file RegisterBankInfo.h.

◆ print()

void PartialMapping::print ( raw_ostream &  OS) const

Print this partial mapping on OS;.

◆ verify()

bool PartialMapping::verify ( ) 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.

Member Data Documentation

◆ Length

unsigned 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 772 of file RegisterBankInfo.h.

◆ RegBank

const RegisterBank* PartialMapping::RegBank

Register bank where the partial value lives.

Definition at line 775 of file RegisterBankInfo.h.

◆ StartIdx

unsigned 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 767 of file RegisterBankInfo.h.


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