LLVM  8.0.0svn
Classes | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
llvm::SelectionDAGBuilder Class Reference

SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameterized by a TargetLowering object. More...

#include "CodeGen/SelectionDAG/SelectionDAGBuilder.h"

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

Classes

struct  StatepointLoweringInfo
 Describes a gc.statepoint or a gc.statepoint like thing for the purposes of lowering into a STATEPOINT node. More...
 

Public Member Functions

 SelectionDAGBuilder (SelectionDAG &dag, FunctionLoweringInfo &funcinfo, CodeGenOpt::Level ol)
 
void init (GCFunctionInfo *gfi, AliasAnalysis *AA, const TargetLibraryInfo *li)
 
void clear ()
 Clear out the current SelectionDAG and the associated state and prepare this SelectionDAGBuilder object to be used for a new block. More...
 
void clearDanglingDebugInfo ()
 Clear the dangling debug information map. More...
 
SDValue getRoot ()
 Return the current virtual root of the Selection DAG, flushing any PendingLoad items. More...
 
SDValue getControlRoot ()
 Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports items. More...
 
SDLoc getCurSDLoc () const
 
DebugLoc getCurDebugLoc () const
 
void CopyValueToVirtualRegister (const Value *V, unsigned Reg)
 
void visit (const Instruction &I)
 
void visit (unsigned Opcode, const User &I)
 
SDValue getCopyFromRegs (const Value *V, Type *Ty)
 getCopyFromRegs - If there was virtual register allocated for the value V emit CopyFromReg of the specified type Ty. More...
 
void dropDanglingDebugInfo (const DILocalVariable *Variable, const DIExpression *Expr)
 If we have dangling debug info that describes Variable, or an overlapping part of variable considering the Expr, then this method weill drop that debug info as it isn't valid any longer. More...
 
void resolveDanglingDebugInfo (const Value *V, SDValue Val)
 
SDValue getValue (const Value *V)
 getValue - Return an SDValue for the given Value. More...
 
bool findValue (const Value *V) const
 
SDNodegetNodeForIRValue (const Value *V)
 Return the SDNode for the specified IR value if it exists. More...
 
SDValue getNonRegisterValue (const Value *V)
 getNonRegisterValue - Return an SDValue for the given Value, but don't look in FuncInfo.ValueMap for a virtual register. More...
 
SDValue getValueImpl (const Value *V)
 getValueImpl - Helper function for getValue and getNonRegisterValue. More...
 
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, Instruction::BinaryOps Opc, BranchProbability TProb, BranchProbability FProb, bool InvertCond)
 FindMergedConditions - If Cond is an expression like. More...
 
void EmitBranchForMergedCondition (const Value *Cond, MachineBasicBlock *TBB, MachineBasicBlock *FBB, MachineBasicBlock *CurBB, MachineBasicBlock *SwitchBB, BranchProbability TProb, BranchProbability FProb, bool InvertCond)
 EmitBranchForMergedCondition - Helper method for FindMergedConditions. More...
 
bool ShouldEmitAsBranches (const std::vector< CaseBlock > &Cases)
 If the set of cases should be emitted as a series of branches, return true. More...
 
bool isExportableFromCurrentBlock (const Value *V, const BasicBlock *FromBB)
 
void 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. More...
 
void 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. More...
 
void LowerCallTo (ImmutableCallSite CS, SDValue Callee, bool IsTailCall, const BasicBlock *EHPadBB=nullptr)
 
SDValue lowerRangeToAssertZExt (SelectionDAG &DAG, const Instruction &I, SDValue Op)
 
void populateCallLoweringInfo (TargetLowering::CallLoweringInfo &CLI, ImmutableCallSite CS, unsigned ArgIdx, unsigned NumArgs, SDValue Callee, Type *ReturnTy, bool IsPatchPoint)
 Populate a CallLowerinInfo (into CLI) based on the properties of the call being lowered. More...
 
std::pair< SDValue, SDValuelowerInvokable (TargetLowering::CallLoweringInfo &CLI, const BasicBlock *EHPadBB=nullptr)
 
void 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. More...
 
SDValue LowerAsSTATEPOINT (StatepointLoweringInfo &SI)
 Lower SLI into a STATEPOINT instruction. More...
 
void LowerStatepoint (ImmutableStatepoint ISP, const BasicBlock *EHPadBB=nullptr)
 
void LowerCallSiteWithDeoptBundle (ImmutableCallSite CS, SDValue Callee, const BasicBlock *EHPadBB)
 
void LowerDeoptimizeCall (const CallInst *CI)
 
void LowerDeoptimizingReturn ()
 
void LowerCallSiteWithDeoptBundleImpl (ImmutableCallSite CS, SDValue Callee, const BasicBlock *EHPadBB, bool VarArgDisallowed, bool ForceVoidReturnTy)
 
MVT getFrameIndexTy ()
 Returns the type of FrameIndex and TargetFrameIndex nodes. More...
 
void 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. More...
 
void 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. More...
 
void visitSPDescriptorFailure (StackProtectorDescriptor &SPD)
 Codegen the failure basic block for a stack protector check. More...
 
void visitBitTestHeader (BitTestBlock &B, MachineBasicBlock *SwitchBB)
 visitBitTestHeader - This function emits necessary code to produce value suitable for "bit tests" More...
 
void visitBitTestCase (BitTestBlock &BB, MachineBasicBlock *NextMBB, BranchProbability BranchProbToNext, unsigned Reg, BitTestCase &B, MachineBasicBlock *SwitchBB)
 visitBitTestCase - this function produces one "bit test" More...
 
void visitJumpTable (JumpTable &JT)
 visitJumpTable - Emit JumpTable node in the current MBB More...
 
void visitJumpTableHeader (JumpTable &JT, JumpTableHeader &JTH, MachineBasicBlock *SwitchBB)
 visitJumpTableHeader - This function emits necessary code to produce index in the JumpTable from switch case. More...
 

Public Attributes

SmallVector< SDValue, 8 > PendingLoads
 PendingLoads - Loads are not emitted to the program immediately. More...
 
StatepointLoweringState StatepointLowering
 State used while lowering a statepoint sequence (gc_statepoint, gc_relocate, and gc_result). More...
 
SelectionDAGDAG
 
const DataLayoutDL = nullptr
 
AliasAnalysisAA = nullptr
 
const TargetLibraryInfoLibInfo
 
std::vector< CaseBlock > SwitchCases
 SwitchCases - Vector of CaseBlock structures used to communicate SwitchInst code generation information. More...
 
std::vector< JumpTableBlock > JTCases
 JTCases - Vector of JumpTable structures used to communicate SwitchInst code generation information. More...
 
std::vector< BitTestBlock > BitTestCases
 BitTestCases - Vector of BitTestBlock structures used to communicate SwitchInst code generation information. More...
 
StackProtectorDescriptor SPDescriptor
 A StackProtectorDescriptor structure used to communicate stack protector information in between SelectBasicBlock and FinishBasicBlock. More...
 
DenseMap< const Constant *, unsignedConstantsOut
 
FunctionLoweringInfoFuncInfo
 FuncInfo - Information about the function as a whole. More...
 
GCFunctionInfoGFI
 GFI - Garbage collection metadata for the function. More...
 
DenseMap< MachineBasicBlock *, SmallVector< unsigned, 4 > > LPadToCallSiteMap
 LPadToCallSiteMap - Map a landing pad to the call site indexes. More...
 
bool HasTailCall = false
 HasTailCall - This is set to true if a call in the current block has been translated as a tail call. More...
 
LLVMContextContext
 

Static Public Attributes

static const unsigned LowestSDNodeOrder = 1
 Lowest valid SDNodeOrder. More...
 

Detailed Description

SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameterized by a TargetLowering object.

Definition at line 93 of file SelectionDAGBuilder.h.

Constructor & Destructor Documentation

◆ SelectionDAGBuilder()

llvm::SelectionDAGBuilder::SelectionDAGBuilder ( SelectionDAG dag,
FunctionLoweringInfo funcinfo,
CodeGenOpt::Level  ol 
)
inline

Member Function Documentation

◆ clear()

void SelectionDAGBuilder::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 1006 of file SelectionDAGBuilder.cpp.

Referenced by SelectionDAGBuilder().

◆ clearDanglingDebugInfo()

void SelectionDAGBuilder::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 1017 of file SelectionDAGBuilder.cpp.

Referenced by SelectionDAGBuilder().

◆ CopyToExportRegsIfNeeded()

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 1689 of file SelectionDAGBuilder.cpp.

References assert(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::Value::getType(), llvm::Type::isEmptyTy(), and llvm::Value::use_empty().

Referenced by setUnusedArgValue().

◆ CopyValueToVirtualRegister()

void SelectionDAGBuilder::CopyValueToVirtualRegister ( const Value V,
unsigned  Reg 
)

◆ dropDanglingDebugInfo()

void SelectionDAGBuilder::dropDanglingDebugInfo ( const DILocalVariable Variable,
const DIExpression Expr 
)

If we have dangling debug info that describes Variable, or an overlapping part of variable considering the Expr, then this method weill drop that debug info as it isn't valid any longer.

Definition at line 1119 of file SelectionDAGBuilder.cpp.

References llvm::dbgs(), llvm::DIExpression::fragmentsOverlap(), llvm::DbgVariableIntrinsic::getExpression(), llvm::DbgVariableIntrinsic::getVariable(), LLVM_DEBUG, and llvm::remove_if().

Referenced by getCurDebugLoc().

◆ EmitBranchForMergedCondition()

void SelectionDAGBuilder::EmitBranchForMergedCondition ( const Value Cond,
MachineBasicBlock TBB,
MachineBasicBlock FBB,
MachineBasicBlock CurBB,
MachineBasicBlock SwitchBB,
BranchProbability  TProb,
BranchProbability  FProb,
bool  InvertCond 
)

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 1780 of file SelectionDAGBuilder.cpp.

References R600_InstFlag::FC, llvm::MachineBasicBlock::getBasicBlock(), llvm::SelectionDAG::getContext(), llvm::getFCmpCodeWithoutNaN(), llvm::getFCmpCondCode(), llvm::getICmpCondCode(), llvm::CmpInst::getInversePredicate(), llvm::CmpInst::getPredicate(), llvm::ConstantInt::getTrue(), llvm::ISD::SETEQ, llvm::ISD::SETNE, and llvm::SystemZISD::TM.

Referenced by setUnusedArgValue().

◆ ExportFromCurrentBlock()

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 1704 of file SelectionDAGBuilder.cpp.

References Reg.

Referenced by lowerStatepointMetaArgs(), and setUnusedArgValue().

◆ FindMergedConditions()

void SelectionDAGBuilder::FindMergedConditions ( const Value Cond,
MachineBasicBlock TBB,
MachineBasicBlock FBB,
MachineBasicBlock CurBB,
MachineBasicBlock SwitchBB,
Instruction::BinaryOps  Opc,
BranchProbability  TProb,
BranchProbability  FProb,
bool  InvertCond 
)

◆ findValue()

bool SelectionDAGBuilder::findValue ( const Value V) const

Definition at line 1224 of file SelectionDAGBuilder.cpp.

Referenced by getCurDebugLoc(), and getUniformBase().

◆ getControlRoot()

SDValue SelectionDAGBuilder::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 1040 of file SelectionDAGBuilder.cpp.

References assert(), llvm::ISD::EntryToken, llvm::SelectionDAG::getNode(), llvm::SDValue::getOpcode(), llvm::SelectionDAG::getRoot(), llvm::MVT::Other, llvm::SelectionDAG::setRoot(), and llvm::ISD::TokenFactor.

Referenced by SelectionDAGBuilder().

◆ getCopyFromRegs()

SDValue SelectionDAGBuilder::getCopyFromRegs ( const Value V,
Type Ty 
)

◆ getCurDebugLoc()

DebugLoc llvm::SelectionDAGBuilder::getCurDebugLoc ( ) const
inline

◆ getCurSDLoc()

SDLoc llvm::SelectionDAGBuilder::getCurSDLoc ( ) const
inline

◆ getFrameIndexTy()

MVT llvm::SelectionDAGBuilder::getFrameIndexTy ( )
inline

◆ getNodeForIRValue()

SDNode* llvm::SelectionDAGBuilder::getNodeForIRValue ( const Value V)
inline

◆ getNonRegisterValue()

SDValue SelectionDAGBuilder::getNonRegisterValue ( const Value V)

getNonRegisterValue - Return an SDValue for the given Value, but don't look in FuncInfo.ValueMap for a virtual register.

Definition at line 1231 of file SelectionDAGBuilder.cpp.

References llvm::SDValue::getNode(), N, and llvm::SDNode::setDebugLoc().

Referenced by getNodeForIRValue().

◆ getRoot()

SDValue SelectionDAGBuilder::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 1021 of file SelectionDAGBuilder.cpp.

References llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getRoot(), llvm::MVT::Other, llvm::SelectionDAG::setRoot(), and llvm::ISD::TokenFactor.

Referenced by lowerIncomingStatepointValue(), and SelectionDAGBuilder().

◆ getValue()

SDValue SelectionDAGBuilder::getValue ( const Value V)

◆ getValueImpl()

SDValue SelectionDAGBuilder::getValueImpl ( const Value V)

getValueImpl - Helper function for getValue and getNonRegisterValue.

Create an SDValue for the given value.

Definition at line 1254 of file SelectionDAGBuilder.cpp.

References llvm::MachineBasicBlock::addSuccessor(), assert(), llvm::SmallVectorImpl< T >::assign(), llvm::ISD::BR, C, llvm::ISD::CATCHPAD, llvm::ISD::CATCHRET, llvm::classifyEHPersonality(), llvm::ComputeValueVTs(), llvm::CoreCLR, getABIRegCopyCC(), llvm::SelectionDAG::getBasicBlock(), llvm::SelectionDAG::getBlockAddress(), llvm::SelectionDAG::getBuildVector(), llvm::CatchReturnInst::getCatchSwitchParentPad(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getConstantFP(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::SequentialType::getElementType(), llvm::SelectionDAG::getEntryNode(), llvm::SelectionDAG::getFrameIndex(), llvm::TargetLoweringBase::getFrameIndexTy(), llvm::SelectionDAG::getGlobalAddress(), llvm::SelectionDAG::getMergeValues(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SequentialType::getNumElements(), llvm::SDNode::getNumValues(), getParent(), llvm::Type::getPointerAddressSpace(), llvm::TargetLoweringBase::getPointerTy(), llvm::CatchReturnInst::getSuccessor(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::Value::getType(), llvm::SelectionDAG::getUNDEF(), llvm::TargetLoweringBase::getValueType(), I, llvm::Type::isAggregateType(), llvm::Type::isArrayTy(), llvm::isAsynchronousEHPersonality(), llvm::EVT::isFloatingPoint(), llvm::Type::isStructTy(), llvm_unreachable, llvm::MSVC_CXX, llvm::CodeGenOpt::None, llvm::CallBase< InstTy >::op_begin(), llvm::CallBase< InstTy >::op_end(), llvm::MVT::Other, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MipsISD::Ret, llvm::MachineBasicBlock::setIsEHFuncletEntry(), llvm::MachineBasicBlock::setIsEHScopeEntry(), llvm::SelectionDAG::setRoot(), SI, llvm::SmallVectorBase::size(), llvm::SystemZISD::TM, llvm::RegsForValue::ValueVTs, and llvm::Wasm_CXX.

Referenced by getNodeForIRValue().

◆ init()

void SelectionDAGBuilder::init ( GCFunctionInfo gfi,
AliasAnalysis AA,
const TargetLibraryInfo li 
)

◆ isExportableFromCurrentBlock()

bool SelectionDAGBuilder::isExportableFromCurrentBlock ( const Value V,
const BasicBlock FromBB 
)

◆ LowerAsSTATEPOINT()

SDValue SelectionDAGBuilder::LowerAsSTATEPOINT ( SelectionDAGBuilder::StatepointLoweringInfo SI)

Lower SLI into a STATEPOINT instruction.

Definition at line 595 of file StatepointLowering.cpp.

References assert(), llvm::SelectionDAGBuilder::StatepointLoweringInfo::Bases, llvm::TargetLowering::CallLoweringInfo::CallConv, llvm::SelectionDAGBuilder::StatepointLoweringInfo::CLI, llvm::SmallVectorTemplateCommon< T >::end(), llvm::ISD::GC_TRANSITION_END, llvm::ISD::GC_TRANSITION_START, llvm::SelectionDAGBuilder::StatepointLoweringInfo::GCRelocates, llvm::GCTransition, llvm::SelectionDAGBuilder::StatepointLoweringInfo::GCTransitionArgs, llvm::SDNode::getGluedNode(), llvm::SDValue::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getOperand(), llvm::Instruction::getParent(), llvm::Value::getType(), llvm::SDValue::getValue(), llvm::MVT::Glue, llvm::MVT::i32, llvm::MVT::i64, llvm::SelectionDAGBuilder::StatepointLoweringInfo::ID, llvm::SmallVectorImpl< T >::insert(), llvm::Type::isPointerTy(), lowerCallFromStatepointLoweringInfo(), lowerStatepointMetaArgs(), llvm::MaskAll, llvm::SelectionDAGBuilder::StatepointLoweringInfo::NumPatchBytes, llvm::SDNode::op_begin(), llvm::SDNode::op_end(), llvm::MVT::Other, llvm::SelectionDAGBuilder::StatepointLoweringInfo::Ptrs, llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), pushStackMapConstant(), removeDuplicateGCPtrs(), llvm::TargetLowering::CallLoweringInfo::setChain(), llvm::SelectionDAGBuilder::StatepointLoweringInfo::StatepointFlags, and llvm::SelectionDAGBuilder::StatepointLoweringInfo::StatepointInstr.

Referenced by llvm::SelectionDAGBuilder::StatepointLoweringInfo::StatepointLoweringInfo().

◆ LowerCallSiteWithDeoptBundle()

void SelectionDAGBuilder::LowerCallSiteWithDeoptBundle ( ImmutableCallSite  CS,
SDValue  Callee,
const BasicBlock EHPadBB 
)

◆ LowerCallSiteWithDeoptBundleImpl()

void SelectionDAGBuilder::LowerCallSiteWithDeoptBundleImpl ( ImmutableCallSite  CS,
SDValue  Callee,
const BasicBlock EHPadBB,
bool  VarArgDisallowed,
bool  ForceVoidReturnTy 
)

Definition at line 884 of file StatepointLowering.cpp.

References llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), Callee, llvm::SelectionDAGBuilder::StatepointLoweringInfo::CLI, llvm::StatepointDirectives::DeoptBundleStatepointID, llvm::SelectionDAGBuilder::StatepointLoweringInfo::DeoptState, llvm::SelectionDAGBuilder::StatepointLoweringInfo::EHPadBB, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getAttributes(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getFunctionType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getNumArgOperands(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getOperandBundle(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getType(), llvm::Type::getVoidTy(), llvm::SelectionDAGBuilder::StatepointLoweringInfo::ID, llvm::FunctionType::isVarArg(), llvm::TargetLowering::CallLoweringInfo::IsVarArg, llvm::None, llvm::SelectionDAGBuilder::StatepointLoweringInfo::NumPatchBytes, llvm::LLVMContext::OB_deopt, llvm::User::op_begin(), llvm::parseStatepointDirectivesFromAttrs(), SI, and llvm::SelectionDAGBuilder::StatepointLoweringInfo::StatepointFlags.

Referenced by llvm::SelectionDAGBuilder::StatepointLoweringInfo::StatepointLoweringInfo().

◆ LowerCallTo()

void SelectionDAGBuilder::LowerCallTo ( ImmutableCallSite  CS,
SDValue  Callee,
bool  IsTailCall,
const BasicBlock EHPadBB = nullptr 
)

Definition at line 6455 of file SelectionDAGBuilder.cpp.

References llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_begin(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_end(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::arg_size(), llvm::AMDGPU::HSAMD::Kernel::Key::Args, llvm::TargetLowering::CallLoweringInfo::DAG, llvm::TargetLowering::CallLoweringInfo::DL, first, llvm::SelectionDAG::getCopyToReg(), llvm::SelectionDAG::getDataLayout(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getFunctionType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getInstruction(), llvm::Instruction::getParent(), llvm::BasicBlock::getParent(), llvm::TargetLoweringBase::getPointerTy(), llvm::SelectionDAG::getRegister(), llvm::SelectionDAG::getTarget(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::Value::getType(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getType(), llvm::TargetLowering::CallLoweringInfo::InVals, llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::isConvergent(), llvm::Type::isEmptyTy(), llvm::isInTailCallPosition(), llvm::TargetLoweringBase::ArgListEntry::IsSRet, llvm::TargetLoweringBase::ArgListEntry::IsSwiftError, llvm::TargetLoweringBase::ArgListEntry::Node, Result, llvm::TargetLoweringBase::ArgListEntry::setAttributes(), llvm::TargetLowering::CallLoweringInfo::setCallee(), llvm::TargetLowering::CallLoweringInfo::setChain(), llvm::TargetLowering::CallLoweringInfo::setConvergent(), llvm::TargetLowering::CallLoweringInfo::setDebugLoc(), llvm::SelectionDAG::setRoot(), llvm::TargetLowering::CallLoweringInfo::setTailCall(), llvm::TargetLowering::supportSwiftError(), and llvm::TargetLoweringBase::ArgListEntry::Ty.

Referenced by setUnusedArgValue().

◆ LowerDeoptimizeCall()

void SelectionDAGBuilder::LowerDeoptimizeCall ( const CallInst CI)

◆ LowerDeoptimizingReturn()

void SelectionDAGBuilder::LowerDeoptimizingReturn ( )

◆ lowerInvokable()

std::pair< SDValue, SDValue > SelectionDAGBuilder::lowerInvokable ( TargetLowering::CallLoweringInfo CLI,
const BasicBlock EHPadBB = nullptr 
)

◆ lowerRangeToAssertZExt()

SDValue SelectionDAGBuilder::lowerRangeToAssertZExt ( SelectionDAG DAG,
const Instruction I,
SDValue  Op 
)

◆ LowerStatepoint()

void SelectionDAGBuilder::LowerStatepoint ( ImmutableStatepoint  ISP,
const BasicBlock EHPadBB = nullptr 
)

Definition at line 791 of file StatepointLowering.cpp.

References llvm::CallingConv::AnyReg, assert(), llvm::StatepointBase< const Function, const Instruction, const Value, ImmutableCallSite >::CallArgsBeginPos, llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::deopt_begin(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::deopt_end(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::gc_args_begin(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::gc_args_end(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getActualReturnType(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getCalledValue(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCallingConv(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getCallSite(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getFlags(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getGCResult(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getID(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getInstruction(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getNumCallArgs(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getNumPatchBytes(), llvm::Instruction::getParent(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getParent(), llvm::Type::getPointerAddressSpace(), llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::getRelocates(), llvm::Value::getType(), llvm::Type::isVoidTy(), Reg, SI, and llvm::StatepointBase< FunTy, InstructionTy, ValueTy, CallSiteTy >::verify().

Referenced by llvm::SelectionDAGBuilder::StatepointLoweringInfo::StatepointLoweringInfo().

◆ populateCallLoweringInfo()

void SelectionDAGBuilder::populateCallLoweringInfo ( TargetLowering::CallLoweringInfo CLI,
ImmutableCallSite  CS,
unsigned  ArgIdx,
unsigned  NumArgs,
SDValue  Callee,
Type ReturnTy,
bool  IsPatchPoint 
)

Populate a CallLowerinInfo (into CLI) based on the properties of the call being lowered.

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 7991 of file SelectionDAGBuilder.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::CallSiteBase< FunTy, BBTy, ValTy, UserTy, UseTy, InstrTy, CallTy, InvokeTy, IterTy >::getCallingConv(), llvm::Value::getType(), llvm::Type::isEmptyTy(), llvm::TargetLoweringBase::ArgListEntry::Node, llvm::TargetLowering::CallLoweringInfo::setCallee(), llvm::TargetLowering::CallLoweringInfo::setChain(), and llvm::TargetLowering::CallLoweringInfo::setDebugLoc().

Referenced by setUnusedArgValue().

◆ resolveDanglingDebugInfo()

void SelectionDAGBuilder::resolveDanglingDebugInfo ( const Value V,
SDValue  Val 
)

◆ setUnusedArgValue()

void llvm::SelectionDAGBuilder::setUnusedArgValue ( const Value V,
SDValue  NewN 
)
inline

◆ setValue()

void llvm::SelectionDAGBuilder::setValue ( const Value V,
SDValue  NewN 
)
inline

Definition at line 700 of file SelectionDAGBuilder.h.

References assert(), llvm::SDValue::getNode(), and N.

◆ ShouldEmitAsBranches()

bool SelectionDAGBuilder::ShouldEmitAsBranches ( const std::vector< CaseBlock > &  Cases)

◆ UpdateSplitBlock()

void SelectionDAGBuilder::UpdateSplitBlock ( MachineBasicBlock First,
MachineBasicBlock Last 
)

◆ visit() [1/2]

void SelectionDAGBuilder::visit ( const Instruction I)

◆ visit() [2/2]

void SelectionDAGBuilder::visit ( unsigned  Opcode,
const User I 
)

Definition at line 1107 of file SelectionDAGBuilder.cpp.

References llvm_unreachable.

◆ visitBitTestCase()

void SelectionDAGBuilder::visitBitTestCase ( BitTestBlock &  BB,
MachineBasicBlock NextMBB,
BranchProbability  BranchProbToNext,
unsigned  Reg,
BitTestCase &  B,
MachineBasicBlock SwitchBB 
)

visitBitTestCase - this function produces one "bit test"

Definition at line 2394 of file SelectionDAGBuilder.cpp.

References llvm::ISD::AND, assert(), llvm::ISD::BR, llvm::ISD::BRCOND, Callee, llvm::ComputeValueVTs(), llvm::OperandBundleUser< InstrTy, OpIteratorTy >::countOperandBundlesOfType(), llvm::countPopulation(), llvm::countTrailingOnes(), llvm::countTrailingZeros(), llvm::dyn_cast(), findUnwindDestinations(), llvm::MachineBasicBlock::getBasicBlock(), llvm::SelectionDAG::getBasicBlock(), llvm::InvokeInst::getCalledValue(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getCopyFromReg(), llvm::SelectionDAG::getDataLayout(), llvm::BranchProbabilityInfo::getEdgeProbability(), llvm::SelectionDAG::getEntryNode(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getSetCC(), llvm::TargetLoweringBase::getSetCCResultType(), llvm::InvokeInst::getSuccessor(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::Value::getType(), llvm::ConstantInt::getValue(), llvm::SelectionDAG::getVTList(), llvm::BranchProbability::getZero(), llvm::SelectionDAG::getZExtOrTrunc(), llvm::OperandBundleUser< InstrTy, OpIteratorTy >::hasOperandBundlesOtherThan(), llvm::isStatepoint(), llvm::Type::isTokenTy(), llvm_unreachable, llvm::ISD::MERGE_VALUES, N, llvm::MachineBasicBlock::normalizeSuccProbs(), llvm::LLVMContext::OB_deopt, llvm::MVT::Other, llvm::MCID::Return, llvm::ISD::SETEQ, llvm::ISD::SETNE, llvm::SelectionDAG::setRoot(), llvm::ISD::SHL, llvm::SmallVectorBase::size(), llvm::sort(), and llvm::RegsForValue::ValueVTs.

Referenced by getFrameIndexTy().

◆ visitBitTestHeader()

void SelectionDAGBuilder::visitBitTestHeader ( BitTestBlock &  B,
MachineBasicBlock SwitchBB 
)

◆ visitJumpTable()

void SelectionDAGBuilder::visitJumpTable ( JumpTable &  JT)

◆ visitJumpTableHeader()

void SelectionDAGBuilder::visitJumpTableHeader ( JumpTable &  JT,
JumpTableHeader &  JTH,
MachineBasicBlock SwitchBB 
)

◆ visitSPDescriptorFailure()

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 2326 of file SelectionDAGBuilder.cpp.

References llvm::SelectionDAG::getTargetLoweringInfo(), llvm::MVT::isVoid, llvm::TargetLowering::makeLibCall(), llvm::None, and llvm::SelectionDAG::setRoot().

Referenced by getFrameIndexTy().

◆ visitSPDescriptorParent()

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 2228 of file SelectionDAGBuilder.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Arg::Key::Align, llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::ISD::BR, llvm::ISD::BRCOND, llvm::TargetLowering::emitStackGuardXorFP(), llvm::SelectionDAG::getBasicBlock(), llvm::SelectionDAG::getConstant(), llvm::Module::getContext(), llvm::SelectionDAG::getContext(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getEntryNode(), llvm::MachinePointerInfo::getFixedStack(), llvm::SelectionDAG::getFrameIndex(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::Type::getInt8PtrTy(), llvm::SelectionDAG::getLoad(), getLoadStackGuard(), llvm::SelectionDAG::getMachineFunction(), llvm::SelectionDAG::getNode(), llvm::SDValue::getOperand(), llvm::MachineBasicBlock::getParent(), llvm::GlobalValue::getParent(), llvm::TargetLoweringBase::getPointerTy(), llvm::TargetLoweringBase::getSDagStackGuard(), llvm::SelectionDAG::getSetCC(), llvm::TargetLoweringBase::getSetCCResultType(), llvm::TargetLoweringBase::getSSPStackGuardCheck(), llvm::MachineFrameInfo::getStackProtectorIndex(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::SDValue::getValueType(), llvm::TargetLoweringBase::ArgListEntry::IsInReg, llvm::TargetLowering::LowerCallTo(), llvm::MachineMemOperand::MOVolatile, llvm::TargetLoweringBase::ArgListEntry::Node, llvm::MVT::Other, Result, llvm::TargetLowering::CallLoweringInfo::setChain(), llvm::TargetLowering::CallLoweringInfo::setDebugLoc(), llvm::ISD::SETNE, llvm::SelectionDAG::setRoot(), llvm::ISD::SUB, llvm::TargetLoweringBase::ArgListEntry::Ty, llvm::TargetLowering::useLoadStackGuardNode(), and llvm::TargetLoweringBase::useStackGuardXorFP().

Referenced by getFrameIndexTy().

◆ visitSwitchCase()

void SelectionDAGBuilder::visitSwitchCase ( CaseBlock &  CB,
MachineBasicBlock SwitchBB 
)

Member Data Documentation

◆ AA

AliasAnalysis* llvm::SelectionDAGBuilder::AA = nullptr

Definition at line 588 of file SelectionDAGBuilder.h.

Referenced by getMemCmpLoad().

◆ BitTestCases

std::vector<BitTestBlock> llvm::SelectionDAGBuilder::BitTestCases

BitTestCases - Vector of BitTestBlock structures used to communicate SwitchInst code generation information.

Definition at line 601 of file SelectionDAGBuilder.h.

◆ ConstantsOut

DenseMap<const Constant *, unsigned> llvm::SelectionDAGBuilder::ConstantsOut

Definition at line 609 of file SelectionDAGBuilder.h.

◆ Context

LLVMContext* llvm::SelectionDAGBuilder::Context

Definition at line 626 of file SelectionDAGBuilder.h.

◆ DAG

SelectionDAG& llvm::SelectionDAGBuilder::DAG

◆ DL

const DataLayout* llvm::SelectionDAGBuilder::DL = nullptr

Definition at line 587 of file SelectionDAGBuilder.h.

Referenced by getMemCmpLoad().

◆ FuncInfo

FunctionLoweringInfo& llvm::SelectionDAGBuilder::FuncInfo

◆ GFI

GCFunctionInfo* llvm::SelectionDAGBuilder::GFI

GFI - Garbage collection metadata for the function.

Definition at line 616 of file SelectionDAGBuilder.h.

Referenced by lowerStatepointMetaArgs().

◆ HasTailCall

bool llvm::SelectionDAGBuilder::HasTailCall = false

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 624 of file SelectionDAGBuilder.h.

◆ JTCases

std::vector<JumpTableBlock> llvm::SelectionDAGBuilder::JTCases

JTCases - Vector of JumpTable structures used to communicate SwitchInst code generation information.

Definition at line 597 of file SelectionDAGBuilder.h.

◆ LibInfo

const TargetLibraryInfo* llvm::SelectionDAGBuilder::LibInfo

Definition at line 589 of file SelectionDAGBuilder.h.

◆ LowestSDNodeOrder

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 584 of file SelectionDAGBuilder.h.

◆ LPadToCallSiteMap

DenseMap<MachineBasicBlock *, SmallVector<unsigned, 4> > llvm::SelectionDAGBuilder::LPadToCallSiteMap

LPadToCallSiteMap - Map a landing pad to the call site indexes.

Definition at line 619 of file SelectionDAGBuilder.h.

Referenced by hasExceptionPointerOrCodeUser().

◆ PendingLoads

SmallVector<SDValue, 8> llvm::SelectionDAGBuilder::PendingLoads

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 131 of file SelectionDAGBuilder.h.

Referenced by getMemCmpLoad().

◆ SPDescriptor

StackProtectorDescriptor llvm::SelectionDAGBuilder::SPDescriptor

A StackProtectorDescriptor structure used to communicate stack protector information in between SelectBasicBlock and FinishBasicBlock.

Definition at line 605 of file SelectionDAGBuilder.h.

◆ StatepointLowering

StatepointLoweringState llvm::SelectionDAGBuilder::StatepointLowering

State used while lowering a statepoint sequence (gc_statepoint, gc_relocate, and gc_result).

See StatepointLowering.hpp/cpp for details.

Definition at line 135 of file SelectionDAGBuilder.h.

Referenced by lowerStatepointMetaArgs(), reservePreviousStackSlotForValue(), and spillIncomingStatepointValue().

◆ SwitchCases

std::vector<CaseBlock> llvm::SelectionDAGBuilder::SwitchCases

SwitchCases - Vector of CaseBlock structures used to communicate SwitchInst code generation information.

Definition at line 593 of file SelectionDAGBuilder.h.


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