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 TargetLowering &TLI)
void set (const Function &Fn, MachineFunction &MF)
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 TargetLoweringTLI
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 *, int > StaticAllocaMap
DenseMap< const Argument *, int > ByValArgFrameIndexMap
 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

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


Constructor & Destructor Documentation

FunctionLoweringInfo::FunctionLoweringInfo ( const TargetLowering TLI) [explicit]

Definition at line 58 of file FunctionLoweringInfo.cpp.


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

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

Referenced by InitializeRegForValue().

int FunctionLoweringInfo::getArgumentFrameIndex ( const Argument A)

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

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

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

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

Referenced by ComputePHILiveOutRegInfo().

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 245 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().

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

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

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 132 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 
)

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

Definition at line 62 of file FunctionLoweringInfo.cpp.

References Align(), llvm::Function::begin(), llvm::BuildMI(), CanLowerReturn, llvm::TargetLowering::CanLowerReturn(), llvm::ComputeValueVTs(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::MachineFrameInfo::CreateStackObject(), 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::Function::getCallingConv(), llvm::Function::getContext(), llvm::TargetLoweringBase::getDataLayout(), llvm::Instruction::getDebugLoc(), llvm::MachineFunction::getFrameInfo(), llvm::TargetMachine::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::TargetLoweringBase::getNumRegisters(), llvm::DataLayout::getPrefTypeAlignment(), llvm::MachineFunction::getRegInfo(), llvm::GetReturnInfo(), llvm::Function::getReturnType(), llvm::MachineFunction::getTarget(), llvm::Value::getType(), llvm::DataLayout::getTypeAllocSize(), llvm::MachineModuleInfo::hasDebugInfo(), llvm::ARM_PROC::I, InitializeRegForValue(), llvm::Type::isEmptyTy(), isUsedOutsideOfDefiningBlock(), llvm::Function::isVarArg(), MBB, MBBMap, MF, llvm::TargetOpcode::PHI, llvm::MachineFunction::push_back(), RegInfo, llvm::MachineBasicBlock::setHasAddressTaken(), llvm::MachineModuleInfo::setVariableDbgInfo(), llvm::SmallVectorTemplateCommon< T >::size(), StaticAllocaMap, TII, TLI, 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.

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

Definition at line 359 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 84 of file FunctionLoweringInfo.h.

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

Definition at line 57 of file FunctionLoweringInfo.h.

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

ByValArgFrameIndexMap - Keep track of frame indices for byval arguments.

Definition at line 80 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 60 of file FunctionLoweringInfo.h.

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

Definition at line 97 of file FunctionLoweringInfo.h.

Referenced by clear().

Definition at line 96 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 64 of file FunctionLoweringInfo.h.

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

Definition at line 67 of file FunctionLoweringInfo.h.

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

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

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

Definition at line 87 of file FunctionLoweringInfo.h.

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

Definition at line 56 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 77 of file FunctionLoweringInfo.h.

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

Definition at line 53 of file FunctionLoweringInfo.h.

Referenced by ComputePHILiveOutRegInfo(), CreateReg(), CreateRegs(), 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 72 of file FunctionLoweringInfo.h.

Referenced by llvm::SelectionDAGBuilder::CopyToExportRegsIfNeeded(), llvm::SelectionDAGBuilder::getValue(), llvm::FastISel::lookUpRegForValue(), llvm::FastISel::LowerArguments(), and llvm::FastISel::UpdateValueMap().

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

Definition at line 110 of file FunctionLoweringInfo.h.

Referenced by clear().


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