LLVM  14.0.0git
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

class  SDAGSwitchLowering
 
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, SwiftErrorValueTracking &swifterror, CodeGenOpt::Level ol)
 
void init (GCFunctionInfo *gfi, AAResults *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 getMemoryRoot ()
 Return the current virtual root of the Selection DAG, flushing any PendingLoad items. More...
 
SDValue getRoot ()
 Similar to getMemoryRoot, but also flushes PendingConstrainedFP(Strict) items. More...
 
SDValue getControlRoot ()
 Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports (and PendingConstrainedFPStrict) 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)
 If there was virtual register allocated for the value V emit CopyFromReg of the specified type Ty. More...
 
void addDanglingDebugInfo (const DbgValueInst *DI, DebugLoc DL, unsigned Order)
 Register a dbg_value which relies on a Value which we have not yet seen. 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 will drop that debug info as it isn't valid any longer. More...
 
void resolveDanglingDebugInfo (const Value *V, SDValue Val)
 If we saw an earlier dbg_value referring to V, generate the debug data structures now that we've seen its definition. More...
 
void salvageUnresolvedDbgValue (DanglingDebugInfo &DDI)
 For the given dangling debuginfo record, perform last-ditch efforts to resolve the debuginfo to something that is represented in this DAG. More...
 
bool handleDebugValue (ArrayRef< const Value * > Values, DILocalVariable *Var, DIExpression *Expr, DebugLoc CurDL, DebugLoc InstDL, unsigned Order, bool IsVariadic)
 For a given list of Values, attempt to create and record a SDDbgValue in the SelectionDAG. More...
 
void resolveOrClearDbgInfo ()
 Evict any dangling debug information, attempting to salvage it first. More...
 
SDValue getValue (const Value *V)
 getValue - Return an SDValue for the given Value. 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)
 
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< SwitchCG::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 (const CallBase &CB, SDValue Callee, bool IsTailCall, bool IsMustTailCall, const BasicBlock *EHPadBB=nullptr)
 
SDValue lowerRangeToAssertZExt (SelectionDAG &DAG, const Instruction &I, SDValue Op)
 
void populateCallLoweringInfo (TargetLowering::CallLoweringInfo &CLI, const CallBase *Call, 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)
 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 (const GCStatepointInst &I, const BasicBlock *EHPadBB=nullptr)
 
void LowerCallSiteWithDeoptBundle (const CallBase *Call, SDValue Callee, const BasicBlock *EHPadBB)
 
void LowerDeoptimizeCall (const CallInst *CI)
 
void LowerDeoptimizingReturn ()
 
void LowerCallSiteWithDeoptBundleImpl (const CallBase *Call, SDValue Callee, const BasicBlock *EHPadBB, bool VarArgDisallowed, bool ForceVoidReturnTy)
 
MVT getFrameIndexTy ()
 Returns the type of FrameIndex and TargetFrameIndex nodes. More...
 
void visitSwitchCase (SwitchCG::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 (SwitchCG::BitTestBlock &B, MachineBasicBlock *SwitchBB)
 visitBitTestHeader - This function emits necessary code to produce value suitable for "bit tests" More...
 
void visitBitTestCase (SwitchCG::BitTestBlock &BB, MachineBasicBlock *NextMBB, BranchProbability BranchProbToNext, unsigned Reg, SwitchCG::BitTestCase &B, MachineBasicBlock *SwitchBB)
 visitBitTestCase - this function produces one "bit test" More...
 
void visitJumpTable (SwitchCG::JumpTable &JT)
 visitJumpTable - Emit JumpTable node in the current MBB More...
 
void visitJumpTableHeader (SwitchCG::JumpTable &JT, SwitchCG::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
 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
 
AAResultsAA = nullptr
 
const TargetLibraryInfoLibInfo
 
std::unique_ptr< SDAGSwitchLoweringSL
 
StackProtectorDescriptor SPDescriptor
 A StackProtectorDescriptor structure used to communicate stack protector information in between SelectBasicBlock and FinishBasicBlock. More...
 
DenseMap< const Constant *, unsigned > ConstantsOut
 
FunctionLoweringInfoFuncInfo
 Information about the function as a whole. More...
 
SwiftErrorValueTrackingSwiftError
 Information about the swifterror values used throughout the function. More...
 
GCFunctionInfoGFI
 Garbage collection metadata for the function. More...
 
DenseMap< MachineBasicBlock *, SmallVector< unsigned, 4 > > LPadToCallSiteMap
 Map a landing pad to the call site indexes. More...
 
bool HasTailCall = false
 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 94 of file SelectionDAGBuilder.h.

Constructor & Destructor Documentation

◆ SelectionDAGBuilder()

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

Definition at line 242 of file SelectionDAGBuilder.h.

References TM.

Member Function Documentation

◆ addDanglingDebugInfo()

void SelectionDAGBuilder::addDanglingDebugInfo ( const DbgValueInst DI,
DebugLoc  DL,
unsigned  Order 
)

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

References llvm::StatepointLoweringState::clear(), HasTailCall, LowestSDNodeOrder, PendingLoads, and StatepointLowering.

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

Referenced by resolveOrClearDbgInfo().

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

References assert(), CopyValueToVirtualRegister(), FuncInfo, llvm::Value::getType(), llvm::Type::isEmptyTy(), llvm::Value::use_empty(), and llvm::FunctionLoweringInfo::ValueMap.

Referenced by visit().

◆ 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 will drop that debug info as it isn't valid any longer.

Definition at line 1186 of file SelectionDAGBuilder.cpp.

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

◆ EmitBranchForMergedCondition()

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

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

References CopyValueToVirtualRegister(), FuncInfo, llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::FunctionLoweringInfo::isExportedInst(), and Reg.

Referenced by LowerAsSTATEPOINT().

◆ FindMergedConditions()

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

◆ getControlRoot()

SDValue SelectionDAGBuilder::getControlRoot ( )

Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports (and PendingConstrainedFPStrict) items.

It is necessary to do this before emitting a terminator instruction.

Definition at line 1113 of file SelectionDAGBuilder.cpp.

Referenced by LowerAsSTATEPOINT(), lowerInvokable(), visitBitTestCase(), visitBitTestHeader(), visitJumpTable(), visitJumpTableHeader(), and visitSwitchCase().

◆ getCopyFromRegs()

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

If there was virtual register allocated for the value V emit CopyFromReg of the specified type Ty.

getCopyFromRegs - If there was virtual register allocated for the value V emit CopyFromReg of the specified type Ty.

Return empty SDValue() otherwise.

Definition at line 1471 of file SelectionDAGBuilder.cpp.

References DAG, FuncInfo, llvm::SelectionDAG::getContext(), llvm::RegsForValue::getCopyFromRegs(), getCurSDLoc(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getEntryNode(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::None, resolveDanglingDebugInfo(), and llvm::FunctionLoweringInfo::ValueMap.

Referenced by getValue().

◆ getCurDebugLoc()

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

Definition at line 284 of file SelectionDAGBuilder.h.

References llvm::Instruction::getDebugLoc().

◆ getCurSDLoc()

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

◆ getFrameIndexTy()

MVT llvm::SelectionDAGBuilder::getFrameIndexTy ( )
inline

Returns the type of FrameIndex and TargetFrameIndex nodes.

Definition at line 443 of file SelectionDAGBuilder.h.

References DAG, llvm::SelectionDAG::getDataLayout(), llvm::TargetLoweringBase::getFrameIndexTy(), and llvm::SelectionDAG::getTargetLoweringInfo().

◆ getMemoryRoot()

SDValue SelectionDAGBuilder::getMemoryRoot ( )

Return the current virtual root of the Selection DAG, flushing any PendingLoad items.

This must be done before emitting a store or any other memory node that may need to be ordered after any prior load instructions.

Definition at line 1093 of file SelectionDAGBuilder.cpp.

References PendingLoads.

Referenced by getRoot().

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

References getValueImpl(), N, and resolveDanglingDebugInfo().

Referenced by CopyValueToVirtualRegister().

◆ getRoot()

SDValue SelectionDAGBuilder::getRoot ( )

Similar to getMemoryRoot, but also flushes PendingConstrainedFP(Strict) items.

This must be done before emitting any call other any other node that may need to be ordered after FP instructions due to other side effects.

Definition at line 1097 of file SelectionDAGBuilder.cpp.

References getMemoryRoot(), and PendingLoads.

Referenced by LowerAsSTATEPOINT(), and lowerInvokable().

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

References assert(), llvm::SmallVectorImpl< T >::assign(), llvm::ComputeValueVTs(), DAG, llvm::numbers::e, FuncInfo, llvm::SelectionDAG::getBlockAddress(), llvm::SelectionDAG::getBuildVector(), llvm::SelectionDAG::getConstant(), llvm::SelectionDAG::getConstantFP(), llvm::SelectionDAG::getContext(), llvm::RegsForValue::getCopyFromRegs(), getCurSDLoc(), llvm::SelectionDAG::getDataLayout(), llvm::VectorType::getElementType(), llvm::SelectionDAG::getEntryNode(), llvm::SelectionDAG::getFrameIndex(), llvm::TargetLoweringBase::getFrameIndexTy(), llvm::SelectionDAG::getGlobalAddress(), llvm::SelectionDAG::getMDNode(), llvm::SelectionDAG::getMergeValues(), llvm::SDValue::getNode(), llvm::SDNode::getNumValues(), llvm::Type::getPointerAddressSpace(), llvm::TargetLoweringBase::getPointerTy(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getSplatVector(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::Value::getType(), llvm::SelectionDAG::getUNDEF(), getValue(), llvm::TargetLoweringBase::getValueType(), llvm::SelectionDAG::getVScale(), i, llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::Type::isAggregateType(), llvm::EVT::isFloatingPoint(), llvm_unreachable, llvm::PatternMatch::m_VScale(), llvm::PatternMatch::match(), llvm::None, SI, llvm::FunctionLoweringInfo::StaticAllocaMap, and visit().

Referenced by getNonRegisterValue(), and getValue().

◆ handleDebugValue()

bool SelectionDAGBuilder::handleDebugValue ( ArrayRef< const Value * >  Values,
DILocalVariable Var,
DIExpression Expr,
DebugLoc  CurDL,
DebugLoc  InstDL,
unsigned  Order,
bool  IsVariadic 
)

◆ init()

void SelectionDAGBuilder::init ( GCFunctionInfo gfi,
AAResults 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 725 of file StatepointLowering.cpp.

References llvm::append_range(), assert(), llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::count(), llvm::FunctionLoweringInfo::CreateRegs(), DAG, llvm::dbgs(), llvm::SelectionDAG::DeleteNode(), ExportFromCurrentBlock(), FuncInfo, llvm::ISD::GC_TRANSITION_END, llvm::ISD::GC_TRANSITION_START, llvm::GCTransition, llvm::SelectionDAG::getContext(), getControlRoot(), llvm::RegsForValue::getCopyToRegs(), getCurSDLoc(), llvm::SelectionDAG::getDataLayout(), llvm::GCRelocateInst::getDerivedPtr(), llvm::SDNode::getGluedNode(), llvm::StatepointLoweringState::getLocation(), llvm::SelectionDAG::getMachineNode(), llvm::SDValue::getNode(), llvm::SelectionDAG::getNode(), llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOperand(), llvm::Instruction::getParent(), getRoot(), llvm::SelectionDAG::getRoot(), llvm::SelectionDAG::getSrcValue(), llvm::SelectionDAG::getTargetConstant(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::Value::getType(), llvm::SDValue::getValue(), getValue(), llvm::SelectionDAG::getVTList(), llvm::MVT::Glue, llvm::MVT::i32, llvm::MVT::i64, llvm::SmallVectorImpl< T >::insert(), llvm::Type::isPointerTy(), LLVM_DEBUG, lowerCallFromStatepointLoweringInfo(), lowerStatepointMetaArgs(), llvm::MaskAll, llvm::None, llvm::FunctionLoweringInfo::StatepointRelocationRecord::NoRelocate, llvm::SDNode::op_begin(), llvm::SDNode::op_end(), llvm::MVT::Other, pushStackMapConstant(), Reg, llvm::SelectionDAG::ReplaceAllUsesWith(), llvm::StatepointLoweringState::scheduleRelocCall(), llvm::SelectionDAG::setNodeMemRefs(), SI, llvm::DenseMapBase< DenseMap< KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >, KeyT, ValueT, DenseMapInfo< KeyT >, llvm::detail::DenseMapPair< KeyT, ValueT > >::size(), llvm::FunctionLoweringInfo::StatepointRelocationRecord::Spill, llvm::StatepointLoweringState::startNewStatepoint(), StatepointLowering, llvm::FunctionLoweringInfo::StatepointRelocationMaps, and llvm::FunctionLoweringInfo::StatepointRelocationRecord::VReg.

Referenced by LowerCallSiteWithDeoptBundleImpl(), and LowerStatepoint().

◆ LowerCallSiteWithDeoptBundle()

void SelectionDAGBuilder::LowerCallSiteWithDeoptBundle ( const CallBase Call,
SDValue  Callee,
const BasicBlock EHPadBB 
)

◆ LowerCallSiteWithDeoptBundleImpl()

void SelectionDAGBuilder::LowerCallSiteWithDeoptBundleImpl ( const CallBase Call,
SDValue  Callee,
const BasicBlock EHPadBB,
bool  VarArgDisallowed,
bool  ForceVoidReturnTy 
)

◆ LowerCallTo()

void SelectionDAGBuilder::LowerCallTo ( const CallBase CB,
SDValue  Callee,
bool  IsTailCall,
bool  IsMustTailCall,
const BasicBlock EHPadBB = nullptr 
)

◆ 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 ( const GCStatepointInst I,
const BasicBlock EHPadBB = nullptr 
)

◆ populateCallLoweringInfo()

void SelectionDAGBuilder::populateCallLoweringInfo ( TargetLowering::CallLoweringInfo CLI,
const CallBase Call,
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 9167 of file SelectionDAGBuilder.cpp.

References llvm::AMDGPU::HSAMD::Kernel::Key::Args, assert(), llvm::Value::getType(), and llvm::Type::isEmptyTy().

Referenced by LowerCallSiteWithDeoptBundleImpl(), and LowerStatepoint().

◆ resolveDanglingDebugInfo()

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

◆ resolveOrClearDbgInfo()

void SelectionDAGBuilder::resolveOrClearDbgInfo ( )

Evict any dangling debug information, attempting to salvage it first.

Definition at line 1461 of file SelectionDAGBuilder.cpp.

References clearDanglingDebugInfo(), and salvageUnresolvedDbgValue().

◆ salvageUnresolvedDbgValue()

void SelectionDAGBuilder::salvageUnresolvedDbgValue ( DanglingDebugInfo &  DDI)

For the given dangling debuginfo record, perform last-ditch efforts to resolve the debuginfo to something that is represented in this DAG.

If this cannot be done, produce an Undef debug value record.

Definition at line 1268 of file SelectionDAGBuilder.cpp.

References llvm::SelectionDAG::AddDbgValue(), llvm::DIExpression::appendOpsToArg(), assert(), DAG, llvm::dbgs(), DL, llvm::UndefValue::get(), llvm::SelectionDAG::getConstantDbgValue(), llvm::DIExpression::getNumLocationOperands(), handleDebugValue(), LLVM_DEBUG, llvm::salvageDebugInfoImpl(), and llvm::RegState::Undef.

Referenced by dropDanglingDebugInfo(), and resolveOrClearDbgInfo().

◆ setUnusedArgValue()

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

Definition at line 337 of file SelectionDAGBuilder.h.

References assert(), and N.

◆ setValue()

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

Definition at line 331 of file SelectionDAGBuilder.h.

References assert(), and N.

Referenced by LowerCallSiteWithDeoptBundleImpl(), and LowerStatepoint().

◆ ShouldEmitAsBranches()

bool SelectionDAGBuilder::ShouldEmitAsBranches ( const std::vector< SwitchCG::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 2329 of file SelectionDAGBuilder.cpp.

References llvm::ISD::SETEQ, and llvm::ISD::SETNE.

◆ UpdateSplitBlock()

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

When an MBB was split during scheduling, update the references that need to refer to the last resulting block.

Definition at line 3058 of file SelectionDAGBuilder.cpp.

References llvm::numbers::e, First, i, and SL.

◆ visit() [1/2]

void SelectionDAGBuilder::visit ( const Instruction I)

Definition at line 1122 of file SelectionDAGBuilder.cpp.

References CopyToExportRegsIfNeeded(), HasTailCall, and I.

Referenced by getValueImpl().

◆ visit() [2/2]

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

Definition at line 1147 of file SelectionDAGBuilder.cpp.

References llvm_unreachable.

◆ visitBitTestCase()

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

◆ visitBitTestHeader()

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

◆ visitJumpTable()

void SelectionDAGBuilder::visitJumpTable ( SwitchCG::JumpTable JT)

◆ visitJumpTableHeader()

void SelectionDAGBuilder::visitJumpTableHeader ( SwitchCG::JumpTable JT,
SwitchCG::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 2739 of file SelectionDAGBuilder.cpp.

References DAG, getCurSDLoc(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::TargetMachine::getTargetTriple(), llvm::Triple::isPS4CPU(), llvm::MVT::isVoid, llvm::Triple::isWasm(), llvm::TargetLowering::makeLibCall(), llvm::None, llvm::MVT::Other, llvm::TargetLowering::MakeLibCallOptions::setDiscardResult(), llvm::SelectionDAG::setRoot(), and llvm::ISD::TRAP.

◆ visitSPDescriptorParent()

void SelectionDAGBuilder::visitSPDescriptorParent ( StackProtectorDescriptor SPD,
MachineBasicBlock ParentBB 
)

◆ visitSwitchCase()

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

Member Data Documentation

◆ AA

AAResults* llvm::SelectionDAGBuilder::AA = nullptr

Definition at line 194 of file SelectionDAGBuilder.h.

Referenced by init().

◆ ConstantsOut

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

Definition at line 222 of file SelectionDAGBuilder.h.

◆ Context

LLVMContext* llvm::SelectionDAGBuilder::Context

Definition at line 240 of file SelectionDAGBuilder.h.

Referenced by init().

◆ DAG

SelectionDAG& llvm::SelectionDAGBuilder::DAG

◆ DL

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

◆ FuncInfo

FunctionLoweringInfo& llvm::SelectionDAGBuilder::FuncInfo

◆ GFI

GCFunctionInfo* llvm::SelectionDAGBuilder::GFI

Garbage collection metadata for the function.

Definition at line 231 of file SelectionDAGBuilder.h.

Referenced by init(), and LowerStatepoint().

◆ HasTailCall

bool llvm::SelectionDAGBuilder::HasTailCall = false

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

Referenced by clear(), lowerInvokable(), and visit().

◆ LibInfo

const TargetLibraryInfo* llvm::SelectionDAGBuilder::LibInfo

Definition at line 195 of file SelectionDAGBuilder.h.

Referenced by init().

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

Referenced by clear().

◆ LPadToCallSiteMap

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

Map a landing pad to the call site indexes.

Definition at line 234 of file SelectionDAGBuilder.h.

Referenced by init().

◆ PendingLoads

SmallVector<SDValue, 8> llvm::SelectionDAGBuilder::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 clear(), getMemoryRoot(), and getRoot().

◆ SL

std::unique_ptr<SDAGSwitchLowering> llvm::SelectionDAGBuilder::SL

◆ SPDescriptor

StackProtectorDescriptor llvm::SelectionDAGBuilder::SPDescriptor

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

Definition at line 218 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 clear(), and LowerAsSTATEPOINT().

◆ SwiftError

SwiftErrorValueTracking& llvm::SelectionDAGBuilder::SwiftError

Information about the swifterror values used throughout the function.

Definition at line 228 of file SelectionDAGBuilder.h.


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