LLVM API Documentation

Classes | Public Member Functions | Public Attributes
llvm::FunctionLoweringInfo Class Reference

#include <FunctionLoweringInfo.h>

Collaboration diagram for llvm::FunctionLoweringInfo:
Collaboration graph
[legend]

List of all members.

Classes

struct  LiveOutInfo

Public Member Functions

 FunctionLoweringInfo (const TargetMachine &TM)
void set (const Function &Fn, MachineFunction &MF, SelectionDAG *DAG)
void clear ()
bool isExportedInst (const Value *V)
unsigned CreateReg (MVT VT)
 CreateReg - Allocate a single virtual register for the given type.
unsigned CreateRegs (Type *Ty)
unsigned InitializeRegForValue (const Value *V)
const LiveOutInfoGetLiveOutRegInfo (unsigned Reg)
const LiveOutInfoGetLiveOutRegInfo (unsigned Reg, unsigned BitWidth)
void AddLiveOutRegInfo (unsigned Reg, unsigned NumSignBits, const APInt &KnownZero, const APInt &KnownOne)
 AddLiveOutRegInfo - Adds LiveOutInfo for a register.
void ComputePHILiveOutRegInfo (const PHINode *)
void InvalidatePHILiveOutRegInfo (const PHINode *PN)
void setArgumentFrameIndex (const Argument *A, int FI)
int getArgumentFrameIndex (const Argument *A)
 getArgumentFrameIndex - Get frame index for the byval argument.

Public Attributes

const FunctionFn
MachineFunctionMF
MachineRegisterInfoRegInfo
BranchProbabilityInfoBPI
bool CanLowerReturn
unsigned DemoteRegister
DenseMap< const BasicBlock
*, MachineBasicBlock * > 
MBBMap
 MBBMap - A mapping from LLVM basic blocks to their machine code entry.
DenseMap< const Value *, unsignedValueMap
DenseMap< const AllocaInst *, intStaticAllocaMap
DenseMap< const Argument *, intByValArgFrameIndexMap
 ByValArgFrameIndexMap - Keep track of frame indices for byval arguments.
SmallVector< MachineInstr *, 8 > ArgDbgValues
DenseMap< unsigned, unsignedRegFixups
 RegFixups - Registers which need to be replaced after isel is done.
MachineBasicBlockMBB
 MBB - The current block.
MachineBasicBlock::iterator InsertPt
 MBB - The current insert position inside the current block.
SmallPtrSet< const Instruction *, 8 > CatchInfoLost
SmallPtrSet< const Instruction *, 8 > CatchInfoFound
SmallPtrSet< const BasicBlock *, 4 > VisitedBBs
std::vector< std::pair
< MachineInstr *, unsigned > > 
PHINodesToUpdate
unsigned OrigNumPHINodesToUpdate
unsigned ExceptionPointerVirtReg
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 52 of file FunctionLoweringInfo.h.


Constructor & Destructor Documentation

Definition at line 125 of file FunctionLoweringInfo.h.


Member Function Documentation

void llvm::FunctionLoweringInfo::AddLiveOutRegInfo ( unsigned  Reg,
unsigned  NumSignBits,
const APInt KnownZero,
const APInt KnownOne 
) [inline]

CreateReg - Allocate a single virtual register for the given type.

Definition at line 256 of file FunctionLoweringInfo.cpp.

References llvm::MachineRegisterInfo::createVirtualRegister(), RegInfo, and llvm::SystemZISD::TM.

Referenced by CreateRegs(), llvm::SelectionDAGBuilder::visitBitTestHeader(), and llvm::SelectionDAGBuilder::visitJumpTableHeader().

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

References llvm::ComputeValueVTs(), CreateReg(), llvm::Type::getContext(), llvm::TargetLoweringBase::getNumRegisters(), llvm::TargetLoweringBase::getRegisterType(), llvm::SmallVectorTemplateCommon< T >::size(), and llvm::SystemZISD::TM.

Referenced by InitializeRegForValue().

getArgumentFrameIndex - Get frame index for the byval argument.

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

References ByValArgFrameIndexMap, llvm::dbgs(), DEBUG, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), and I.

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

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

References llvm::IndexedMap< T, ToIndexT >::inBounds(), and llvm::FunctionLoweringInfo::LiveOutInfo::IsValid.

Referenced by ComputePHILiveOutRegInfo().

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

References llvm::APInt::getBitWidth(), llvm::IndexedMap< T, ToIndexT >::inBounds(), llvm::FunctionLoweringInfo::LiveOutInfo::IsValid, llvm::FunctionLoweringInfo::LiveOutInfo::KnownOne, llvm::FunctionLoweringInfo::LiveOutInfo::KnownZero, llvm::FunctionLoweringInfo::LiveOutInfo::NumSignBits, and llvm::APInt::zextOrTrunc().

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

Definition at line 193 of file FunctionLoweringInfo.h.

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

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

Definition at line 139 of file FunctionLoweringInfo.h.

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

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

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

Definition at line 59 of file FunctionLoweringInfo.cpp.

References Align(), llvm::Function::begin(), llvm::BuildMI(), CanLowerReturn, llvm::TargetLowering::CanLowerReturn(), llvm::TargetLowering::ComputeConstraintToUse(), llvm::ComputeValueVTs(), llvm::TargetLowering::AsmOperandInfo::ConstraintCode, llvm::TargetLowering::AsmOperandInfo::ConstraintVT, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MachineFrameInfo::CreateStackObject(), llvm::MachineFrameInfo::CreateVariableSizedObject(), llvm::dyn_cast(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::Function::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), Fn, llvm::MCInstrInfo::get(), llvm::Function::getAttributes(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledValue(), llvm::Function::getCallingConv(), llvm::Function::getContext(), llvm::TargetLoweringBase::getDataLayout(), llvm::Instruction::getDebugLoc(), llvm::MachineFunction::getFrameInfo(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::TargetLoweringBase::getNumRegisters(), llvm::DataLayout::getPrefTypeAlignment(), llvm::TargetLowering::getRegForInlineAsmConstraint(), llvm::MachineFunction::getRegInfo(), llvm::GetReturnInfo(), llvm::Function::getReturnType(), llvm::TargetLoweringBase::getStackPointerRegisterToSaveRestore(), llvm::MachineFunction::getSubtarget(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::ConstantInt::getZExtValue(), llvm::MachineModuleInfo::hasDebugInfo(), I, InitializeRegForValue(), llvm::InlineAsm::isClobber, llvm::Type::isEmptyTy(), isUsedOutsideOfDefiningBlock(), llvm::Function::isVarArg(), MBB, MBBMap, MF, llvm::TargetLowering::ParseConstraints(), llvm::TargetOpcode::PHI, llvm::MachineFunction::push_back(), RegInfo, llvm::MachineBasicBlock::setHasAddressTaken(), llvm::MachineFrameInfo::setHasInlineAsmWithSPAdjust(), llvm::MachineFrameInfo::setHasMustTailInVarArgFunc(), llvm::MachineFrameInfo::setHasVAStart(), llvm::MachineModuleInfo::setVariableDbgInfo(), llvm::SmallVectorTemplateCommon< T >::size(), StaticAllocaMap, TII, llvm::SystemZISD::TM, llvm::InlineAsm::ConstraintInfo::Type, and llvm::Value::use_empty().

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

setArgumentFrameIndex - Record frame index for the byval argument.

setArgumentFrameIndex - Record frame index for the byval argument. This overrides previous frame index entry for this argument, if any.

Definition at line 410 of file FunctionLoweringInfo.cpp.

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


Member Data Documentation

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

Definition at line 85 of file FunctionLoweringInfo.h.

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

ByValArgFrameIndexMap - Keep track of frame indices for byval arguments.

Definition at line 81 of file FunctionLoweringInfo.h.

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

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

Definition at line 61 of file FunctionLoweringInfo.h.

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

Definition at line 98 of file FunctionLoweringInfo.h.

Referenced by clear().

Definition at line 97 of file FunctionLoweringInfo.h.

Referenced by clear().

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

Definition at line 65 of file FunctionLoweringInfo.h.

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

Definition at line 123 of file FunctionLoweringInfo.h.

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

Definition at line 68 of file FunctionLoweringInfo.h.

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

Definition at line 118 of file FunctionLoweringInfo.h.

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

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

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

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

Definition at line 88 of file FunctionLoweringInfo.h.

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

Definition at line 57 of file FunctionLoweringInfo.h.

Referenced by CreateReg(), and set().

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

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

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.

Definition at line 73 of file FunctionLoweringInfo.h.

Referenced by llvm::SelectionDAGBuilder::CopyToExportRegsIfNeeded(), llvm::SelectionDAGBuilder::getValue(), llvm::FastISel::lookUpRegForValue(), llvm::FastISel::lowerArguments(), llvm::FastISel::selectExtractValue(), and llvm::FastISel::updateValueMap().

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

Definition at line 111 of file FunctionLoweringInfo.h.

Referenced by clear().


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