LLVM  9.0.0svn
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
 
 Candidate (unsigned StartIdx, unsigned Len, MachineBasicBlock::iterator &FirstInst, MachineBasicBlock::iterator &LastInst, MachineBasicBlock *MBB, unsigned FunctionIdx, unsigned Flags)
 
 Candidate ()
 
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...
 
void initLRU (const TargetRegisterInfo &TRI)
 Compute the registers that are live across this Candidate. More...
 

Public Attributes

unsigned FunctionIdx
 The index of this Candidate's OutlinedFunction in the list of OutlinedFunctions. More...
 
unsigned CallConstructionID
 Identifier denoting the instructions to emit to call an outlined function from this point. More...
 
LiveRegUnits LRU
 Contains physical register liveness information for the MBB containing this Candidate. More...
 
LiveRegUnits UsedInSequence
 Contains the accumulated register liveness information for the instructions in this Candidate. More...
 
unsigned Flags = 0x0
 Target-specific flags for this Candidate's MBB. More...
 
bool LRUWasSet = false
 True if initLRU has been called on this Candidate. 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 120 of file MachineOutliner.h.

◆ Candidate() [2/2]

llvm::outliner::Candidate::Candidate ( )
inline

Definition at line 126 of file MachineOutliner.h.

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 104 of file MachineOutliner.h.

◆ getEndIdx()

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

Return the end index of this candidate.

Definition at line 94 of file MachineOutliner.h.

◆ getLength()

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

Return the number of instructions in this Candidate.

Definition at line 88 of file MachineOutliner.h.

◆ getMBB()

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

Definition at line 109 of file MachineOutliner.h.

◆ getMF()

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

◆ getStartIdx()

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

Return the start index of this candidate.

Definition at line 91 of file MachineOutliner.h.

Referenced by operator<().

◆ initLRU()

void llvm::outliner::Candidate::initLRU ( const TargetRegisterInfo TRI)
inline

Compute the registers that are live across this Candidate.

Used by targets that need this information for cost model calculation. If a target does not need this information, then this should not be called.

Definition at line 138 of file MachineOutliner.h.

References llvm::LiveRegUnits::accumulate(), llvm::LiveRegUnits::addLiveOuts(), assert(), back(), llvm::for_each(), front(), llvm::MachineBasicBlock::getParent(), llvm::MachineFunction::getRegInfo(), llvm::LiveRegUnits::init(), MI, llvm::MachineBasicBlock::rbegin(), llvm::LiveRegUnits::stepBackward(), and llvm::MachineRegisterInfo::tracksLiveness().

Referenced by llvm::AArch64InstrInfo::getOutliningCandidateInfo().

◆ 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 130 of file MachineOutliner.h.

References getStartIdx().

◆ 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 98 of file MachineOutliner.h.

Referenced by llvm::AArch64InstrInfo::getOutliningCandidateInfo().

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 118 of file MachineOutliner.h.

◆ CallConstructionID

unsigned llvm::outliner::Candidate::CallConstructionID

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

Defined by the target.

Definition at line 65 of file MachineOutliner.h.

Referenced by llvm::AArch64InstrInfo::insertOutlinedCall(), and llvm::X86InstrInfo::insertOutlinedCall().

◆ Flags

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

Target-specific flags for this Candidate's MBB.

Definition at line 82 of file MachineOutliner.h.

◆ FunctionIdx

unsigned llvm::outliner::Candidate::FunctionIdx

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

Definition at line 61 of file MachineOutliner.h.

◆ LRU

LiveRegUnits llvm::outliner::Candidate::LRU

Contains physical register liveness information for the MBB containing this Candidate.

This is optionally used by the target to calculate more fine-grained cost model information.

Definition at line 72 of file MachineOutliner.h.

Referenced by llvm::AArch64InstrInfo::getOutliningCandidateInfo().

◆ LRUWasSet

bool llvm::outliner::Candidate::LRUWasSet = false

True if initLRU has been called on this Candidate.

Definition at line 85 of file MachineOutliner.h.

◆ UsedInSequence

LiveRegUnits llvm::outliner::Candidate::UsedInSequence

Contains the accumulated register liveness information for the instructions in this Candidate.

This is optionally used by the target to determine which registers have been used across the sequence.

Definition at line 79 of file MachineOutliner.h.

Referenced by llvm::AArch64InstrInfo::getOutliningCandidateInfo().


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