LLVM  3.7.0
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
llvm::FunctionLoweringInfo Class Reference

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

#include <FunctionLoweringInfo.h>

Collaboration diagram for llvm::FunctionLoweringInfo:
[legend]

Classes

struct  LiveOutInfo
 

Public Types

typedef DenseMap< const Value
*, Optional< int > > 
StatepointSpilledValueMapTy
 

Public Member Functions

void set (const Function &Fn, MachineFunction &MF, SelectionDAG *DAG)
 set - Initialize this FunctionLoweringInfo with the given Function and its associated MachineFunction. More...
 
void clear ()
 clear - Clear out all the function-specific state. More...
 
bool isExportedInst (const Value *V)
 isExportedInst - Return true if the specified value is an instruction exported from its block. More...
 
unsigned CreateReg (MVT VT)
 CreateReg - Allocate a single virtual register for the given type. More...
 
unsigned CreateRegs (Type *Ty)
 CreateRegs - Allocate the appropriate number of virtual registers of the correctly promoted or expanded types. More...
 
unsigned InitializeRegForValue (const Value *V)
 
const LiveOutInfoGetLiveOutRegInfo (unsigned Reg)
 GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the register is a PHI destination and the PHI's LiveOutInfo is not valid. More...
 
const LiveOutInfoGetLiveOutRegInfo (unsigned 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. More...
 
void AddLiveOutRegInfo (unsigned Reg, unsigned NumSignBits, const APInt &KnownZero, const APInt &KnownOne)
 AddLiveOutRegInfo - Adds LiveOutInfo for a register. More...
 
void ComputePHILiveOutRegInfo (const PHINode *)
 ComputePHILiveOutRegInfo - Compute LiveOutInfo for a PHI's destination register based on the LiveOutInfo of its operands. More...
 
void InvalidatePHILiveOutRegInfo (const PHINode *PN)
 InvalidatePHILiveOutRegInfo - Invalidates a PHI's LiveOutInfo, to be called when a block is visited before all of its predecessors. More...
 
void setArgumentFrameIndex (const Argument *A, int FI)
 setArgumentFrameIndex - Record frame index for the byval argument. More...
 
int getArgumentFrameIndex (const Argument *A)
 getArgumentFrameIndex - Get frame index for the byval argument. More...
 

Public Attributes

const FunctionFn
 
MachineFunctionMF
 
const TargetLoweringTLI
 
MachineRegisterInfoRegInfo
 
BranchProbabilityInfoBPI
 
bool CanLowerReturn
 CanLowerReturn - true iff the function's return value can be lowered to registers. More...
 
unsigned DemoteRegister
 DemoteRegister - if CanLowerReturn is false, DemoteRegister is a vreg allocated to hold a pointer to the hidden sret parameter. More...
 
DenseMap< const BasicBlock
*, MachineBasicBlock * > 
MBBMap
 MBBMap - A mapping from LLVM basic blocks to their machine code entry. More...
 
DenseMap< const Value *, unsignedValueMap
 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. More...
 
DenseMap< const Instruction
*, StatepointSpilledValueMapTy
StatepointRelocatedValues
 
DenseMap< const AllocaInst *, intStaticAllocaMap
 StaticAllocaMap - Keep track of frame indices for fixed sized allocas in the entry block. More...
 
DenseMap< const Argument *, intByValArgFrameIndexMap
 ByValArgFrameIndexMap - Keep track of frame indices for byval arguments. More...
 
SmallVector< MachineInstr *, 8 > ArgDbgValues
 ArgDbgValues - A list of DBG_VALUE instructions created during isel for function arguments that are inserted after scheduling is completed. More...
 
DenseMap< unsigned, unsignedRegFixups
 RegFixups - Registers which need to be replaced after isel is done. More...
 
SmallVector< unsigned, 50 > StatepointStackSlots
 StatepointStackSlots - A list of temporary stack slots (frame indices) used to spill values at a statepoint. More...
 
MachineBasicBlockMBB
 MBB - The current block. More...
 
MachineBasicBlock::iterator InsertPt
 MBB - The current insert position inside the current block. More...
 
SmallPtrSet< const Instruction *, 8 > CatchInfoLost
 
SmallPtrSet< const Instruction *, 8 > CatchInfoFound
 
DenseMap< const Value
*, ISD::NodeType
PreferredExtendType
 Record the preferred extend type (ISD::SIGN_EXTEND or ISD::ZERO_EXTEND) for a value. More...
 
SmallPtrSet< const BasicBlock *, 4 > VisitedBBs
 VisitedBBs - The set of basic blocks visited thus far by instruction selection. More...
 
std::vector< std::pair
< MachineInstr *, unsigned > > 
PHINodesToUpdate
 PHINodesToUpdate - A list of phi instructions whose operand list will be updated after processing the current basic block. More...
 
unsigned OrigNumPHINodesToUpdate
 
unsigned 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(). More...
 
unsigned ExceptionSelectorVirtReg
 

Detailed Description

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

Definition at line 54 of file FunctionLoweringInfo.h.

Member Typedef Documentation

Definition at line 83 of file FunctionLoweringInfo.h.

Member Function Documentation

void llvm::FunctionLoweringInfo::AddLiveOutRegInfo ( unsigned  Reg,
unsigned  NumSignBits,
const APInt KnownZero,
const APInt KnownOne 
)
inline
void FunctionLoweringInfo::clear ( )
void FunctionLoweringInfo::ComputePHILiveOutRegInfo ( const PHINode PN)
unsigned FunctionLoweringInfo::CreateReg ( MVT  VT)
unsigned FunctionLoweringInfo::CreateRegs ( Type Ty)

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 366 of file FunctionLoweringInfo.cpp.

References llvm::ComputeValueVTs(), CreateReg(), llvm::Type::getContext(), llvm::MachineFunction::getDataLayout(), llvm::TargetLoweringBase::getNumRegisters(), llvm::TargetLoweringBase::getRegisterType(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), MF, llvm::SmallVectorTemplateCommon< T >::size(), and TLI.

Referenced by InitializeRegForValue(), and lowerCallFromStatepoint().

int FunctionLoweringInfo::getArgumentFrameIndex ( const Argument A)

getArgumentFrameIndex - Get frame index for the byval argument.

If the argument does not have any assigned frame index then 0 is returned.

Definition at line 514 of file FunctionLoweringInfo.cpp.

References ByValArgFrameIndexMap, llvm::dbgs(), DEBUG, and I.

Referenced by llvm::FastISel::selectIntrinsicCall().

const LiveOutInfo* llvm::FunctionLoweringInfo::GetLiveOutRegInfo ( unsigned  Reg)
inline

GetLiveOutRegInfo - Gets LiveOutInfo for a register, returning NULL if the register is a PHI destination and the PHI's LiveOutInfo is not valid.

Definition at line 175 of file FunctionLoweringInfo.h.

References llvm::FunctionLoweringInfo::LiveOutInfo::IsValid.

Referenced by ComputePHILiveOutRegInfo(), and llvm::RegsForValue::getCopyFromRegs().

const FunctionLoweringInfo::LiveOutInfo * FunctionLoweringInfo::GetLiveOutRegInfo ( unsigned  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.

If the register's LiveOutInfo is for a smaller bit width, it is extended to the larger bit width by zero extension. The bit width must be no smaller than the LiveOutInfo's existing bit width.

Definition at line 392 of file FunctionLoweringInfo.cpp.

References llvm::APInt::getBitWidth(), llvm::FunctionLoweringInfo::LiveOutInfo::IsValid, llvm::FunctionLoweringInfo::LiveOutInfo::KnownOne, llvm::FunctionLoweringInfo::LiveOutInfo::KnownZero, llvm::FunctionLoweringInfo::LiveOutInfo::NumSignBits, and llvm::APInt::zextOrTrunc().

unsigned llvm::FunctionLoweringInfo::InitializeRegForValue ( const Value V)
inline
void llvm::FunctionLoweringInfo::InvalidatePHILiveOutRegInfo ( const PHINode PN)
inline

InvalidatePHILiveOutRegInfo - Invalidates a PHI's LiveOutInfo, to be called when a block is visited before all of its predecessors.

Definition at line 213 of file FunctionLoweringInfo.h.

References llvm::ValueMap< KeyT, ValueT, Config >::end(), and llvm::ValueMap< KeyT, ValueT, Config >::find().

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

isExportedInst - Return true if the specified value is an instruction exported from its block.

Definition at line 159 of file FunctionLoweringInfo.h.

References llvm::ValueMap< KeyT, ValueT, Config >::count().

Referenced by llvm::SelectionDAGBuilder::ExportFromCurrentBlock(), llvm::SelectionDAGBuilder::isExportableFromCurrentBlock(), and isFoldedOrDeadInstruction().

void FunctionLoweringInfo::set ( const Function Fn,
MachineFunction MF,
SelectionDAG DAG 
)

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

Definition at line 83 of file FunctionLoweringInfo.cpp.

References llvm::dwarf::syntax::Address, llvm::MachineModuleInfo::addWinEHState(), Align(), llvm::Function::begin(), llvm::BuildMI(), llvm::calculateWinCXXEHStateNumbers(), CanLowerReturn, llvm::classifyEHPersonality(), llvm::ComputeValueVTs(), llvm::TargetLowering::AsmOperandInfo::ConstraintCode, llvm::TargetLowering::AsmOperandInfo::ConstraintVT, llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MachineFrameInfo::CreateStackObject(), llvm::MachineFrameInfo::CreateVariableSizedObject(), llvm::CS, llvm::DI, llvm::DL, llvm::dyn_cast(), llvm::Function::end(), Fn, llvm::MCInstrInfo::get(), llvm::Function::getAttributes(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledValue(), llvm::Function::getCallingConv(), llvm::Function::getContext(), llvm::MachineFunction::getDataLayout(), llvm::Module::getDataLayout(), llvm::Instruction::getDebugLoc(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getFrameLowering(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::GlobalValue::getParent(), llvm::Function::getPersonalityFn(), getPreferredExtendForValue(), llvm::DataLayout::getPrefTypeAlignment(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::GetReturnInfo(), llvm::Function::getReturnType(), llvm::TargetFrameLowering::getStackAlignment(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::MachineModuleInfo::getWinEHFuncInfo(), llvm::MachineModuleInfo::getWinEHParent(), llvm::ConstantInt::getZExtValue(), llvm::MachineModuleInfo::hasDebugInfo(), llvm::Function::hasPersonalityFn(), I, InitializeRegForValue(), llvm::InlineAsm::isClobber, llvm::Type::isEmptyTy(), llvm::isMSVCEHPersonality(), isUsedOutsideOfDefiningBlock(), llvm::Function::isVarArg(), llvm::WinEHFuncInfo::LandingPadStateMap, MBB, MBBMap, MF, llvm::MSVC_CXX, llvm::MSVC_Win64SEH, llvm::MSVC_X86SEH, llvm::TargetOpcode::PHI, PreferredExtendType, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MachineFunction::push_back(), RegInfo, llvm::MachineBasicBlock::setHasAddressTaken(), llvm::MachineFrameInfo::setHasMustTailInVarArgFunc(), llvm::MachineFrameInfo::setHasOpaqueSPAdjustment(), llvm::MachineFrameInfo::setHasVAStart(), llvm::MachineModuleInfo::setVariableDbgInfo(), llvm::SI, llvm::SmallVectorTemplateCommon< T >::size(), llvm::SP, StaticAllocaMap, TII, TLI, llvm::InlineAsm::ConstraintInfo::Type, llvm::Unknown, and llvm::Value::use_empty().

Referenced by llvm::SelectionDAGISel::runOnMachineFunction().

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

setArgumentFrameIndex - Record frame index for the byval argument.

This overrides previous frame index entry for this argument, if any.

Definition at line 506 of file FunctionLoweringInfo.cpp.

References llvm::ARM_PROC::A, and ByValArgFrameIndexMap.

Member Data Documentation

SmallVector<MachineInstr*, 8> llvm::FunctionLoweringInfo::ArgDbgValues

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

Definition at line 97 of file FunctionLoweringInfo.h.

Referenced by clear(), and llvm::SelectionDAGISel::runOnMachineFunction().

BranchProbabilityInfo* llvm::FunctionLoweringInfo::BPI
DenseMap<const Argument*, int> llvm::FunctionLoweringInfo::ByValArgFrameIndexMap

ByValArgFrameIndexMap - Keep track of frame indices for byval arguments.

Definition at line 93 of file FunctionLoweringInfo.h.

Referenced by clear(), getArgumentFrameIndex(), and setArgumentFrameIndex().

bool llvm::FunctionLoweringInfo::CanLowerReturn

CanLowerReturn - true iff the function's return value can be lowered to registers.

Definition at line 63 of file FunctionLoweringInfo.h.

Referenced by llvm::FastISel::lowerArguments(), and set().

SmallPtrSet<const Instruction *, 8> llvm::FunctionLoweringInfo::CatchInfoFound

Definition at line 116 of file FunctionLoweringInfo.h.

Referenced by clear().

SmallPtrSet<const Instruction *, 8> llvm::FunctionLoweringInfo::CatchInfoLost

Definition at line 115 of file FunctionLoweringInfo.h.

Referenced by clear().

unsigned llvm::FunctionLoweringInfo::DemoteRegister

DemoteRegister - if CanLowerReturn is false, DemoteRegister is a vreg allocated to hold a pointer to the hidden sret parameter.

Definition at line 67 of file FunctionLoweringInfo.h.

unsigned 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 145 of file FunctionLoweringInfo.h.

unsigned llvm::FunctionLoweringInfo::ExceptionSelectorVirtReg

Definition at line 145 of file FunctionLoweringInfo.h.

const Function* llvm::FunctionLoweringInfo::Fn
MachineBasicBlock::iterator llvm::FunctionLoweringInfo::InsertPt
MachineBasicBlock* llvm::FunctionLoweringInfo::MBB
DenseMap<const BasicBlock*, MachineBasicBlock *> llvm::FunctionLoweringInfo::MBBMap

MBBMap - A mapping from LLVM basic blocks to their machine code entry.

Definition at line 70 of file FunctionLoweringInfo.h.

Referenced by llvm::FastISel::canFoldAddIntoGEP(), clear(), llvm::FastISel::selectOperator(), and set().

MachineFunction* llvm::FunctionLoweringInfo::MF
unsigned llvm::FunctionLoweringInfo::OrigNumPHINodesToUpdate

Definition at line 140 of file FunctionLoweringInfo.h.

Referenced by llvm::FastISel::selectInstruction().

std::vector<std::pair<MachineInstr*, unsigned> > llvm::FunctionLoweringInfo::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 139 of file FunctionLoweringInfo.h.

Referenced by llvm::FastISel::selectInstruction().

DenseMap<const Value *, ISD::NodeType> llvm::FunctionLoweringInfo::PreferredExtendType

Record the preferred extend type (ISD::SIGN_EXTEND or ISD::ZERO_EXTEND) for a value.

Definition at line 129 of file FunctionLoweringInfo.h.

Referenced by clear(), llvm::SelectionDAGBuilder::CopyValueToVirtualRegister(), and set().

DenseMap<unsigned, unsigned> llvm::FunctionLoweringInfo::RegFixups

RegFixups - Registers which need to be replaced after isel is done.

Definition at line 100 of file FunctionLoweringInfo.h.

Referenced by clear(), llvm::SelectionDAGISel::runOnMachineFunction(), and llvm::FastISel::updateValueMap().

MachineRegisterInfo* llvm::FunctionLoweringInfo::RegInfo

Definition at line 59 of file FunctionLoweringInfo.h.

Referenced by CreateReg(), and set().

DenseMap<const Instruction*, StatepointSpilledValueMapTy> llvm::FunctionLoweringInfo::StatepointRelocatedValues

Definition at line 85 of file FunctionLoweringInfo.h.

Referenced by clear(), findPreviousSpillSlot(), and lowerStatepointMetaArgs().

SmallVector<unsigned, 50> llvm::FunctionLoweringInfo::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 106 of file FunctionLoweringInfo.h.

Referenced by llvm::StatepointLoweringState::allocateStackSlot(), clear(), reservePreviousStackSlotForValue(), and llvm::StatepointLoweringState::startNewStatepoint().

DenseMap<const AllocaInst*, int> llvm::FunctionLoweringInfo::StaticAllocaMap

StaticAllocaMap - Keep track of frame indices for fixed sized allocas in the entry block.

This allows the allocas to be efficiently referenced anywhere in the function.

Definition at line 90 of file FunctionLoweringInfo.h.

Referenced by clear(), llvm::FastISel::getRegForValue(), llvm::SelectionDAGBuilder::getValueImpl(), llvm::FastISel::selectIntrinsicCall(), llvm::FastISel::selectOperator(), and set().

const TargetLowering* llvm::FunctionLoweringInfo::TLI

Definition at line 58 of file FunctionLoweringInfo.h.

Referenced by ComputePHILiveOutRegInfo(), CreateRegs(), and set().

DenseMap<const Value*, unsigned> llvm::FunctionLoweringInfo::ValueMap
SmallPtrSet<const BasicBlock*, 4> llvm::FunctionLoweringInfo::VisitedBBs

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

Definition at line 133 of file FunctionLoweringInfo.h.

Referenced by clear().


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