LLVM API Documentation
#include <FunctionLoweringInfo.h>
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.
llvm::FunctionLoweringInfo::FunctionLoweringInfo | ( | const TargetMachine & | TM | ) | [inline, explicit] |
Definition at line 125 of file FunctionLoweringInfo.h.
void llvm::FunctionLoweringInfo::AddLiveOutRegInfo | ( | unsigned | Reg, |
unsigned | NumSignBits, | ||
const APInt & | KnownZero, | ||
const APInt & | KnownOne | ||
) | [inline] |
AddLiveOutRegInfo - Adds LiveOutInfo for a register.
Definition at line 174 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 237 of file FunctionLoweringInfo.cpp.
References ArgDbgValues, ByValArgFrameIndexMap, CatchInfoFound, CatchInfoLost, llvm::IndexedMap< T, ToIndexT >::clear(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), llvm::SmallPtrSetImplBase::clear(), llvm::ValueMap< KeyT, ValueT, Config >::clear(), llvm::SmallVectorImpl< T >::clear(), MBBMap, RegFixups, llvm::SmallPtrSetImplBase::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 313 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(), llvm::SystemZISD::TM, and llvm::APInt::zextOrTrunc().
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().
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 155 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 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().
unsigned llvm::FunctionLoweringInfo::InitializeRegForValue | ( | const Value * | V | ) | [inline] |
Definition at line 147 of file FunctionLoweringInfo.h.
References CreateRegs(), and llvm::Value::getType().
Referenced by llvm::SelectionDAGBuilder::ExportFromCurrentBlock(), llvm::FastISel::getRegForValue(), llvm::SelectionDAGBuilder::getValueImpl(), llvm::FastISel::selectExtractValue(), llvm::FastISel::selectIntrinsicCall(), 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 193 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 139 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 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().
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 410 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 85 of file FunctionLoweringInfo.h.
Referenced by clear(), and llvm::SelectionDAGISel::runOnMachineFunction().
Definition at line 58 of file FunctionLoweringInfo.h.
Referenced by llvm::FastISel::fastEmitBranch(), 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.
Definition at line 55 of file FunctionLoweringInfo.h.
Referenced by llvm::FastISel::fastEmit_ri_(), llvm::FastISel::lowerArguments(), llvm::FastISel::selectExtractValue(), and set().
MBB - The current insert position inside the current block.
Definition at line 94 of file FunctionLoweringInfo.h.
Referenced by llvm::FastISel::constrainOperandRegClass(), 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::selectBitCast(), llvm::FastISel::selectCall(), llvm::FastISel::selectInstruction(), llvm::FastISel::selectIntrinsicCall(), llvm::FastISel::selectStackmap(), and llvm::FastISel::tryToFoldLoad().
MBB - The current block.
Definition at line 91 of file FunctionLoweringInfo.h.
Referenced by llvm::FastISel::canFoldAddIntoGEP(), llvm::FastISel::constrainOperandRegClass(), 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(), llvm::FastISel::selectBitCast(), llvm::FastISel::selectCall(), llvm::FastISel::selectIntrinsicCall(), llvm::FastISel::selectPatchpoint(), llvm::FastISel::selectStackmap(), set(), llvm::FastISel::startNewBlock(), and llvm::FastISel::tryToFoldLoad().
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 56 of file FunctionLoweringInfo.h.
Referenced by llvm::FastISel::constrainOperandRegClass(), llvm::ARM::createFastISel(), llvm::PPC::createFastISel(), llvm::FastISel::createMachineMemOperandFor(), llvm::FastISel::lowerCallTo(), llvm::FastISel::selectCall(), llvm::FastISel::selectIntrinsicCall(), llvm::FastISel::selectPatchpoint(), llvm::FastISel::selectStackmap(), set(), llvm::SelectionDAGBuilder::visitBitTestCase(), llvm::SelectionDAGBuilder::visitBitTestHeader(), llvm::SelectionDAGBuilder::visitJumpTableHeader(), and llvm::SelectionDAGBuilder::visitSwitchCase().
Definition at line 118 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 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().