LLVM: llvm::FunctionLoweringInfo Class Reference (original) (raw)

FunctionLoweringInfo - This contains information that is global to a function that is used when lowering a region of the function. More...

#include "[llvm/CodeGen/FunctionLoweringInfo.h](FunctionLoweringInfo%5F8h%5Fsource.html)"

Public Types
using StatepointSpillMapTy
Keep track of each value which was relocated and the strategy used to relocate that value.
Public Member Functions
const Value * getValueFromVirtualReg (Register Vreg)
This method is called from TargetLowerinInfo::isSDNodeSourceOfDivergence to get the Value corresponding to the live-in virtual register.
void set (const Function &Fn, MachineFunction &MF, SelectionDAG *DAG)
set - Initialize this FunctionLoweringInfo with the given Function and its associated MachineFunction.
void clear ()
clear - Clear out all the function-specific state.
bool isExportedInst (const Value *V) const
isExportedInst - Return true if the specified value is an instruction exported from its block.
MachineBasicBlock * getMBB (const BasicBlock *BB) const
Register CreateReg (MVT VT, bool isDivergent=false)
CreateReg - Allocate a single virtual register for the given type.
Register CreateRegs (const Value *V)
Register CreateRegs (Type *Ty, bool isDivergent=false)
CreateRegs - Allocate the appropriate number of virtual registers of the correctly promoted or expanded types.
Register InitializeRegForValue (const Value *V)
const LiveOutInfo * GetLiveOutRegInfo (Register Reg)
GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the register is a PHI destination and the PHI's LiveOutInfo is not valid.
const LiveOutInfo * GetLiveOutRegInfo (Register Reg, unsigned BitWidth)
GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the register is a PHI destination and the PHI's LiveOutInfo is not valid.
void AddLiveOutRegInfo (Register Reg, unsigned NumSignBits, const KnownBits &Known)
AddLiveOutRegInfo - Adds LiveOutInfo for a register.
void ComputePHILiveOutRegInfo (const PHINode *)
ComputePHILiveOutRegInfo - Compute LiveOutInfo for a PHI's destination register based on the LiveOutInfo of its operands.
void InvalidatePHILiveOutRegInfo (const PHINode *PN)
InvalidatePHILiveOutRegInfo - Invalidates a PHI's LiveOutInfo, to be called when a block is visited before all of its predecessors.
void setArgumentFrameIndex (const Argument *A, int FI)
setArgumentFrameIndex - Record frame index for the byval argument.
int getArgumentFrameIndex (const Argument *A)
getArgumentFrameIndex - Get frame index for the byval argument.
Register getCatchPadExceptionPointerVReg (const Value *CPI, const TargetRegisterClass *RC)
void setCurrentCallSite (unsigned Site)
Set the call site currently being processed.
unsigned getCurrentCallSite ()
Get the call site currently being processed, if any. Return zero if none.
Public Attributes
const Function * Fn
MachineFunction * MF
const TargetLowering * TLI
MachineRegisterInfo * RegInfo
BranchProbabilityInfo * BPI
const UniformityInfo * UA
bool CanLowerReturn
CanLowerReturn - true iff the function's return value can be lowered to registers.
bool SplitCSR
True if part of the CSRs will be handled via explicit copies.
Register DemoteRegister
DemoteRegister - if CanLowerReturn is false, DemoteRegister is a vreg allocated to hold a pointer to the hidden sret parameter.
SmallVector< MachineBasicBlock * > MBBMap
A mapping from LLVM basic block number to their machine block.
DenseMap< const Value *, Register > ValueMap
ValueMap - Since we emit code for the function a basic block at a time, we must remember which virtual registers hold the values for cross-basic-block values.
DenseMap< Register, const Value * > VirtReg2Value
VirtReg2Value map is needed by the Divergence Analysis driven instruction selection.
DenseMap< const Value *, Register > CatchPadExceptionPointers
Track virtual registers created for exception pointers.
DenseMap< const Instruction *, StatepointSpillMapTy > StatepointRelocationMaps
DenseMap< const AllocaInst *, int > StaticAllocaMap
StaticAllocaMap - Keep track of frame indices for fixed sized allocas in the entry block.
DenseMap< const Argument *, int > ByValArgFrameIndexMap
ByValArgFrameIndexMap - Keep track of frame indices for byval arguments.
SmallVector< MachineInstr *, 8 > ArgDbgValues
ArgDbgValues - A list of DBG_VALUE instructions created during isel for function arguments that are inserted after scheduling is completed.
BitVector DescribedArgs
Bitvector with a bit set if corresponding argument is described in ArgDbgValues.
DenseMap< Register, Register > RegFixups
RegFixups - Registers which need to be replaced after isel is done.
DenseSet< Register > RegsWithFixups
SmallVector< unsigned, 50 > StatepointStackSlots
StatepointStackSlots - A list of temporary stack slots (frame indices) used to spill values at a statepoint.
MachineBasicBlock * MBB
MBB - The current block.
MachineBasicBlock::iterator InsertPt
MBB - The current insert position inside the current block.
DenseMap< const Value *, ISD::NodeType > PreferredExtendType
Record the preferred extend type (ISD::SIGN_EXTEND or ISD::ZERO_EXTEND) for a value.
SmallVector< bool > VisitedBBs
The set of basic blocks visited thus far by instruction selection.
std::vector< std::pair< MachineInstr *, Register > > PHINodesToUpdate
PHINodesToUpdate - A list of phi instructions whose operand list will be updated after processing the current basic block.
unsigned OrigNumPHINodesToUpdate
Register ExceptionPointerVirtReg
If the current MBB is a landing pad, the exception pointer and exception selector registers are copied into these virtual registers by SelectionDAGISel::PrepareEHLandingPad().
Register ExceptionSelectorVirtReg
unsigned CurCallSite = 0
The current call site index being processed, if any. 0 if none.
SmallPtrSet< const DbgVariableRecord *, 8 > PreprocessedDVRDeclares
Collection of dbg_declare instructions handled after argument lowering and before ISel proper.

FunctionLoweringInfo - This contains information that is global to a function that is used when lowering a region of the function.

Definition at line 56 of file FunctionLoweringInfo.h.

StatepointSpillMapTy

Initial value:

Keep track of each value which was relocated and the strategy used to relocate that value.

This information is required when visiting gc.relocates which may appear in following blocks.

Definition at line 125 of file FunctionLoweringInfo.h.

AddLiveOutRegInfo()

clear()

void FunctionLoweringInfo::clear ( )

clear - Clear out all the function-specific state.

This returns this FunctionLoweringInfo to an empty state, ready to be used for a different function.

Definition at line 357 of file FunctionLoweringInfo.cpp.

References ArgDbgValues, ByValArgFrameIndexMap, DescribedArgs, MBBMap, PreferredExtendType, PreprocessedDVRDeclares, RegFixups, RegsWithFixups, StatepointRelocationMaps, StatepointStackSlots, StaticAllocaMap, ValueMap, VirtReg2Value, and VisitedBBs.

ComputePHILiveOutRegInfo()

void FunctionLoweringInfo::ComputePHILiveOutRegInfo ( const PHINode * PN )

ComputePHILiveOutRegInfo - Compute LiveOutInfo for a PHI's destination register based on the LiveOutInfo of its operands.

Definition at line 443 of file FunctionLoweringInfo.cpp.

References assert(), llvm::BitWidth, llvm::ComputeValueVTs(), llvm::dyn_cast(), llvm::APInt::getBitWidth(), llvm::Value::getContext(), llvm::PHINode::getIncomingValue(), GetLiveOutRegInfo(), llvm::PHINode::getNumIncomingValues(), llvm::APInt::getNumSignBits(), llvm::EVT::getSizeInBits(), llvm::Value::getType(), llvm::KnownBits::intersectWith(), llvm::isa(), llvm::FunctionLoweringInfo::LiveOutInfo::IsValid, llvm::Register::isVirtual(), llvm::FunctionLoweringInfo::LiveOutInfo::Known, llvm::KnownBits::makeConstant(), MF, llvm::FunctionLoweringInfo::LiveOutInfo::NumSignBits, llvm::KnownBits::One, llvm::APInt::sext(), llvm::SmallVectorTemplateCommon< T, typename >::size(), TLI, ValueMap, llvm::KnownBits::Zero, and llvm::APInt::zext().

CreateReg()

Register FunctionLoweringInfo::CreateReg ( MVT VT,
bool isDivergent = false )

CreateRegs() [1/2]

CreateRegs() [2/2]

Register FunctionLoweringInfo::CreateRegs ( Type * Ty,
bool isDivergent = false )

CreateRegs - Allocate the appropriate number of virtual registers of the correctly promoted or expanded types.

Assign these registers consecutive vreg numbers and return the first assigned number.

In the case that the given value has struct or array type, this function will assign registers for each member or element.

Definition at line 387 of file FunctionLoweringInfo.cpp.

References llvm::ComputeValueVTs(), CreateReg(), MF, and TLI.

getArgumentFrameIndex()

int FunctionLoweringInfo::getArgumentFrameIndex ( const Argument * A )

getCatchPadExceptionPointerVReg()

getCurrentCallSite()

unsigned llvm::FunctionLoweringInfo::getCurrentCallSite ( ) inline

GetLiveOutRegInfo() [1/2]

GetLiveOutRegInfo() [2/2]

getMBB()

getValueFromVirtualReg()

InitializeRegForValue()

InvalidatePHILiveOutRegInfo()

void llvm::FunctionLoweringInfo::InvalidatePHILiveOutRegInfo ( const PHINode * PN) inline

isExportedInst()

bool llvm::FunctionLoweringInfo::isExportedInst ( const Value * V) const inline

set()

set - Initialize this FunctionLoweringInfo with the given Function and its associated MachineFunction.

Definition at line 86 of file FunctionLoweringInfo.cpp.

References AbstractManglingParser< Derived, Alloc >::Ops, assert(), llvm::BuildMI(), llvm::calculateClrEHStateNumbers(), llvm::calculateSEHStateNumbers(), llvm::calculateWasmEHInfo(), llvm::calculateWinCXXEHStateNumbers(), Call, CanLowerReturn, llvm::cast(), llvm::classifyEHPersonality(), llvm::CxxUnwindMapEntry::Cleanup, llvm::WinEHFuncInfo::ClrEHUnwindMap, llvm::ComputeValueVTs(), llvm::CoreCLR, llvm::MachineFunction::CreateMachineBasicBlock(), llvm::WinEHFuncInfo::CxxUnwindMap, DL, llvm::dyn_cast(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), Fn, llvm::MachineFunction::getDataLayout(), getMBB(), llvm::SelectionDAG::getOptLevel(), getPreferredExtendForValue(), llvm::GetReturnInfo(), llvm::TargetFrameLowering::getStackAlign(), llvm::TargetFrameLowering::getStackIDForScalableVectors(), llvm::SelectionDAG::getUniformityInfo(), llvm::ConstantInt::getZExtValue(), H, llvm::ClrEHUnwindMapEntry::Handler, llvm::WinEHTryBlockMapEntry::HandlerArray, I, II, InitializeRegForValue(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::isa(), llvm::isAsynchronousEHPersonality(), llvm::InlineAsm::isClobber, llvm::isFuncletEHPersonality(), llvm::TargetFrameLowering::isStackRealignable(), isUsedOutsideOfDefiningBlock(), MBB, MBBMap, MF, llvm::MSVC_CXX, llvm::None, P, PreferredExtendType, RegInfo, SDValue(), llvm::WinEHFuncInfo::SEHUnwindMap, llvm::WasmEHFuncInfo::SrcToUnwindDest, StaticAllocaMap, TII, TLI, TRI, llvm::WinEHFuncInfo::TryBlockMap, UA, llvm::WasmEHFuncInfo::UnwindDestToSrcs, ValueMap, and llvm::Wasm_CXX.

setArgumentFrameIndex()

void FunctionLoweringInfo::setArgumentFrameIndex ( const Argument * A,
int FI )

setCurrentCallSite()

void llvm::FunctionLoweringInfo::setCurrentCallSite ( unsigned Site) inline

ArgDbgValues

ArgDbgValues - A list of DBG_VALUE instructions created during isel for function arguments that are inserted after scheduling is completed.

Definition at line 139 of file FunctionLoweringInfo.h.

Referenced by clear().

BPI

ByValArgFrameIndexMap

CanLowerReturn

bool llvm::FunctionLoweringInfo::CanLowerReturn

CatchPadExceptionPointers

CurCallSite

unsigned llvm::FunctionLoweringInfo::CurCallSite = 0

DemoteRegister

Register llvm::FunctionLoweringInfo::DemoteRegister

DescribedArgs

BitVector llvm::FunctionLoweringInfo::DescribedArgs

Bitvector with a bit set if corresponding argument is described in ArgDbgValues.

Using arg numbers according to Argument numbering.

Definition at line 143 of file FunctionLoweringInfo.h.

Referenced by clear().

ExceptionPointerVirtReg

Register llvm::FunctionLoweringInfo::ExceptionPointerVirtReg

If the current MBB is a landing pad, the exception pointer and exception selector registers are copied into these virtual registers by SelectionDAGISel::PrepareEHLandingPad().

Definition at line 188 of file FunctionLoweringInfo.h.

ExceptionSelectorVirtReg

Register llvm::FunctionLoweringInfo::ExceptionSelectorVirtReg

Fn

InsertPt

MBB

MBBMap

MF

Definition at line 59 of file FunctionLoweringInfo.h.

Referenced by ComputePHILiveOutRegInfo(), llvm::AArch64::createFastISel(), llvm::ARM::createFastISel(), llvm::MipsTargetLowering::createFastISel(), llvm::PPC::createFastISel(), CreateRegs(), CreateRegs(), getCatchPadExceptionPointerVReg(), llvm::SITargetLowering::isSDNodeSourceOfDivergence(), processDbgDeclare(), processIfEntryValueDbgDeclare(), set(), and tryToElideArgumentCopy().

OrigNumPHINodesToUpdate

unsigned llvm::FunctionLoweringInfo::OrigNumPHINodesToUpdate

PHINodesToUpdate

PHINodesToUpdate - A list of phi instructions whose operand list will be updated after processing the current basic block.

TODO: This isn't per-function state, it's per-basic-block state. But there's no other convenient place for it to live right now.

Definition at line 182 of file FunctionLoweringInfo.h.

Referenced by isRegUsedByPhiNodes().

PreferredExtendType

PreprocessedDVRDeclares

RegFixups

RegInfo

RegsWithFixups

SplitCSR

bool llvm::FunctionLoweringInfo::SplitCSR

StatepointRelocationMaps

StatepointStackSlots

StatepointStackSlots - A list of temporary stack slots (frame indices) used to spill values at a statepoint.

We store them here to enable reuse of the same stack slots across different statepoints in different basic blocks.

Definition at line 154 of file FunctionLoweringInfo.h.

Referenced by clear().

StaticAllocaMap

TLI

UA

ValueMap

VirtReg2Value

VisitedBBs

The set of basic blocks visited thus far by instruction selection.

Indexed by basic block number.

Definition at line 176 of file FunctionLoweringInfo.h.

Referenced by clear().


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