LLVM 19.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::DomainValue Struct Reference

A DomainValue is a bit like LiveIntervals' ValNo, but it also keeps track of execution domains. More...

#include "llvm/CodeGen/ExecutionDomainFix.h"

Public Member Functions

 DomainValue ()
 
bool isCollapsed () const
 A collapsed DomainValue has no instructions to twiddle - it simply keeps track of the domains where the registers are already available.
 
bool hasDomain (unsigned domain) const
 Is domain available?
 
void addDomain (unsigned domain)
 Mark domain as available.
 
void setSingleDomain (unsigned domain)
 
unsigned getCommonDomains (unsigned mask) const
 Return bitmask of domains that are available and in mask.
 
unsigned getFirstDomain () const
 First domain available.
 
void clear ()
 Clear this DomainValue and point to next which has all its data.
 

Public Attributes

unsigned Refs = 0
 Basic reference counting.
 
unsigned AvailableDomains
 Bitmask of available domains.
 
DomainValueNext
 Pointer to the next DomainValue in a chain.
 
SmallVector< MachineInstr *, 8 > Instrs
 Twiddleable instructions using or defining these registers.
 

Detailed Description

A DomainValue is a bit like LiveIntervals' ValNo, but it also keeps track of execution domains.

An open DomainValue represents a set of instructions that can still switch execution domain. Multiple registers may refer to the same open DomainValue - they will eventually be collapsed to the same execution domain.

A collapsed DomainValue represents a single register that has been forced into one of more execution domains. There is a separate collapsed DomainValue for each register, but it may contain multiple execution domains. A register value is initially created in a single execution domain, but if we were forced to pay the penalty of a domain crossing, we keep track of the fact that the register is now available in multiple domains.

Definition at line 51 of file ExecutionDomainFix.h.

Constructor & Destructor Documentation

◆ DomainValue()

llvm::DomainValue::DomainValue ( )
inline

Definition at line 68 of file ExecutionDomainFix.h.

References clear().

Member Function Documentation

◆ addDomain()

void llvm::DomainValue::addDomain ( unsigned  domain)
inline

Mark domain as available.

Definition at line 83 of file ExecutionDomainFix.h.

References assert(), and AvailableDomains.

◆ clear()

void llvm::DomainValue::clear ( )
inline

Clear this DomainValue and point to next which has all its data.

Definition at line 109 of file ExecutionDomainFix.h.

References AvailableDomains, Instrs, and Next.

Referenced by DomainValue().

◆ getCommonDomains()

unsigned llvm::DomainValue::getCommonDomains ( unsigned  mask) const
inline

Return bitmask of domains that are available and in mask.

Definition at line 99 of file ExecutionDomainFix.h.

References AvailableDomains.

◆ getFirstDomain()

unsigned llvm::DomainValue::getFirstDomain ( ) const
inline

First domain available.

Definition at line 104 of file ExecutionDomainFix.h.

References AvailableDomains, and llvm::countr_zero().

◆ hasDomain()

bool llvm::DomainValue::hasDomain ( unsigned  domain) const
inline

Is domain available?

Definition at line 75 of file ExecutionDomainFix.h.

References assert(), and AvailableDomains.

◆ isCollapsed()

bool llvm::DomainValue::isCollapsed ( ) const
inline

A collapsed DomainValue has no instructions to twiddle - it simply keeps track of the domains where the registers are already available.

Definition at line 72 of file ExecutionDomainFix.h.

References Instrs.

◆ setSingleDomain()

void llvm::DomainValue::setSingleDomain ( unsigned  domain)
inline

Definition at line 91 of file ExecutionDomainFix.h.

References assert(), and AvailableDomains.

Member Data Documentation

◆ AvailableDomains

unsigned llvm::DomainValue::AvailableDomains

Bitmask of available domains.

For an open DomainValue, it is the still possible domains for collapsing. For a collapsed DomainValue it is the domains where the register is available for free.

Definition at line 58 of file ExecutionDomainFix.h.

Referenced by addDomain(), clear(), getCommonDomains(), getFirstDomain(), hasDomain(), and setSingleDomain().

◆ Instrs

SmallVector<MachineInstr *, 8> llvm::DomainValue::Instrs

Twiddleable instructions using or defining these registers.

Definition at line 66 of file ExecutionDomainFix.h.

Referenced by clear(), and isCollapsed().

◆ Next

DomainValue* llvm::DomainValue::Next

Pointer to the next DomainValue in a chain.

When two DomainValues are merged, Victim.Next is set to point to Victor, so old DomainValue references can be updated by following the chain.

Definition at line 63 of file ExecutionDomainFix.h.

Referenced by clear().

◆ Refs

unsigned llvm::DomainValue::Refs = 0

Basic reference counting.

Definition at line 53 of file ExecutionDomainFix.h.


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