LLVM  15.0.0git
Public Member Functions | Public Attributes | List of all members
llvm::outliner::Candidate Struct Reference

An individual sequence of instructions to be replaced with a call to an outlined function. More...

#include "llvm/CodeGen/MachineOutliner.h"

Collaboration diagram for llvm::outliner::Candidate:
Collaboration graph
[legend]

Public Member Functions

unsigned getLength () const
 Return the number of instructions in this Candidate. More...
 
unsigned getStartIdx () const
 Return the start index of this candidate. More...
 
unsigned getEndIdx () const
 Return the end index of this candidate. More...
 
void setCallInfo (unsigned CID, unsigned CO)
 Set the CallConstructionID and CallOverhead of this candidate to CID and CO respectively. More...
 
unsigned getCallOverhead () const
 Returns the call overhead of this candidate if it is in the list. More...
 
MachineBasicBlock::iteratorfront ()
 
MachineBasicBlock::iteratorback ()
 
MachineFunctiongetMF () const
 
MachineBasicBlockgetMBB () const
 
bool isAvailableAcrossAndOutOfSeq (Register Reg, const TargetRegisterInfo &TRI)
 
bool isAnyUnavailableAcrossOrOutOfSeq (std::initializer_list< Register > Regs, const TargetRegisterInfo &TRI)
 
bool isAvailableInsideSeq (Register Reg, const TargetRegisterInfo &TRI)
 
 Candidate (unsigned StartIdx, unsigned Len, MachineBasicBlock::iterator &FirstInst, MachineBasicBlock::iterator &LastInst, MachineBasicBlock *MBB, unsigned FunctionIdx, unsigned Flags)
 
 Candidate ()=default
 
bool operator< (const Candidate &RHS) const
 Used to ensure that Candidates are outlined in an order that preserves the start and end indices of other Candidates. More...
 

Public Attributes

unsigned FunctionIdx = 0
 The index of this Candidate's OutlinedFunction in the list of OutlinedFunctions. More...
 
unsigned CallConstructionID = 0
 Identifier denoting the instructions to emit to call an outlined function from this point. More...
 
unsigned Flags = 0x0
 Target-specific flags for this Candidate's MBB. More...
 
unsigned Benefit = 0
 The number of instructions that would be saved by outlining every candidate of this type. More...
 

Detailed Description

An individual sequence of instructions to be replaced with a call to an outlined function.

Definition at line 37 of file MachineOutliner.h.

Constructor & Destructor Documentation

◆ Candidate() [1/2]

llvm::outliner::Candidate::Candidate ( unsigned  StartIdx,
unsigned  Len,
MachineBasicBlock::iterator FirstInst,
MachineBasicBlock::iterator LastInst,
MachineBasicBlock MBB,
unsigned  FunctionIdx,
unsigned  Flags 
)
inline

Definition at line 196 of file MachineOutliner.h.

References MBB.

◆ Candidate() [2/2]

llvm::outliner::Candidate::Candidate ( )
default

Member Function Documentation

◆ back()

MachineBasicBlock::iterator& llvm::outliner::Candidate::back ( )
inline

◆ front()

MachineBasicBlock::iterator& llvm::outliner::Candidate::front ( )
inline

◆ getCallOverhead()

unsigned llvm::outliner::Candidate::getCallOverhead ( ) const
inline

Returns the call overhead of this candidate if it is in the list.

Definition at line 136 of file MachineOutliner.h.

◆ getEndIdx()

unsigned llvm::outliner::Candidate::getEndIdx ( ) const
inline

Return the end index of this candidate.

Definition at line 126 of file MachineOutliner.h.

◆ getLength()

unsigned llvm::outliner::Candidate::getLength ( ) const
inline

Return the number of instructions in this Candidate.

Definition at line 120 of file MachineOutliner.h.

◆ getMBB()

MachineBasicBlock* llvm::outliner::Candidate::getMBB ( ) const
inline

Definition at line 141 of file MachineOutliner.h.

References MBB.

◆ getMF()

MachineFunction* llvm::outliner::Candidate::getMF ( ) const
inline

Definition at line 140 of file MachineOutliner.h.

References MBB.

Referenced by llvm::TargetInstrInfo::mergeOutliningCandidateAttributes().

◆ getStartIdx()

unsigned llvm::outliner::Candidate::getStartIdx ( ) const
inline

Return the start index of this candidate.

Definition at line 123 of file MachineOutliner.h.

Referenced by operator<().

◆ isAnyUnavailableAcrossOrOutOfSeq()

bool llvm::outliner::Candidate::isAnyUnavailableAcrossOrOutOfSeq ( std::initializer_list< Register Regs,
const TargetRegisterInfo TRI 
)
inline
Returns
True if isAvailableAcrossAndOutOfSeq fails for any register in Regs.

Definition at line 164 of file MachineOutliner.h.

References llvm::any_of(), llvm::LiveRegUnits::available(), and TRI.

◆ isAvailableAcrossAndOutOfSeq()

bool llvm::outliner::Candidate::isAvailableAcrossAndOutOfSeq ( Register  Reg,
const TargetRegisterInfo TRI 
)
inline
Returns
True if Reg is available from the end of the block to the beginning of the sequence.

This query considers the following range:

in_seq_1 in_seq_2 ... in_seq_n not_in_seq_1 ... <end of block>

Definition at line 155 of file MachineOutliner.h.

References llvm::LiveRegUnits::available(), and TRI.

◆ isAvailableInsideSeq()

bool llvm::outliner::Candidate::isAvailableInsideSeq ( Register  Reg,
const TargetRegisterInfo TRI 
)
inline
Returns
True if Reg is available within the sequence itself.

This query considers the following range:

in_seq_1 in_seq_2 ... in_seq_n

Definition at line 181 of file MachineOutliner.h.

References llvm::LiveRegUnits::available(), and TRI.

◆ operator<()

bool llvm::outliner::Candidate::operator< ( const Candidate RHS) const
inline

Used to ensure that Candidates are outlined in an order that preserves the start and end indices of other Candidates.

Definition at line 206 of file MachineOutliner.h.

References getStartIdx(), and RHS.

◆ setCallInfo()

void llvm::outliner::Candidate::setCallInfo ( unsigned  CID,
unsigned  CO 
)
inline

Set the CallConstructionID and CallOverhead of this candidate to CID and CO respectively.

Definition at line 130 of file MachineOutliner.h.

References CallConstructionID.

Member Data Documentation

◆ Benefit

unsigned llvm::outliner::Candidate::Benefit = 0

The number of instructions that would be saved by outlining every candidate of this type.

This is a fixed value which is not updated during the candidate pruning process. It is only used for deciding which candidate to keep if two candidates overlap. The true benefit is stored in the OutlinedFunction for some given candidate.

Definition at line 194 of file MachineOutliner.h.

◆ CallConstructionID

unsigned llvm::outliner::Candidate::CallConstructionID = 0

Identifier denoting the instructions to emit to call an outlined function from this point.

Defined by the target.

Definition at line 114 of file MachineOutliner.h.

Referenced by setCallInfo().

◆ Flags

unsigned llvm::outliner::Candidate::Flags = 0x0

Target-specific flags for this Candidate's MBB.

Definition at line 117 of file MachineOutliner.h.

◆ FunctionIdx

unsigned llvm::outliner::Candidate::FunctionIdx = 0

The index of this Candidate's OutlinedFunction in the list of OutlinedFunctions.

Definition at line 110 of file MachineOutliner.h.


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