LLVM  7.0.0
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:
[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::iterator & front ()
 
MachineBasicBlock::iterator & back ()
 
MachineFunction * getMF () const
 
MachineBasicBlock * getMBB () const
 
 Candidate (unsigned StartIdx, unsigned Len, MachineBasicBlock::iterator &FirstInst, MachineBasicBlock::iterator &LastInst, MachineBasicBlock *MBB, unsigned FunctionIdx)
 
 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...
 
bool InCandidateList = true
 Set to false if the candidate overlapped with another candidate. 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 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 38 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 
)
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

Definition at line 107 of file MachineOutliner.h.

Referenced by initLRU().

◆ front()

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

Definition at line 106 of file MachineOutliner.h.

Referenced by initLRU().

◆ getCallOverhead()

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

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

Definition at line 102 of file MachineOutliner.h.

◆ getEndIdx()

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

Return the end index of this candidate.

Definition at line 92 of file MachineOutliner.h.

◆ getLength()

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

Return the number of instructions in this Candidate.

Definition at line 86 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

Definition at line 108 of file MachineOutliner.h.

References llvm::MachineBasicBlock::getParent().

◆ getStartIdx()

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

Return the start index of this candidate.

Definition at line 89 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().

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

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

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

◆ FunctionIdx

unsigned llvm::outliner::Candidate::FunctionIdx

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

Definition at line 62 of file MachineOutliner.h.

◆ InCandidateList

bool llvm::outliner::Candidate::InCandidateList = true

Set to false if the candidate overlapped with another candidate.

Definition at line 65 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 76 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 83 of file MachineOutliner.h.


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