LLVM API Documentation
#include <SelectionDAGBuilder.h>
Classes | |
struct | BitTestBlock |
struct | BitTestCase |
struct | Case |
struct | CaseBits |
struct | CaseBitsCmp |
struct | CaseBlock |
struct | CaseCmp |
struct | CaseRec |
class | DanglingDebugInfo |
DanglingDebugInfo - Helper type for DanglingDebugInfoMap. | |
struct | JumpTable |
struct | JumpTableHeader |
class | StackProtectorDescriptor |
Public Member Functions | |
SelectionDAGBuilder (SelectionDAG &dag, FunctionLoweringInfo &funcinfo, CodeGenOpt::Level ol) | |
void | init (GCFunctionInfo *gfi, AliasAnalysis &aa, const TargetLibraryInfo *li) |
void | clear () |
void | clearDanglingDebugInfo () |
SDValue | getRoot () |
SDValue | getControlRoot () |
SDLoc | getCurSDLoc () const |
DebugLoc | getCurDebugLoc () const |
unsigned | getSDNodeOrder () const |
void | CopyValueToVirtualRegister (const Value *V, unsigned Reg) |
void | visit (const Instruction &I) |
void | visit (unsigned Opcode, const User &I) |
void | resolveDanglingDebugInfo (const Value *V, SDValue Val) |
SDValue | getValue (const Value *V) |
getValue - Return an SDValue for the given Value. | |
SDValue | getNonRegisterValue (const Value *V) |
SDValue | getValueImpl (const Value *V) |
void | setValue (const Value *V, SDValue NewN) |
void | setUnusedArgValue (const Value *V, SDValue NewN) |
void | FindMergedConditions (const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, unsigned Opc, uint32_t TW, uint32_t FW) |
FindMergedConditions - If Cond is an expression like. | |
void | EmitBranchForMergedCondition (const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, uint32_t TW, uint32_t FW) |
bool | ShouldEmitAsBranches (const std::vector< CaseBlock > &Cases) |
bool | isExportableFromCurrentBlock (const Value *V, const BasicBlock *FromBB) |
void | CopyToExportRegsIfNeeded (const Value *V) |
void | ExportFromCurrentBlock (const Value *V) |
void | LowerCallTo (ImmutableCallSite CS, SDValue Callee, bool IsTailCall, MachineBasicBlock *LandingPad=nullptr) |
std::pair< SDValue, SDValue > | LowerCallOperands (const CallInst &CI, unsigned ArgIdx, unsigned NumArgs, SDValue Callee, bool useVoidTy=false) |
Lower an argument list according to the target calling convention. | |
void | UpdateSplitBlock (MachineBasicBlock *First, MachineBasicBlock *Last) |
void | visitSwitchCase (CaseBlock &CB, MachineBasicBlock *SwitchBB) |
void | visitSPDescriptorParent (StackProtectorDescriptor &SPD, MachineBasicBlock *ParentBB) |
void | visitSPDescriptorFailure (StackProtectorDescriptor &SPD) |
void | visitBitTestHeader (BitTestBlock &B, MachineBasicBlock *SwitchBB) |
void | visitBitTestCase (BitTestBlock &BB, MachineBasicBlock *NextMBB, uint32_t BranchWeightToNext, unsigned Reg, BitTestCase &B, MachineBasicBlock *SwitchBB) |
visitBitTestCase - this function produces one "bit test" | |
void | visitJumpTable (JumpTable &JT) |
visitJumpTable - Emit JumpTable node in the current MBB | |
void | visitJumpTableHeader (JumpTable &JT, JumpTableHeader &JTH, MachineBasicBlock *SwitchBB) |
Public Attributes | |
SmallVector< SDValue, 8 > | PendingLoads |
SelectionDAG & | DAG |
const DataLayout * | DL |
AliasAnalysis * | AA |
const TargetLibraryInfo * | LibInfo |
std::vector< CaseBlock > | SwitchCases |
std::vector< JumpTableBlock > | JTCases |
std::vector< BitTestBlock > | BitTestCases |
StackProtectorDescriptor | SPDescriptor |
DenseMap< const Constant *, unsigned > | ConstantsOut |
FunctionLoweringInfo & | FuncInfo |
CodeGenOpt::Level | OptLevel |
GCFunctionInfo * | GFI |
GFI - Garbage collection metadata for the function. | |
DenseMap< MachineBasicBlock *, SmallVector< unsigned, 4 > > | LPadToCallSiteMap |
LPadToCallSiteMap - Map a landing pad to the call site indexes. | |
bool | HasTailCall |
LLVMContext * | Context |
Static Public Attributes | |
static const unsigned | LowestSDNodeOrder = 1 |
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameterized by a TargetLowering object.
Definition at line 83 of file SelectionDAGBuilder.h.
llvm::SelectionDAGBuilder::SelectionDAGBuilder | ( | SelectionDAG & | dag, |
FunctionLoweringInfo & | funcinfo, | ||
CodeGenOpt::Level | ol | ||
) | [inline] |
Definition at line 546 of file SelectionDAGBuilder.h.
void SelectionDAGBuilder::clear | ( | ) |
clear - Clear out the current SelectionDAG and the associated state and prepare this SelectionDAGBuilder object to be used for a new block. This doesn't clear out information about additional blocks that are needed to complete switch lowering or PHI node updating; that information is cleared out as it is consumed.
Definition at line 875 of file SelectionDAGBuilder.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), llvm::SmallVectorImpl< T >::clear(), HasTailCall, LowestSDNodeOrder, and PendingLoads.
clearDanglingDebugInfo - Clear the dangling debug information map. This function is separated from the clear so that debug information that is dangling in a basic block can be properly resolved in a different basic block. This allows the SelectionDAG to resolve dangling debug information attached to PHI nodes.
Definition at line 891 of file SelectionDAGBuilder.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear().
void SelectionDAGBuilder::CopyToExportRegsIfNeeded | ( | const Value * | V | ) |
CopyToExportRegsIfNeeded - If the given value has virtual registers created for it, emit nodes to copy the value into the virtual registers.
Definition at line 1294 of file SelectionDAGBuilder.cpp.
References CopyValueToVirtualRegister(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::Value::getType(), llvm::Type::isEmptyTy(), llvm::Value::use_empty(), and llvm::FunctionLoweringInfo::ValueMap.
Referenced by visit().
void SelectionDAGBuilder::CopyValueToVirtualRegister | ( | const Value * | V, |
unsigned | Reg | ||
) |
Definition at line 7422 of file SelectionDAGBuilder.cpp.
References llvm::ISD::CopyFromReg, llvm::Value::getContext(), getCurSDLoc(), llvm::SelectionDAG::getEntryNode(), getNonRegisterValue(), llvm::SDValue::getOpcode(), llvm::SDValue::getOperand(), getReg(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Value::getType(), llvm::TargetRegisterInfo::isPhysicalRegister(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by CopyToExportRegsIfNeeded(), and ExportFromCurrentBlock().
void SelectionDAGBuilder::EmitBranchForMergedCondition | ( | const Value * | Cond, |
MachineBasicBlock * | TBB, | ||
MachineBasicBlock * | FBB, | ||
MachineBasicBlock * | CurBB, | ||
MachineBasicBlock * | SwitchBB, | ||
uint32_t | TWeight, | ||
uint32_t | FWeight | ||
) |
EmitBranchForMergedCondition - Helper method for FindMergedConditions. This function emits a branch and is used at the leaves of an OR or an AND operator tree.
Definition at line 1378 of file SelectionDAGBuilder.cpp.
References R600_InstFlag::FC, llvm::MachineBasicBlock::getBasicBlock(), llvm::SelectionDAG::getContext(), llvm::getFCmpCodeWithoutNaN(), llvm::getFCmpCondCode(), llvm::getICmpCondCode(), llvm::ConstantInt::getTrue(), isExportableFromCurrentBlock(), llvm_unreachable, llvm::TargetOptions::NoNaNsFPMath, llvm::TargetMachine::Options, llvm::ISD::SETEQ, and SwitchCases.
Referenced by FindMergedConditions().
void SelectionDAGBuilder::ExportFromCurrentBlock | ( | const Value * | V | ) |
ExportFromCurrentBlock - If this condition isn't known to be exported from the current basic block, add it to ValueMap now so that we'll get a CopyTo/FromReg.
Definition at line 1309 of file SelectionDAGBuilder.cpp.
References CopyValueToVirtualRegister(), llvm::FunctionLoweringInfo::InitializeRegForValue(), and llvm::FunctionLoweringInfo::isExportedInst().
void SelectionDAGBuilder::FindMergedConditions | ( | const Value * | Cond, |
MachineBasicBlock * | TBB, | ||
MachineBasicBlock * | FBB, | ||
MachineBasicBlock * | CurBB, | ||
MachineBasicBlock * | SwitchBB, | ||
unsigned | Opc, | ||
uint32_t | TW, | ||
uint32_t | FW | ||
) |
FindMergedConditions - If Cond is an expression like.
Definition at line 1430 of file SelectionDAGBuilder.cpp.
References llvm::APIntOps::And(), llvm::MachineFunction::CreateMachineBasicBlock(), llvm::dyn_cast(), EmitBranchForMergedCondition(), llvm::MachineBasicBlock::getBasicBlock(), llvm::SelectionDAG::getMachineFunction(), llvm::Instruction::getOpcode(), llvm::User::getOperand(), llvm::Instruction::getParent(), llvm::MachineBasicBlock::getParent(), llvm::Value::hasOneUse(), InBlock(), llvm::MachineFunction::insert(), llvm::APIntOps::Or(), and ScaleWeights().
getControlRoot - Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports items. It is necessary to do this before emitting a terminator instruction.
Definition at line 923 of file SelectionDAGBuilder.cpp.
References llvm::SmallVectorImpl< T >::clear(), llvm::SmallVectorBase::empty(), llvm::ISD::EntryToken, getCurSDLoc(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SelectionDAG::getRoot(), llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SelectionDAG::setRoot(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::ISD::TokenFactor.
Referenced by LowerCallTo(), visitBitTestCase(), visitBitTestHeader(), visitJumpTable(), visitJumpTableHeader(), and visitSwitchCase().
DebugLoc llvm::SelectionDAGBuilder::getCurDebugLoc | ( | ) | const [inline] |
Definition at line 589 of file SelectionDAGBuilder.h.
References llvm::Instruction::getDebugLoc().
SDLoc llvm::SelectionDAGBuilder::getCurSDLoc | ( | ) | const [inline] |
Definition at line 585 of file SelectionDAGBuilder.h.
Referenced by CopyValueToVirtualRegister(), getControlRoot(), getMemCmpLoad(), getRoot(), getValue(), getValueImpl(), LowerCallOperands(), LowerCallTo(), visitBitTestCase(), visitBitTestHeader(), visitJumpTable(), visitJumpTableHeader(), visitSPDescriptorFailure(), visitSPDescriptorParent(), and visitSwitchCase().
getNonRegisterValue - Return an SDValue for the given Value, but don't look in FuncInfo.ValueMap for a virtual register.
Definition at line 1040 of file SelectionDAGBuilder.cpp.
References llvm::SDValue::getNode(), getValueImpl(), N, and resolveDanglingDebugInfo().
Referenced by CopyValueToVirtualRegister().
getRoot - Return the current virtual root of the Selection DAG, flushing any PendingLoad items. This must be done before emitting a store or any other node that may need to be ordered after any prior load instructions.
Definition at line 900 of file SelectionDAGBuilder.cpp.
References llvm::SmallVectorImpl< T >::clear(), llvm::SmallVectorBase::empty(), getCurSDLoc(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getRoot(), llvm::MVT::Other, PendingLoads, llvm::SelectionDAG::setRoot(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::ISD::TokenFactor.
Referenced by LowerCallOperands(), and LowerCallTo().
unsigned llvm::SelectionDAGBuilder::getSDNodeOrder | ( | ) | const [inline] |
Definition at line 593 of file SelectionDAGBuilder.h.
getValue - Return an SDValue for the given Value.
Definition at line 1010 of file SelectionDAGBuilder.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::SelectionDAG::getContext(), getCurSDLoc(), llvm::SelectionDAG::getEntryNode(), llvm::SDValue::getNode(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Value::getType(), getValueImpl(), N, resolveDanglingDebugInfo(), and llvm::FunctionLoweringInfo::ValueMap.
Referenced by addStackMapLiveVars(), getMemCmpLoad(), getValueImpl(), LowerCallOperands(), LowerCallTo(), visitBitTestHeader(), visitJumpTableHeader(), visitSPDescriptorParent(), and visitSwitchCase().
getValueImpl - Helper function for getValue and getNonRegisterValue. Create an SDValue for the given value.
Definition at line 1054 of file SelectionDAGBuilder.cpp.
References llvm::SmallVectorImpl< T >::assign(), llvm::ISD::BUILD_VECTOR, llvm::CallingConv::C, llvm::WinEH::CE, llvm::ComputeValueVTs(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::find(), llvm::SelectionDAG::getBlockAddress(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getConstantFP(), llvm::SelectionDAG::getContext(), getCurSDLoc(), llvm::SequentialType::getElementType(), llvm::SelectionDAG::getEntryNode(), llvm::SelectionDAG::getFrameIndex(), llvm::SelectionDAG::getGlobalAddress(), llvm::SelectionDAG::getMergeValues(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::VectorType::getNumElements(), llvm::SDNode::getNumValues(), llvm::Type::getPointerAddressSpace(), llvm::TargetLoweringBase::getPointerTy(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Value::getType(), llvm::SelectionDAG::getUNDEF(), getValue(), llvm::TargetLoweringBase::getValueType(), llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::Type::isAggregateType(), llvm::EVT::isFloatingPoint(), llvm_unreachable, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::SmallVectorTemplateCommon< T >::size(), llvm::FunctionLoweringInfo::StaticAllocaMap, and visit().
Referenced by getNonRegisterValue(), and getValue().
void SelectionDAGBuilder::init | ( | GCFunctionInfo * | gfi, |
AliasAnalysis & | aa, | ||
const TargetLibraryInfo * | li | ||
) |
Definition at line 859 of file SelectionDAGBuilder.cpp.
References aa, AA, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::clear(), DL, llvm::SelectionDAG::getContext(), llvm::TargetSubtargetInfo::getDataLayout(), llvm::SelectionDAG::getSubtarget(), GFI, LibInfo, and LPadToCallSiteMap.
Referenced by llvm::SelectionDAGISel::runOnMachineFunction().
bool SelectionDAGBuilder::isExportableFromCurrentBlock | ( | const Value * | V, |
const BasicBlock * | FromBB | ||
) |
Definition at line 1320 of file SelectionDAGBuilder.cpp.
References llvm::Function::getEntryBlock(), llvm::BasicBlock::getParent(), and llvm::FunctionLoweringInfo::isExportedInst().
Referenced by EmitBranchForMergedCondition().
std::pair< SDValue, SDValue > SelectionDAGBuilder::LowerCallOperands | ( | const CallInst & | CI, |
unsigned | ArgIdx, | ||
unsigned | NumArgs, | ||
SDValue | Callee, | ||
bool | useVoidTy = false |
||
) |
Lower an argument list according to the target calling convention.
This is a helper for lowering intrinsics that follow a target calling convention or require stack pointer adjustment. Only a subset of the intrinsic's operands need to participate in the calling convention.
Definition at line 6858 of file SelectionDAGBuilder.cpp.
References llvm::CallInst::getCallingConv(), llvm::SelectionDAG::getContext(), getCurSDLoc(), llvm::User::getOperand(), getRoot(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Value::getType(), getValue(), llvm::Type::getVoidTy(), llvm::Type::isEmptyTy(), llvm::TargetLowering::LowerCallTo(), llvm::TargetLowering::ArgListEntry::Node, llvm::TargetLowering::CallLoweringInfo::setCallee(), llvm::TargetLowering::CallLoweringInfo::setChain(), llvm::TargetLowering::CallLoweringInfo::setDebugLoc(), and llvm::Value::use_empty().
void SelectionDAGBuilder::LowerCallTo | ( | ImmutableCallSite | CS, |
SDValue | Callee, | ||
bool | IsTailCall, | ||
MachineBasicBlock * | LandingPad = nullptr |
||
) |
Definition at line 5518 of file SelectionDAGBuilder.cpp.
References llvm::MachineModuleInfo::addInvoke(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_size(), llvm::SmallVectorImpl< T >::clear(), llvm::MCContext::CreateTempSymbol(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getCalledValue(), llvm::MachineModuleInfo::getContext(), getControlRoot(), llvm::MachineModuleInfo::getCurrentCallSite(), getCurSDLoc(), llvm::SelectionDAG::getEHLabel(), llvm::SequentialType::getElementType(), llvm::CallSiteBase< FunTy, ValTy, UserTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::SelectionDAG::getMachineFunction(), llvm::MachineFunction::getMMI(), getRoot(), llvm::TargetMachine::getSubtargetImpl(), llvm::SelectionDAG::getTarget(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Value::getType(), getValue(), HasTailCall, llvm::Type::isEmptyTy(), llvm::isInTailCallPosition(), llvm::LandingPad, llvm::TargetLowering::LowerCallTo(), LPadToCallSiteMap, llvm::TargetLowering::ArgListEntry::Node, llvm::TargetLowering::ArgListEntry::setAttributes(), llvm::TargetLowering::CallLoweringInfo::setCallee(), llvm::MachineModuleInfo::setCallSiteBeginLabel(), llvm::TargetLowering::CallLoweringInfo::setChain(), llvm::MachineModuleInfo::setCurrentCallSite(), llvm::TargetLowering::CallLoweringInfo::setDebugLoc(), llvm::SelectionDAG::setRoot(), llvm::TargetLowering::CallLoweringInfo::setTailCall(), setValue(), and llvm::TargetLowering::ArgListEntry::Ty.
void SelectionDAGBuilder::resolveDanglingDebugInfo | ( | const Value * | V, |
SDValue | Val | ||
) |
Definition at line 984 of file SelectionDAGBuilder.cpp.
References llvm::SelectionDAG::AddDbgValue(), llvm::dbgs(), DEBUG, llvm::SelectionDAG::getDbgValue(), llvm::SDValue::getNode(), llvm::DbgValueInst::getOffset(), llvm::SDValue::getResNo(), and llvm::DbgValueInst::getVariable().
Referenced by getNonRegisterValue(), and getValue().
void llvm::SelectionDAGBuilder::setUnusedArgValue | ( | const Value * | V, |
SDValue | NewN | ||
) | [inline] |
Definition at line 614 of file SelectionDAGBuilder.h.
References llvm::SDValue::getNode(), and N.
void llvm::SelectionDAGBuilder::setValue | ( | const Value * | V, |
SDValue | NewN | ||
) | [inline] |
Definition at line 608 of file SelectionDAGBuilder.h.
References llvm::SDValue::getNode(), and N.
Referenced by LowerCallTo().
bool SelectionDAGBuilder::ShouldEmitAsBranches | ( | const std::vector< CaseBlock > & | Cases | ) |
If the set of cases should be emitted as a series of branches, return true. If we should emit this as a bunch of and/or'd together conditions, return false.
Definition at line 1530 of file SelectionDAGBuilder.cpp.
References llvm::ISD::SETEQ, and llvm::ISD::SETNE.
void SelectionDAGBuilder::UpdateSplitBlock | ( | MachineBasicBlock * | First, |
MachineBasicBlock * | Last | ||
) |
UpdateSplitBlock - When an MBB was split during scheduling, update the references that need to refer to the last resulting block.
Definition at line 2676 of file SelectionDAGBuilder.cpp.
References BitTestCases, JTCases, and llvm::IndexedInstrProf::Last.
void SelectionDAGBuilder::visit | ( | const Instruction & | I | ) |
Definition at line 949 of file SelectionDAGBuilder.cpp.
References CopyToExportRegsIfNeeded(), llvm::Instruction::getOpcode(), llvm::Instruction::getParent(), HasTailCall, and I.
Referenced by getValueImpl().
void SelectionDAGBuilder::visit | ( | unsigned | Opcode, |
const User & | I | ||
) |
Definition at line 970 of file SelectionDAGBuilder.cpp.
References llvm_unreachable.
void SelectionDAGBuilder::visitBitTestCase | ( | BitTestBlock & | BB, |
MachineBasicBlock * | NextMBB, | ||
uint32_t | BranchWeightToNext, | ||
unsigned | Reg, | ||
BitTestCase & | B, | ||
MachineBasicBlock * | SwitchBB | ||
) |
visitBitTestCase - this function produces one "bit test"
Definition at line 1940 of file SelectionDAGBuilder.cpp.
References llvm::ISD::AND, llvm::ISD::BR, llvm::ISD::BRCOND, llvm::CountPopulation_64(), llvm::CountTrailingOnes_64(), llvm::countTrailingZeros(), llvm::MachineFunction::end(), llvm::SelectionDAG::getBasicBlock(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), getControlRoot(), llvm::SelectionDAG::getCopyFromReg(), getCurSDLoc(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSetCC(), llvm::TargetLoweringBase::getSetCCResultType(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::FunctionLoweringInfo::MF, llvm::MVT::Other, llvm::ISD::SETEQ, llvm::ISD::SETNE, llvm::SelectionDAG::setRoot(), and llvm::ISD::SHL.
void SelectionDAGBuilder::visitBitTestHeader | ( | BitTestBlock & | B, |
MachineBasicBlock * | SwitchBB | ||
) |
visitBitTestHeader - This function emits necessary code to produce value suitable for "bit tests"
Definition at line 1877 of file SelectionDAGBuilder.cpp.
References llvm::ISD::BR, llvm::ISD::BRCOND, llvm::FunctionLoweringInfo::CreateReg(), llvm::MachineFunction::end(), llvm::SelectionDAG::getBasicBlock(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), getControlRoot(), llvm::SelectionDAG::getCopyToReg(), getCurSDLoc(), llvm::SelectionDAG::getNode(), llvm::TargetLoweringBase::getPointerTy(), llvm::SelectionDAG::getSetCC(), llvm::TargetLoweringBase::getSetCCResultType(), llvm::EVT::getSimpleVT(), llvm::EVT::getSizeInBits(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), getValue(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getZExtOrTrunc(), llvm::TargetLoweringBase::isTypeLegal(), llvm::isUIntN(), llvm::FunctionLoweringInfo::MF, llvm::MVT::Other, llvm::SelectionDAG::setRoot(), llvm::ISD::SETUGT, and llvm::ISD::SUB.
void SelectionDAGBuilder::visitJumpTable | ( | JumpTable & | JT | ) |
visitJumpTable - Emit JumpTable node in the current MBB
Definition at line 1724 of file SelectionDAGBuilder.cpp.
References llvm::ISD::BR_JT, getControlRoot(), llvm::SelectionDAG::getCopyFromReg(), getCurSDLoc(), llvm::SelectionDAG::getJumpTable(), llvm::SelectionDAG::getNode(), llvm::TargetLoweringBase::getPointerTy(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::SDValue::getValue(), llvm::MVT::Other, and llvm::SelectionDAG::setRoot().
void SelectionDAGBuilder::visitJumpTableHeader | ( | JumpTable & | JT, |
JumpTableHeader & | JTH, | ||
MachineBasicBlock * | SwitchBB | ||
) |
visitJumpTableHeader - This function emits necessary code to produce index in the JumpTable from switch case.
Definition at line 1739 of file SelectionDAGBuilder.cpp.
References llvm::ISD::BR, llvm::ISD::BRCOND, llvm::ARMISD::CMP, llvm::FunctionLoweringInfo::CreateReg(), llvm::MachineFunction::end(), llvm::SelectionDAG::getBasicBlock(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), getControlRoot(), llvm::SelectionDAG::getCopyToReg(), getCurSDLoc(), llvm::SelectionDAG::getNode(), llvm::TargetLoweringBase::getPointerTy(), llvm::SelectionDAG::getSetCC(), llvm::TargetLoweringBase::getSetCCResultType(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), getValue(), llvm::SDValue::getValueType(), llvm::SelectionDAG::getZExtOrTrunc(), llvm::FunctionLoweringInfo::MF, llvm::MVT::Other, llvm::SelectionDAG::setRoot(), llvm::ISD::SETUGT, and llvm::ISD::SUB.
void SelectionDAGBuilder::visitSPDescriptorFailure | ( | StackProtectorDescriptor & | SPD | ) |
Codegen the failure basic block for a stack protector check.
A failure stack protector machine basic block consists simply of a call to __stack_chk_fail().
For a high level explanation of how this fits into the stack protector generation see the comment on the declaration of class StackProtectorDescriptor.
Definition at line 1867 of file SelectionDAGBuilder.cpp.
References getCurSDLoc(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::MVT::isVoid, llvm::TargetLowering::makeLibCall(), llvm::SelectionDAG::setRoot(), and llvm::RTLIB::STACKPROTECTOR_CHECK_FAIL.
void SelectionDAGBuilder::visitSPDescriptorParent | ( | StackProtectorDescriptor & | SPD, |
MachineBasicBlock * | ParentBB | ||
) |
Codegen a new tail for a stack protector check ParentMBB which has had its tail spliced into a stack protector check success bb.
For a high level explanation of how this fits into the stack protector generation see the comment on the declaration of class StackProtectorDescriptor.
Definition at line 1798 of file SelectionDAGBuilder.cpp.
References Align(), llvm::ISD::BR, llvm::ISD::BRCOND, llvm::SelectionDAG::getBasicBlock(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getCopyFromReg(), getCurSDLoc(), llvm::TargetLoweringBase::getDataLayout(), llvm::SelectionDAG::getEntryNode(), llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::SelectionDAG::getLoad(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::TargetLoweringBase::getPointerTy(), llvm::DataLayout::getPrefTypeAlignment(), llvm::SelectionDAG::getSetCC(), llvm::TargetLoweringBase::getSetCCResultType(), llvm::MachineFrameInfo::getStackProtectorIndex(), llvm::TargetMachine::getSubtargetImpl(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::Value::getType(), getValue(), llvm::SDValue::getValueType(), llvm::MVT::Other, llvm::ISD::SETNE, llvm::SelectionDAG::setRoot(), llvm::ISD::SUB, and llvm::TargetLowering::useLoadStackGuardNode().
void SelectionDAGBuilder::visitSwitchCase | ( | CaseBlock & | CB, |
MachineBasicBlock * | SwitchBB | ||
) |
visitSwitchCase - Emits the necessary code to represent a single node in the binary search tree resulting from lowering a switch instruction.
Definition at line 1649 of file SelectionDAGBuilder.cpp.
References llvm::ISD::BR, llvm::ISD::BRCOND, llvm::MachineFunction::end(), llvm::SelectionDAG::getBasicBlock(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), getControlRoot(), getCurSDLoc(), llvm::ConstantInt::getFalse(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSetCC(), llvm::ConstantInt::getTrue(), getValue(), llvm::SDValue::getValueType(), llvm::MVT::i1, llvm::FunctionLoweringInfo::MF, llvm::MVT::Other, llvm::ISD::SETEQ, llvm::ISD::SETLE, llvm::SelectionDAG::setRoot(), llvm::ISD::SETULE, llvm::ISD::SUB, SUB, std::swap(), and llvm::ISD::XOR.
Definition at line 504 of file SelectionDAGBuilder.h.
Referenced by getMemCmpLoad(), and init().
std::vector<BitTestBlock> llvm::SelectionDAGBuilder::BitTestCases |
BitTestCases - Vector of BitTestBlock structures used to communicate SwitchInst code generation information.
Definition at line 515 of file SelectionDAGBuilder.h.
Referenced by UpdateSplitBlock().
Definition at line 522 of file SelectionDAGBuilder.h.
Definition at line 544 of file SelectionDAGBuilder.h.
Definition at line 502 of file SelectionDAGBuilder.h.
Referenced by addStackMapLiveVars(), and getMemCmpLoad().
Definition at line 503 of file SelectionDAGBuilder.h.
Referenced by getMemCmpLoad(), and init().
FuncInfo - Information about the function as a whole.
Definition at line 526 of file SelectionDAGBuilder.h.
GFI - Garbage collection metadata for the function.
Definition at line 533 of file SelectionDAGBuilder.h.
Referenced by init().
HasTailCall - This is set to true if a call in the current block has been translated as a tail call. In this case, no subsequent DAG nodes should be created.
Definition at line 542 of file SelectionDAGBuilder.h.
Referenced by clear(), LowerCallTo(), and visit().
std::vector<JumpTableBlock> llvm::SelectionDAGBuilder::JTCases |
JTCases - Vector of JumpTable structures used to communicate SwitchInst code generation information.
Definition at line 512 of file SelectionDAGBuilder.h.
Referenced by UpdateSplitBlock().
Definition at line 505 of file SelectionDAGBuilder.h.
Referenced by init().
const unsigned llvm::SelectionDAGBuilder::LowestSDNodeOrder = 1 [static] |
Lowest valid SDNodeOrder. The special case 0 is reserved for scheduling nodes without a corresponding SDNode.
Definition at line 500 of file SelectionDAGBuilder.h.
Referenced by clear().
DenseMap<MachineBasicBlock*, SmallVector<unsigned, 4> > llvm::SelectionDAGBuilder::LPadToCallSiteMap |
LPadToCallSiteMap - Map a landing pad to the call site indexes.
Definition at line 536 of file SelectionDAGBuilder.h.
Referenced by init(), and LowerCallTo().
OptLevel - What optimization level we're generating code for.
Definition at line 530 of file SelectionDAGBuilder.h.
PendingLoads - Loads are not emitted to the program immediately. We bunch them up and then emit token factor nodes when possible. This allows us to get simple disambiguation between loads without worrying about alias analysis.
Definition at line 116 of file SelectionDAGBuilder.h.
Referenced by clear(), getMemCmpLoad(), and getRoot().
StackProtectorDescriptor llvm::SelectionDAGBuilder::SPDescriptor |
A StackProtectorDescriptor structure used to communicate stack protector information in between SelectBasicBlock and FinishBasicBlock.
Definition at line 518 of file SelectionDAGBuilder.h.
std::vector<CaseBlock> llvm::SelectionDAGBuilder::SwitchCases |
SwitchCases - Vector of CaseBlock structures used to communicate SwitchInst code generation information.
Definition at line 509 of file SelectionDAGBuilder.h.
Referenced by EmitBranchForMergedCondition().