LLVM API Documentation
#include <FunctionLoweringInfo.h>

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 LiveOutInfo * | GetLiveOutRegInfo (unsigned Reg) |
| const LiveOutInfo * | GetLiveOutRegInfo (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 TargetLowering & | TLI |
| const Function * | Fn |
| MachineFunction * | MF |
| MachineRegisterInfo * | RegInfo |
| BranchProbabilityInfo * | BPI |
| bool | CanLowerReturn |
| unsigned | DemoteRegister |
| DenseMap< const BasicBlock *, MachineBasicBlock * > | MBBMap |
| MBBMap - A mapping from LLVM basic blocks to their machine code entry. | |
| DenseMap< const Value *, unsigned > | ValueMap |
| 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, unsigned > | RegFixups |
| RegFixups - Registers which need to be replaced after isel is done. | |
| MachineBasicBlock * | MBB |
| 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 |
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.
| FunctionLoweringInfo::FunctionLoweringInfo | ( | const TargetLowering & | TLI | ) | [explicit] |
Definition at line 58 of file FunctionLoweringInfo.cpp.
| void llvm::FunctionLoweringInfo::AddLiveOutRegInfo | ( | unsigned | Reg, |
| unsigned | NumSignBits, | ||
| const APInt & | KnownZero, | ||
| const APInt & | KnownOne | ||
| ) | [inline] |
AddLiveOutRegInfo - Adds LiveOutInfo for a register.
Definition at line 167 of file FunctionLoweringInfo.h.
References llvm::IndexedMap< T, ToIndexT >::grow(), llvm::FunctionLoweringInfo::LiveOutInfo::KnownOne, llvm::FunctionLoweringInfo::LiveOutInfo::KnownZero, and llvm::FunctionLoweringInfo::LiveOutInfo::NumSignBits.
| 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 191 of file FunctionLoweringInfo.cpp.
References ArgDbgValues, ByValArgFrameIndexMap, CatchInfoFound, CatchInfoLost, llvm::IndexedMap< T, ToIndexT >::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), llvm::SmallPtrSetImpl::clear(), llvm::ValueMap< KeyT, ValueT, Config >::clear(), llvm::SmallVectorImpl< T >::clear(), MBBMap, RegFixups, llvm::SmallPtrSetImpl::size(), StaticAllocaMap, and VisitedBBs.
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
| 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 264 of file FunctionLoweringInfo.cpp.
References llvm::ComputeValueVTs(), llvm::ValueMap< KeyT, ValueT, Config >::count(), llvm::APInt::getBitWidth(), llvm::Value::getContext(), llvm::PHINode::getIncomingValue(), GetLiveOutRegInfo(), llvm::PHINode::getNumIncomingValues(), llvm::TargetLoweringBase::getNumRegisters(), llvm::APInt::getNumSignBits(), llvm::EVT::getSizeInBits(), llvm::Value::getType(), llvm::TargetLoweringBase::getTypeToTransformTo(), llvm::IndexedMap< T, ToIndexT >::grow(), llvm::Type::isIntegerTy(), llvm::FunctionLoweringInfo::LiveOutInfo::IsValid, llvm::Type::isVectorTy(), llvm::TargetRegisterInfo::isVirtualRegister(), llvm::FunctionLoweringInfo::LiveOutInfo::KnownOne, llvm::FunctionLoweringInfo::LiveOutInfo::KnownZero, llvm::FunctionLoweringInfo::LiveOutInfo::NumSignBits, llvm::SmallVectorTemplateCommon< T >::size(), TLI, and llvm::APInt::zextOrTrunc().
CreateReg - Allocate a single virtual register for the given type.
Definition at line 210 of file FunctionLoweringInfo.cpp.
References llvm::MachineRegisterInfo::createVirtualRegister(), llvm::TargetLoweringBase::getRegClassFor(), RegInfo, and TLI.
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 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().
Definition at line 140 of file FunctionLoweringInfo.h.
References CreateRegs(), and llvm::Value::getType().
Referenced by llvm::SelectionDAGBuilder::ExportFromCurrentBlock(), llvm::FastISel::getRegForValue(), llvm::SelectionDAGBuilder::getValueImpl(), and set().
| 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().
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.
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.
Definition at line 54 of file FunctionLoweringInfo.h.
Referenced by llvm::FastISel::FastEmit_ri_(), llvm::FastISel::LowerArguments(), and set().
MBB - The current insert position inside the current block.
Definition at line 93 of file FunctionLoweringInfo.h.
Referenced by llvm::FastISel::enterLocalValueArea(), llvm::FastISel::FastEmitInst_(), llvm::FastISel::FastEmitInst_extractsubreg(), llvm::FastISel::FastEmitInst_i(), llvm::FastISel::FastEmitInst_ii(), llvm::FastISel::FastEmitInst_r(), llvm::FastISel::FastEmitInst_rf(), llvm::FastISel::FastEmitInst_ri(), llvm::FastISel::FastEmitInst_rii(), llvm::FastISel::FastEmitInst_rr(), llvm::FastISel::FastEmitInst_rri(), llvm::FastISel::FastEmitInst_rrii(), llvm::FastISel::FastEmitInst_rrr(), llvm::FastISel::leaveLocalValueArea(), llvm::FastISel::recomputeInsertPt(), llvm::FastISel::SelectInstruction(), and llvm::FastISel::tryToFoldLoad().
MBB - The current block.
Definition at line 90 of file FunctionLoweringInfo.h.
Referenced by llvm::FastISel::FastEmitBranch(), llvm::FastISel::FastEmitInst_(), llvm::FastISel::FastEmitInst_extractsubreg(), llvm::FastISel::FastEmitInst_i(), llvm::FastISel::FastEmitInst_ii(), llvm::FastISel::FastEmitInst_r(), llvm::FastISel::FastEmitInst_rf(), llvm::FastISel::FastEmitInst_ri(), llvm::FastISel::FastEmitInst_rii(), llvm::FastISel::FastEmitInst_rr(), llvm::FastISel::FastEmitInst_rri(), llvm::FastISel::FastEmitInst_rrii(), llvm::FastISel::FastEmitInst_rrr(), llvm::FastISel::leaveLocalValueArea(), llvm::FastISel::recomputeInsertPt(), set(), llvm::FastISel::startNewBlock(), and llvm::FastISel::tryToFoldLoad().
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().
Definition at line 55 of file FunctionLoweringInfo.h.
Referenced by llvm::ARM::createFastISel(), set(), llvm::SelectionDAGBuilder::visitBitTestCase(), llvm::SelectionDAGBuilder::visitBitTestHeader(), llvm::SelectionDAGBuilder::visitJumpTableHeader(), and llvm::SelectionDAGBuilder::visitSwitchCase().
| 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 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().