LLVM  8.0.1
Public Types | Public Member Functions | List of all members
llvm::RegBankSelect::RepairingPlacement Class Reference

Struct used to represent the placement of a repairing point for a given operand. More...

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

Public Types

enum  RepairingKind { None, Insert, Reassign, Impossible }
 Define the kind of action this repairing needs. More...
 
Convenient types for a list of insertion points.
using InsertionPoints = SmallVector< std::unique_ptr< InsertPoint >, 2 >
 
using insertpt_iterator = InsertionPoints::iterator
 
using const_insertpt_iterator = InsertionPoints::const_iterator
 

Public Member Functions

 RepairingPlacement (MachineInstr &MI, unsigned OpIdx, const TargetRegisterInfo &TRI, Pass &P, RepairingKind Kind=RepairingKind::Insert)
 Create a repairing placement for the OpIdx-th operand of MI. More...
 
void switchTo (RepairingKind NewKind)
 Change the type of this repairing placement to NewKind. More...
 
Getters.
RepairingKind getKind () const
 
unsigned getOpIdx () const
 
bool canMaterialize () const
 
bool hasSplit ()
 
Overloaded methods to add an insertion point.

Add a MBBInsertionPoint to the list of InsertPoints.

void addInsertPoint (MachineBasicBlock &MBB, bool Beginning)
 
void addInsertPoint (MachineInstr &MI, bool Before)
 Add a InstrInsertionPoint to the list of InsertPoints. More...
 
void addInsertPoint (MachineBasicBlock &Src, MachineBasicBlock &Dst)
 Add an EdgeInsertionPoint (Src, Dst) to the list of InsertPoints. More...
 
void addInsertPoint (InsertPoint &Point)
 Add an InsertPoint to the list of insert points. More...
 
Accessors related to the insertion points.
insertpt_iterator begin ()
 
insertpt_iterator end ()
 
const_insertpt_iterator begin () const
 
const_insertpt_iterator end () const
 
unsigned getNumInsertPoints () const
 

Detailed Description

Struct used to represent the placement of a repairing point for a given operand.

Definition at line 314 of file RegBankSelect.h.

Member Typedef Documentation

◆ const_insertpt_iterator

Definition at line 332 of file RegBankSelect.h.

◆ InsertionPoints

Definition at line 330 of file RegBankSelect.h.

◆ insertpt_iterator

Definition at line 331 of file RegBankSelect.h.

Member Enumeration Documentation

◆ RepairingKind

Define the kind of action this repairing needs.

Enumerator
None 

Nothing to repair, just drop this action.

Insert 

Reparing code needs to happen before InsertPoints.

Reassign 

(Re)assign the register bank of the operand.

Impossible 

Mark this repairing placement as impossible.

Definition at line 317 of file RegBankSelect.h.

Constructor & Destructor Documentation

◆ RepairingPlacement()

RegBankSelect::RepairingPlacement::RepairingPlacement ( MachineInstr MI,
unsigned  OpIdx,
const TargetRegisterInfo TRI,
Pass P,
RepairingPlacement::RepairingKind  Kind = RepairingKind::Insert 
)

Create a repairing placement for the OpIdx-th operand of MI.

TRI is used to make some checks on the register aliases if the machine operand is a physical register. P is used to to update liveness information and such when materializing the points.

Definition at line 656 of file RegBankSelect.cpp.

References addInsertPoint(), assert(), llvm::MachineBasicBlock::begin(), llvm::MachineBasicBlock::end(), llvm::MachineBasicBlock::getFirstNonPHI(), llvm::MachineBasicBlock::getLastNonDebugInstr(), llvm::MachineOperand::getMBB(), llvm::MachineInstr::getOperand(), llvm::MachineInstr::getParent(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isDef(), llvm::MachineInstr::isPHI(), llvm::MachineOperand::isReg(), llvm::MachineInstr::isTerminator(), MI, and llvm::MachineBasicBlock::rend().

Member Function Documentation

◆ addInsertPoint() [1/4]

void RegBankSelect::RepairingPlacement::addInsertPoint ( MachineBasicBlock MBB,
bool  Beginning 
)

Definition at line 755 of file RegBankSelect.cpp.

Referenced by addInsertPoint(), and RepairingPlacement().

◆ addInsertPoint() [2/4]

void RegBankSelect::RepairingPlacement::addInsertPoint ( MachineInstr MI,
bool  Before 
)

Add a InstrInsertionPoint to the list of InsertPoints.

Definition at line 750 of file RegBankSelect.cpp.

References addInsertPoint().

◆ addInsertPoint() [3/4]

void RegBankSelect::RepairingPlacement::addInsertPoint ( MachineBasicBlock Src,
MachineBasicBlock Dst 
)

Add an EdgeInsertionPoint (Src, Dst) to the list of InsertPoints.

Definition at line 760 of file RegBankSelect.cpp.

References addInsertPoint().

◆ addInsertPoint() [4/4]

void RegBankSelect::RepairingPlacement::addInsertPoint ( RegBankSelect::InsertPoint Point)

Add an InsertPoint to the list of insert points.

This method takes the ownership of &Point.

Definition at line 765 of file RegBankSelect.cpp.

References llvm::RegBankSelect::InsertPoint::canMaterialize(), llvm::SmallVectorImpl< T >::emplace_back(), and llvm::RegBankSelect::InsertPoint::isSplit().

◆ begin() [1/2]

insertpt_iterator llvm::RegBankSelect::RepairingPlacement::begin ( )
inline

◆ begin() [2/2]

const_insertpt_iterator llvm::RegBankSelect::RepairingPlacement::begin ( ) const
inline

◆ canMaterialize()

bool llvm::RegBankSelect::RepairingPlacement::canMaterialize ( ) const
inline

Definition at line 364 of file RegBankSelect.h.

Referenced by llvm::RegBankSelect::getAnalysisUsage().

◆ end() [1/2]

insertpt_iterator llvm::RegBankSelect::RepairingPlacement::end ( )
inline

◆ end() [2/2]

const_insertpt_iterator llvm::RegBankSelect::RepairingPlacement::end ( ) const
inline

◆ getKind()

RepairingKind llvm::RegBankSelect::RepairingPlacement::getKind ( ) const
inline

Definition at line 362 of file RegBankSelect.h.

Referenced by llvm::RegBankSelect::getAnalysisUsage().

◆ getNumInsertPoints()

unsigned llvm::RegBankSelect::RepairingPlacement::getNumInsertPoints ( ) const
inline

Definition at line 389 of file RegBankSelect.h.

References llvm::SmallVectorBase::size().

Referenced by llvm::RegBankSelect::getAnalysisUsage().

◆ getOpIdx()

unsigned llvm::RegBankSelect::RepairingPlacement::getOpIdx ( ) const
inline

Definition at line 363 of file RegBankSelect.h.

Referenced by llvm::RegBankSelect::getAnalysisUsage().

◆ hasSplit()

bool llvm::RegBankSelect::RepairingPlacement::hasSplit ( )
inline

Definition at line 365 of file RegBankSelect.h.

References MI.

Referenced by llvm::RegBankSelect::getAnalysisUsage().

◆ switchTo()

void llvm::RegBankSelect::RepairingPlacement::switchTo ( RepairingKind  NewKind)
inline

Change the type of this repairing placement to NewKind.

It is not possible to switch a repairing placement to the RepairingKind::Insert. There is no fundamental problem with that, but no uses as well, so do not support it for now.

Precondition
NewKind != RepairingKind::Insert
Postcondition
getKind() == NewKind

Definition at line 399 of file RegBankSelect.h.

References llvm::applyMapping(), assert(), llvm::SmallVectorImpl< T >::clear(), llvm::Pass::dump(), llvm::RegBankSelect::Fast, MI, MORE, MRI, llvm::operator!=(), llvm::operator<(), llvm::operator<<(), llvm::operator==(), llvm::operator>(), llvm::Pass::print(), Reg, llvm::RegBankSelect::RegBankSelect(), and TRI.

Referenced by llvm::RegBankSelect::getAnalysisUsage().


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