Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.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 aTargetLowering object.More...

#include "CodeGen/SelectionDAG/SelectionDAGBuilder.h"

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,CodeGenOptLevel ol)
 
void init (GCFunctionInfo *gfi,BatchAAResults *BatchAA,AssumptionCache *AC,constTargetLibraryInfo *li)
 
void clear ()
 Clear out the currentSelectionDAG and the associated state and prepare thisSelectionDAGBuilder object to be used for a new block.
 
void clearDanglingDebugInfo ()
 Clear the dangling debug information map.
 
SDValue getMemoryRoot ()
 Return the current virtual root of the Selection DAG, flushing any PendingLoad items.
 
SDValue getRoot ()
 Similar to getMemoryRoot, but also flushes PendingConstrainedFP(Strict) items.
 
SDValue getControlRoot ()
 Similar to getRoot, but instead of flushing all the PendingLoad items, flush all the PendingExports (and PendingConstrainedFPStrict) items.
 
SDLoc getCurSDLoc ()const
 
DebugLoc getCurDebugLoc ()const
 
void CopyValueToVirtualRegister (constValue *V,unsignedReg,ISD::NodeType ExtendType=ISD::ANY_EXTEND)
 
void visit (constInstruction &I)
 
void visitDbgInfo (constInstruction &I)
 
void visit (unsigned Opcode,constUser &I)
 
SDValue getCopyFromRegs (constValue *V,Type *Ty)
 If there was virtual register allocated for the value V emit CopyFromReg of the specified type Ty.
 
void addDanglingDebugInfo (SmallVectorImpl<Value * > &Values,DILocalVariable *Var,DIExpression *Expr,bool IsVariadic,DebugLocDL,unsigned Order)
 Register a dbg_value which relies on aValue which we have not yet seen.
 
void dropDanglingDebugInfo (constDILocalVariable *Variable,constDIExpression *Expr)
 If we have dangling debug info that describesVariable, or an overlapping part of variable considering theExpr, then this method will drop that debug info as it isn't valid any longer.
 
void resolveDanglingDebugInfo (constValue *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.
 
void salvageUnresolvedDbgValue (constValue *V, DanglingDebugInfo &DDI)
 For the given dangling debuginfo record, perform last-ditch efforts to resolve the debuginfo to something that is represented in this DAG.
 
bool handleDebugValue (ArrayRef<constValue * > Values,DILocalVariable *Var,DIExpression *Expr,DebugLoc DbgLoc,unsigned Order,bool IsVariadic)
 For a given list of Values, attempt to create and record aSDDbgValue in theSelectionDAG.
 
void handleKillDebugValue (DILocalVariable *Var,DIExpression *Expr,DebugLoc DbgLoc,unsigned Order)
 Create a record for a kill location debug intrinsic.
 
void handleDebugDeclare (Value *Address,DILocalVariable *Variable,DIExpression *Expression,DebugLocDL)
 
void resolveOrClearDbgInfo ()
 Evict any dangling debug information, attempting to salvage it first.
 
SDValue getValue (constValue *V)
 getValue - Return anSDValue for the givenValue.
 
SDValue getNonRegisterValue (constValue *V)
 getNonRegisterValue - Return anSDValue for the givenValue, but don't look in FuncInfo.ValueMap for a virtual register.
 
SDValue getValueImpl (constValue *V)
 getValueImpl - Helper function for getValue and getNonRegisterValue.
 
void setValue (constValue *V,SDValue NewN)
 
void setUnusedArgValue (constValue *V,SDValue NewN)
 
bool shouldKeepJumpConditionsTogether (constFunctionLoweringInfo &FuncInfo,constBranchInst &I,Instruction::BinaryOps Opc,constValue *Lhs,constValue *Rhs,TargetLoweringBase::CondMergingParams Params)const
 
void FindMergedConditions (constValue *Cond,MachineBasicBlock *TBB,MachineBasicBlock *FBB,MachineBasicBlock *CurBB,MachineBasicBlock *SwitchBB,Instruction::BinaryOps Opc,BranchProbability TProb,BranchProbability FProb,bool InvertCond)
 
void EmitBranchForMergedCondition (constValue *Cond,MachineBasicBlock *TBB,MachineBasicBlock *FBB,MachineBasicBlock *CurBB,MachineBasicBlock *SwitchBB,BranchProbability TProb,BranchProbability FProb,bool InvertCond)
 EmitBranchForMergedCondition - Helper method for FindMergedConditions.
 
bool ShouldEmitAsBranches (const std::vector<SwitchCG::CaseBlock > &Cases)
 If the set of cases should be emitted as a series of branches, return true.
 
bool isExportableFromCurrentBlock (constValue *V,constBasicBlock *FromBB)
 
void CopyToExportRegsIfNeeded (constValue *V)
 CopyToExportRegsIfNeeded - If the given value has virtual registers created for it, emit nodes to copy the value into the virtual registers.
 
void ExportFromCurrentBlock (constValue *V)
 ExportFromCurrentBlock - If this condition isn't known to be exported from the current basic block, add it toValueMap now so that we'll get a CopyTo/FromReg.
 
void LowerCallTo (constCallBase &CB,SDValue Callee,bool IsTailCall,bool IsMustTailCall,constBasicBlock *EHPadBB=nullptr,constTargetLowering::PtrAuthInfo *PAI=nullptr)
 
SDValue lowerRangeToAssertZExt (SelectionDAG &DAG,constInstruction &I,SDValueOp)
 
void populateCallLoweringInfo (TargetLowering::CallLoweringInfo &CLI,constCallBase *Call,unsigned ArgIdx,unsigned NumArgs,SDValue Callee,Type *ReturnTy,AttributeSet RetAttrs,bool IsPatchPoint)
 Populate a CallLowerinInfo (intoCLI) based on the properties of the call being lowered.
 
std::pair<SDValue,SDValuelowerInvokable (TargetLowering::CallLoweringInfo &CLI,constBasicBlock *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.
 
SDValue LowerAsSTATEPOINT (StatepointLoweringInfo &SI)
 LowerSLI into a STATEPOINT instruction.
 
void LowerStatepoint (constGCStatepointInst &I,constBasicBlock *EHPadBB=nullptr)
 
void LowerCallSiteWithDeoptBundle (constCallBase *Call,SDValue Callee,constBasicBlock *EHPadBB)
 
void LowerDeoptimizeCall (constCallInst *CI)
 
void LowerDeoptimizingReturn ()
 
void LowerCallSiteWithDeoptBundleImpl (constCallBase *Call,SDValue Callee,constBasicBlock *EHPadBB,bool VarArgDisallowed,bool ForceVoidReturnTy)
 
void LowerCallSiteWithPtrAuthBundle (constCallBase &CB,constBasicBlock *EHPadBB)
 
MVT getFrameIndexTy ()
 Returns the type of FrameIndex and TargetFrameIndex nodes.
 
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.
 
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.
 
void visitSPDescriptorFailure (StackProtectorDescriptor &SPD)
 Codegen the failure basic block for a stack protector check.
 
void visitBitTestHeader (SwitchCG::BitTestBlock &B,MachineBasicBlock *SwitchBB)
 visitBitTestHeader - This function emits necessary code to produce value suitable for "bit tests"
 
void visitBitTestCase (SwitchCG::BitTestBlock &BB,MachineBasicBlock *NextMBB,BranchProbability BranchProbToNext,RegisterReg,SwitchCG::BitTestCase &B,MachineBasicBlock *SwitchBB)
 visitBitTestCase - this function produces one "bit test"
 
void visitJumpTable (SwitchCG::JumpTable &JT)
 visitJumpTable - EmitJumpTable node in the current MBB
 
void visitJumpTableHeader (SwitchCG::JumpTable &JT,SwitchCG::JumpTableHeader &JTH,MachineBasicBlock *SwitchBB)
 visitJumpTableHeader - This function emits necessary code to produce index in theJumpTable from switch case.
 

Public Attributes

SmallVector<SDValue, 8 > PendingLoads
 Loads are not emitted to the program immediately.
 
StatepointLoweringState StatepointLowering
 State used while lowering a statepoint sequence (gc_statepoint, gc_relocate, and gc_result).
 
SelectionDAGDAG
 
BatchAAResultsBatchAA = nullptr
 
AssumptionCacheAC = nullptr
 
constTargetLibraryInfoLibInfo = nullptr
 
std::unique_ptr<SDAGSwitchLoweringSL
 
StackProtectorDescriptor SPDescriptor
 AStackProtectorDescriptor structure used to communicate stack protector information in between SelectBasicBlock and FinishBasicBlock.
 
DenseMap<constConstant *,unsignedConstantsOut
 
FunctionLoweringInfoFuncInfo
 Information about the function as a whole.
 
SwiftErrorValueTrackingSwiftError
 Information about the swifterror values used throughout the function.
 
GCFunctionInfoGFI = nullptr
 Garbage collection metadata for the function.
 
DenseMap<MachineBasicBlock *,SmallVector<unsigned, 4 > > LPadToCallSiteMap
 Map a landing pad to the call site indexes.
 
bool HasTailCall = false
 This is set to true if a call in the current block has been translated as a tail call.
 
LLVMContextContext = nullptr
 

Static Public Attributes

staticconstunsigned LowestSDNodeOrder = 1
 Lowest valid SDNodeOrder.
 

Detailed Description

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

Definition at line97 of fileSelectionDAGBuilder.h.

Constructor & Destructor Documentation

◆ SelectionDAGBuilder()

llvm::SelectionDAGBuilder::SelectionDAGBuilder(SelectionDAGdag,
FunctionLoweringInfofuncinfo,
SwiftErrorValueTrackingswifterror,
CodeGenOptLevel ol 
)
inline

Definition at line277 of fileSelectionDAGBuilder.h.

Member Function Documentation

◆ addDanglingDebugInfo()

void SelectionDAGBuilder::addDanglingDebugInfo(SmallVectorImpl<Value * > & Values,
DILocalVariableVar,
DIExpressionExpr,
bool IsVariadic,
DebugLoc DL,
unsigned Order 
)

Register a dbg_value which relies on aValue which we have not yet seen.

Definition at line1403 of fileSelectionDAGBuilder.cpp.

Referencesassert(),DAG,DL,handleDanglingVariadicDebugInfo(), andllvm::SmallVectorBase< Size_T >::size().

Referenced byvisitDbgInfo().

◆ clear()

void SelectionDAGBuilder::clear()

Clear out the currentSelectionDAG and the associated state and prepare thisSelectionDAGBuilder 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 line1099 of fileSelectionDAGBuilder.cpp.

Referencesllvm::StatepointLoweringState::clear(),HasTailCall,LowestSDNodeOrder,PendingLoads, andStatepointLowering.

◆ 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 theSelectionDAG to resolve dangling debug information attached to PHI nodes.

Definition at line1112 of fileSelectionDAGBuilder.cpp.

Referenced byresolveOrClearDbgInfo().

◆ CopyToExportRegsIfNeeded()

void SelectionDAGBuilder::CopyToExportRegsIfNeeded(constValueV)

CopyToExportRegsIfNeeded - If the given value has virtual registers created for it, emit nodes to copy the value into the virtual registers.

Definition at line2341 of fileSelectionDAGBuilder.cpp.

Referencesassert(),CopyValueToVirtualRegister(),FuncInfo, andllvm::FunctionLoweringInfo::ValueMap.

Referenced byvisit().

◆ CopyValueToVirtualRegister()

void SelectionDAGBuilder::CopyValueToVirtualRegister(constValueV,
unsigned Reg,
ISD::NodeType ExtendType =ISD::ANY_EXTEND 
)

Definition at line11376 of fileSelectionDAGBuilder.cpp.

Referencesllvm::ISD::ANY_EXTEND,assert(),llvm::ISD::CopyFromReg,DAG,FuncInfo,llvm::RegsForValue::getCopyToRegs(),getCurSDLoc(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getEntryNode(),getNonRegisterValue(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::Register::isPhysicalRegister(), andllvm::FunctionLoweringInfo::PreferredExtendType.

Referenced byCopyToExportRegsIfNeeded(), andExportFromCurrentBlock().

◆ dropDanglingDebugInfo()

void SelectionDAGBuilder::dropDanglingDebugInfo(constDILocalVariableVariable,
constDIExpressionExpr 
)

If we have dangling debug info that describesVariable, or an overlapping part of variable considering theExpr, then this method will drop that debug info as it isn't valid any longer.

Definition at line1420 of fileSelectionDAGBuilder.cpp.

Referencesllvm::dbgs(),llvm::erase_if(),llvm::DIExpression::fragmentsOverlap(),LLVM_DEBUG, andsalvageUnresolvedDbgValue().

Referenced byvisitDbgInfo().

◆ EmitBranchForMergedCondition()

void SelectionDAGBuilder::EmitBranchForMergedCondition(constValueCond,
MachineBasicBlockTBB,
MachineBasicBlockFBB,
MachineBasicBlockCurBB,
MachineBasicBlockSwitchBB,
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 line2433 of fileSelectionDAGBuilder.cpp.

ReferencesCond,DAG,llvm::MachineBasicBlock::getBasicBlock(),llvm::SelectionDAG::getContext(),getCurSDLoc(),llvm::getFCmpCodeWithoutNaN(),llvm::getFCmpCondCode(),llvm::getICmpCondCode(),llvm::ConstantInt::getTrue(),isExportableFromCurrentBlock(),llvm::TargetOptions::NoNaNsFPMath,llvm::TargetMachine::Options,llvm::ISD::SETEQ,llvm::ISD::SETNE,SL, andTBB.

Referenced byFindMergedConditions().

◆ ExportFromCurrentBlock()

void SelectionDAGBuilder::ExportFromCurrentBlock(constValueV)

ExportFromCurrentBlock - If this condition isn't known to be exported from the current basic block, add it toValueMap now so that we'll get a CopyTo/FromReg.

Definition at line2357 of fileSelectionDAGBuilder.cpp.

ReferencesCopyValueToVirtualRegister(),FuncInfo,llvm::FunctionLoweringInfo::InitializeRegForValue(), andllvm::FunctionLoweringInfo::isExportedInst().

Referenced byLowerAsSTATEPOINT().

◆ FindMergedConditions()

void SelectionDAGBuilder::FindMergedConditions(constValueCond,
MachineBasicBlockTBB,
MachineBasicBlockFBB,
MachineBasicBlockCurBB,
MachineBasicBlockSwitchBB,
Instruction::BinaryOps Opc,
BranchProbability TProb,
BranchProbability FProb,
bool InvertCond 
)

Definition at line2626 of fileSelectionDAGBuilder.cpp.

Referencesassert(),Cond,llvm::MachineFunction::CreateMachineBasicBlock(),DAG,EmitBranchForMergedCondition(),FindMergedConditions(),llvm::MachineBasicBlock::getBasicBlock(),llvm::SelectionDAG::getMachineFunction(),llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(),llvm::MachineBasicBlock::getParent(),llvm::Value::hasOneUse(),InBlock(),llvm::MachineFunction::insert(),llvm::PatternMatch::m_LogicalAnd(),llvm::PatternMatch::m_LogicalOr(),llvm::PatternMatch::m_Not(),llvm::PatternMatch::m_OneUse(),llvm::PatternMatch::m_Value(),llvm::PatternMatch::match(),llvm::BranchProbability::normalizeProbabilities(), andTBB.

Referenced byFindMergedConditions().

◆ 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 line1167 of fileSelectionDAGBuilder.cpp.

Referenced byLowerAsSTATEPOINT(),lowerInvokable(),visitBitTestCase(),visitBitTestHeader(),visitJumpTable(),visitJumpTableHeader(), andvisitSwitchCase().

◆ getCopyFromRegs()

SDValue SelectionDAGBuilder::getCopyFromRegs(constValueV,
TypeTy 
)

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 line1726 of fileSelectionDAGBuilder.cpp.

ReferencesDAG,FuncInfo,llvm::SelectionDAG::getContext(),llvm::RegsForValue::getCopyFromRegs(),getCurSDLoc(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getEntryNode(),llvm::SelectionDAG::getTargetLoweringInfo(),resolveDanglingDebugInfo(), andllvm::FunctionLoweringInfo::ValueMap.

Referenced bygetValue().

◆ getCurDebugLoc()

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

Definition at line319 of fileSelectionDAGBuilder.h.

Referencesllvm::Instruction::getDebugLoc().

◆ getCurSDLoc()

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

Definition at line315 of fileSelectionDAGBuilder.h.

Referenced byCopyValueToVirtualRegister(),EmitBranchForMergedCondition(),getCopyFromRegs(),getMemCmpLoad(),getUniformBase(),getValueImpl(),LowerAsSTATEPOINT(),LowerCallTo(),LowerDeoptimizingReturn(),lowerRangeToAssertZExt(),LowerStatepoint(),lowerStatepointMetaArgs(),populateCallLoweringInfo(),pushStackMapConstant(),spillIncomingStatepointValue(),visitBitTestCase(),visitBitTestHeader(),visitSPDescriptorFailure(),visitSPDescriptorParent(), andvisitSwitchCase().

◆ getFrameIndexTy()

MVT llvm::SelectionDAGBuilder::getFrameIndexTy()
inline

Returns the type of FrameIndex and TargetFrameIndex nodes.

Definition at line498 of fileSelectionDAGBuilder.h.

ReferencesDAG,llvm::SelectionDAG::getDataLayout(),llvm::TargetLoweringBase::getFrameIndexTy(), andllvm::SelectionDAG::getTargetLoweringInfo().

Referenced bylowerIncomingStatepointValue(),lowerStatepointMetaArgs(),reservePreviousStackSlotForValue(), andspillIncomingStatepointValue().

◆ 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 line1147 of fileSelectionDAGBuilder.cpp.

ReferencesPendingLoads.

Referenced bygetRoot().

◆ getNonRegisterValue()

SDValue SelectionDAGBuilder::getNonRegisterValue(constValueV)

getNonRegisterValue - Return anSDValue for the givenValue, but don't look in FuncInfo.ValueMap for a virtual register.

Definition at line1767 of fileSelectionDAGBuilder.cpp.

ReferencesgetValueImpl(),llvm::isIntOrFPConstant(),N, andresolveDanglingDebugInfo().

Referenced byCopyValueToVirtualRegister().

◆ 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 line1151 of fileSelectionDAGBuilder.cpp.

ReferencesgetMemoryRoot(), andPendingLoads.

Referenced byLowerAsSTATEPOINT(),LowerCallTo(),lowerIncomingStatepointValue(),lowerInvokable(), andpopulateCallLoweringInfo().

◆ getValue()

SDValue SelectionDAGBuilder::getValue(constValueV)

getValue - Return anSDValue for the givenValue.

Definition at line1746 of fileSelectionDAGBuilder.cpp.

ReferencesgetCopyFromRegs(),getValueImpl(),N, andresolveDanglingDebugInfo().

Referenced byaddStackMapLiveVars(),getMemCmpLoad(),getUniformBase(),getValueImpl(),LowerAsSTATEPOINT(),LowerCallSiteWithPtrAuthBundle(),LowerCallTo(),LowerStatepoint(),lowerStatepointMetaArgs(),populateCallLoweringInfo(),reservePreviousStackSlotForValue(),visitBitTestHeader(),visitJumpTableHeader(),visitSPDescriptorParent(), andvisitSwitchCase().

◆ getValueImpl()

SDValue SelectionDAGBuilder::getValueImpl(constValueV)

getValueImpl - Helper function for getValue and getNonRegisterValue.

Create anSDValue for the given value.

Definition at line1790 of fileSelectionDAGBuilder.cpp.

Referencesassert(),llvm::ISD::BITCAST,llvm::CallingConv::C,llvm::ComputeValueVTs(),DAG,FuncInfo,llvm::SelectionDAG::getBasicBlock(),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::SelectionDAG::getGlobalAddress(),llvm::MVT::getIntegerVT(),llvm::details::FixedOrScalableQuantity< LeafTy, ValueTy >::getKnownMinValue(),llvm::FunctionLoweringInfo::getMBB(),llvm::SelectionDAG::getMDNode(),llvm::SelectionDAG::getMergeValues(),llvm::SDValue::getNode(),llvm::SelectionDAG::getNode(),llvm::SDNode::getNumValues(),llvm::TargetLoweringBase::getPointerTy(),llvm::EVT::getSizeInBits(),llvm::SelectionDAG::getSplat(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::SelectionDAG::getUNDEF(),getValue(),llvm::TargetLoweringBase::getValueType(),llvm::EVT::getVectorVT(),llvm::SelectionDAG::getVScale(),llvm::FunctionLoweringInfo::InitializeRegForValue(),llvm::EVT::isFloatingPoint(),llvm::EVT::isRISCVVectorTuple(),llvm_unreachable,llvm::PatternMatch::m_VScale(),llvm::PatternMatch::match(),NC,llvm::ISD::PtrAuthGlobalAddress,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::SmallVectorBase< Size_T >::size(),llvm::ISD::SPLAT_VECTOR,llvm::FunctionLoweringInfo::StaticAllocaMap, andvisit().

Referenced bygetNonRegisterValue(), andgetValue().

◆ handleDebugDeclare()

void SelectionDAGBuilder::handleDebugDeclare(ValueAddress,
DILocalVariableVariable,
DIExpressionExpression,
DebugLoc DL 
)

Definition at line1176 of fileSelectionDAGBuilder.cpp.

Referencesllvm::SelectionDAG::AddDbgValue(),llvm::Address,assert(),DAG,llvm::dbgs(),DL,llvm::SelectionDAG::getDbgValue(),llvm::SelectionDAG::getFrameIndexDbgValue(),llvm::DILocalVariable::isParameter(),LLVM_DEBUG, andN.

Referenced byvisitDbgInfo().

◆ handleDebugValue()

bool SelectionDAGBuilder::handleDebugValue(ArrayRef<constValue * > Values,
DILocalVariableVar,
DIExpressionExpr,
DebugLoc DbgLoc,
unsigned Order,
bool IsVariadic 
)

For a given list of Values, attempt to create and record aSDDbgValue in theSelectionDAG.

Definition at line1579 of fileSelectionDAGBuilder.cpp.

Referencesllvm::SelectionDAG::AddDbgValue(),assert(),llvm::DIExpression::createFragmentExpression(),DAG,llvm::SmallVectorImpl< T >::emplace_back(),llvm::ArrayRef< T >::empty(),llvm::SmallVectorBase< Size_T >::empty(),llvm::SDDbgOperand::fromConst(),llvm::SDDbgOperand::fromFrameIdx(),llvm::SDDbgOperand::fromNode(),llvm::SDDbgOperand::fromVReg(),FuncInfo,llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getDbgValueList(),llvm::DIExpression::getFragmentInfo(),llvm::DebugLoc::getInlinedAt(),llvm::RegsForValue::getRegsAndSizes(),llvm::DIVariable::getSizeInBits(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::SelectionDAG::getVRegDbgValue(),llvm::DILocalVariable::isParameter(),N,llvm::RegsForValue::occupiesMultipleRegs(),llvm::Offset,llvm::SmallVectorTemplateBase< T, bool >::push_back(),llvm::FunctionLoweringInfo::StaticAllocaMap, andllvm::FunctionLoweringInfo::ValueMap.

Referenced byhandleKillDebugValue(),salvageUnresolvedDbgValue(), andvisitDbgInfo().

◆ handleKillDebugValue()

void SelectionDAGBuilder::handleKillDebugValue(DILocalVariableVar,
DIExpressionExpr,
DebugLoc DbgLoc,
unsigned Order 
)

Create a record for a kill location debug intrinsic.

Definition at line1568 of fileSelectionDAGBuilder.cpp.

ReferencesContext,llvm::DIExpression::convertToUndefExpression(),llvm::PoisonValue::get(),llvm::Type::getInt1Ty(),handleDebugValue(), andPoison.

Referenced byvisitDbgInfo().

◆ init()

void SelectionDAGBuilder::init(GCFunctionInfogfi,
BatchAAResultsBatchAA,
AssumptionCacheAC,
constTargetLibraryInfoli 
)

Definition at line1085 of fileSelectionDAGBuilder.cpp.

Referencesaa,AC,BatchAA,Context,DAG,llvm::SelectionDAG::getContext(),llvm::SelectionDAG::getDataLayout(),llvm::MachineFunction::getFunction(),llvm::SelectionDAG::getMachineFunction(),llvm::GlobalValue::getParent(),llvm::SelectionDAG::getTargetLoweringInfo(),GFI,llvm::isAssignmentTrackingEnabled(),LibInfo,LPadToCallSiteMap, andSL.

◆ isExportableFromCurrentBlock()

bool SelectionDAGBuilder::isExportableFromCurrentBlock(constValueV,
constBasicBlockFromBB 
)

Definition at line2368 of fileSelectionDAGBuilder.cpp.

ReferencesFuncInfo,llvm::BasicBlock::isEntryBlock(), andllvm::FunctionLoweringInfo::isExportedInst().

Referenced byEmitBranchForMergedCondition().

◆ LowerAsSTATEPOINT()

SDValue SelectionDAGBuilder::LowerAsSTATEPOINT(SelectionDAGBuilder::StatepointLoweringInfoSI)

LowerSLI into a STATEPOINT instruction.

Definition at line707 of fileStatepointLowering.cpp.

Referencesllvm::append_range(),assert(),llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(),llvm::FunctionLoweringInfo::CreateRegs(),DAG,llvm::dbgs(),llvm::SelectionDAG::DeleteNode(),llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(),llvm::SmallVectorTemplateCommon< T, typename >::end(),ExportFromCurrentBlock(),llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(),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::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(),getRoot(),llvm::SelectionDAG::getRoot(),llvm::SelectionDAG::getSrcValue(),llvm::SelectionDAG::getTargetConstant(),llvm::SelectionDAG::getTargetLoweringInfo(),getValue(),llvm::SDValue::getValue(),llvm::SelectionDAG::getVTList(),GFI,llvm::SmallVectorImpl< T >::insert(),LLVM_DEBUG,lowerCallFromStatepointLoweringInfo(),lowerStatepointMetaArgs(),llvm::MaskAll,llvm::FunctionLoweringInfo::StatepointRelocationRecord::NoRelocate,llvm::SDNode::op_begin(),llvm::SDNode::op_end(),llvm::SmallVectorTemplateBase< T, bool >::push_back(),pushStackMapConstant(),llvm::SelectionDAG::ReplaceAllUsesWith(),RetTy,llvm::StatepointLoweringState::scheduleRelocCall(),llvm::FunctionLoweringInfo::StatepointRelocationRecord::SDValueNode,llvm::StatepointLoweringState::setLocation(),llvm::SelectionDAG::setNodeMemRefs(),llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::size(),llvm::SmallVectorBase< Size_T >::size(),llvm::FunctionLoweringInfo::StatepointRelocationRecord::Spill,llvm::StatepointLoweringState::startNewStatepoint(),StatepointLowering,llvm::FunctionLoweringInfo::StatepointRelocationMaps, andllvm::FunctionLoweringInfo::StatepointRelocationRecord::VReg.

Referenced byLowerCallSiteWithDeoptBundleImpl(), andLowerStatepoint().

◆ LowerCallSiteWithDeoptBundle()

void SelectionDAGBuilder::LowerCallSiteWithDeoptBundle(constCallBaseCall,
SDValue Callee,
constBasicBlockEHPadBB 
)

Definition at line1174 of fileStatepointLowering.cpp.

ReferencesLowerCallSiteWithDeoptBundleImpl().

◆ LowerCallSiteWithDeoptBundleImpl()

void SelectionDAGBuilder::LowerCallSiteWithDeoptBundleImpl(constCallBaseCall,
SDValue Callee,
constBasicBlockEHPadBB,
bool VarArgDisallowed,
bool ForceVoidReturnTy 
)

Definition at line1140 of fileStatepointLowering.cpp.

ReferencesDAG,llvm::dbgs(),llvm::StatepointDirectives::DeoptBundleStatepointID,llvm::SelectionDAG::getContext(),llvm::Type::getVoidTy(),LLVM_DEBUG,LowerAsSTATEPOINT(),lowerRangeToAssertZExt(),llvm::None,llvm::LLVMContext::OB_deopt,llvm::parseStatepointDirectivesFromAttrs(),populateCallLoweringInfo(), andsetValue().

Referenced byLowerCallSiteWithDeoptBundle(), andLowerDeoptimizeCall().

◆ LowerCallSiteWithPtrAuthBundle()

void SelectionDAGBuilder::LowerCallSiteWithPtrAuthBundle(constCallBaseCB,
constBasicBlockEHPadBB 
)

Definition at line9604 of fileSelectionDAGBuilder.cpp.

Referencesassert(),DAG,llvm::CallBase::getCalledOperand(),llvm::SelectionDAG::getDataLayout(),llvm::CallBase::getOperandBundle(),getValue(),llvm::CallBase::isMustTailCall(),llvm::CallBase::isTailCall(), andLowerCallTo().

◆ LowerCallTo()

void SelectionDAGBuilder::LowerCallTo(constCallBaseCB,
SDValue Callee,
bool IsTailCall,
bool IsMustTailCall,
constBasicBlockEHPadBB =nullptr,
constTargetLowering::PtrAuthInfoPAI =nullptr 
)

Definition at line8859 of fileSelectionDAGBuilder.cpp.

Referencesllvm::CallBase::arg_begin(),llvm::CallBase::arg_end(),llvm::CallBase::arg_size(),assert(),llvm::CallBase::countOperandBundlesOfType(),llvm::TargetLowering::CallLoweringInfo::DAG,DAG,llvm::TargetLowering::CallLoweringInfo::DL,DL,FuncInfo,llvm::SelectionDAG::getCopyToReg(),getCurSDLoc(),llvm::SelectionDAG::getDataLayout(),llvm::CallBase::getFunctionType(),llvm::CallBase::getOperandBundle(),llvm::SwiftErrorValueTracking::getOrCreateVRegDefAt(),llvm::SwiftErrorValueTracking::getOrCreateVRegUseAt(),llvm::ilist_detail::node_parent_access< NodeTy, ParentTy >::getParent(),llvm::TargetLoweringBase::getPointerTy(),llvm::SelectionDAG::getRegister(),getRoot(),llvm::SelectionDAG::getTarget(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::Value::getType(),getValue(),I,llvm::TargetLowering::CallLoweringInfo::InVals,llvm::CallBase::isConvergent(),llvm::CallBase::isIndirectCall(),llvm::isInTailCallPosition(),llvm::Type::isIntegerTy(),lowerInvokable(),lowerRangeToAssertZExt(),llvm::FunctionLoweringInfo::MBB,llvm::LLVMContext::OB_cfguardtarget,llvm::LLVMContext::OB_convergencectrl,llvm::LLVMContext::OB_kcfi,llvm::LLVMContext::OB_preallocated,llvm::report_fatal_error(),RetTy,llvm::TargetLowering::CallLoweringInfo::setCallee(),llvm::TargetLowering::CallLoweringInfo::setCFIType(),llvm::TargetLowering::CallLoweringInfo::setChain(),llvm::TargetLowering::CallLoweringInfo::setConvergenceControlToken(),llvm::TargetLowering::CallLoweringInfo::setConvergent(),llvm::TargetLowering::CallLoweringInfo::setDebugLoc(),llvm::TargetLowering::CallLoweringInfo::setIsPreallocated(),llvm::TargetLowering::CallLoweringInfo::setPtrAuth(),llvm::SelectionDAG::setRoot(),llvm::TargetLowering::CallLoweringInfo::setTailCall(),setValue(),llvm::TargetLowering::supportKCFIBundles(),llvm::TargetLowering::supportPtrAuthBundles(),llvm::TargetLowering::supportSwiftError(), andSwiftError.

Referenced byLowerCallSiteWithPtrAuthBundle().

◆ LowerDeoptimizeCall()

void SelectionDAGBuilder::LowerDeoptimizeCall(constCallInstCI)

Definition at line1302 of fileStatepointLowering.cpp.

ReferencesDAG,llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getExternalSymbol(),llvm::SelectionDAG::getTargetLoweringInfo(), andLowerCallSiteWithDeoptBundleImpl().

◆ LowerDeoptimizingReturn()

void SelectionDAGBuilder::LowerDeoptimizingReturn()

Definition at line1315 of fileStatepointLowering.cpp.

ReferencesDAG,getCurSDLoc(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getRoot(),llvm::SelectionDAG::getTarget(),llvm::TargetMachine::Options,llvm::SelectionDAG::setRoot(),llvm::ISD::TRAP, andllvm::TargetOptions::TrapUnreachable.

◆ lowerInvokable()

std::pair<SDValue,SDValue > SelectionDAGBuilder::lowerInvokable(TargetLowering::CallLoweringInfoCLI,
constBasicBlockEHPadBB =nullptr 
)

Definition at line8818 of fileSelectionDAGBuilder.cpp.

Referencesassert(),llvm::TargetLowering::CallLoweringInfo::CB,DAG,getControlRoot(),getRoot(),llvm::SelectionDAG::getTargetLoweringInfo(),HasTailCall,llvm::TargetLowering::CallLoweringInfo::IsTailCall,llvm::TargetLowering::LowerCallTo(),llvm::TargetLowering::CallLoweringInfo::setChain(), andllvm::SelectionDAG::setRoot().

Referenced bylowerCallFromStatepointLoweringInfo(), andLowerCallTo().

◆ lowerRangeToAssertZExt()

SDValue SelectionDAGBuilder::lowerRangeToAssertZExt(SelectionDAGDAG,
constInstructionI,
SDValue Op 
)

Definition at line10541 of fileSelectionDAGBuilder.cpp.

Referencesllvm::ISD::AssertZext,DAG,llvm::SelectionDAG::getContext(),getCurSDLoc(),llvm::EVT::getIntegerVT(),llvm::SelectionDAG::getMergeValues(),llvm::SelectionDAG::getNode(),getRange(),llvm::SelectionDAG::getValueType(),llvm::Hi,I,llvm::Lo,llvm::IntegerType::MIN_INT_BITS,llvm::SmallVectorTemplateBase< T, bool >::push_back(), andSL.

Referenced byLowerCallSiteWithDeoptBundleImpl(), andLowerCallTo().

◆ LowerStatepoint()

void SelectionDAGBuilder::LowerStatepoint(constGCStatepointInstI,
constBasicBlockEHPadBB =nullptr 
)

Definition at line1014 of fileStatepointLowering.cpp.

Referencesllvm::CallingConv::AnyReg,assert(),llvm::GCStatepointInst::CallArgsBeginPos,llvm::FunctionLoweringInfo::CreateRegs(),DAG,FuncInfo,llvm::SelectionDAG::getContext(),llvm::RegsForValue::getCopyToRegs(),getCurSDLoc(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getEntryNode(),getGCResultLocality(),llvm::SelectionDAG::getIntPtrConstant(),llvm::GCFunctionInfo::getStrategy(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::SelectionDAG::getUNDEF(),getValue(),GFI,I,llvm::SmallSet< T, N, C >::insert(),isGCValue(),LowerAsSTATEPOINT(),populateCallLoweringInfo(),RetTy,setValue(),llvm::GCStrategy::useStatepoints(), andllvm::FunctionLoweringInfo::ValueMap.

◆ populateCallLoweringInfo()

void SelectionDAGBuilder::populateCallLoweringInfo(TargetLowering::CallLoweringInfoCLI,
constCallBaseCall,
unsigned ArgIdx,
unsigned NumArgs,
SDValue Callee,
TypeReturnTy,
AttributeSet RetAttrs,
bool IsPatchPoint 
)

Populate a CallLowerinInfo (intoCLI) 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 line10582 of fileSelectionDAGBuilder.cpp.

Referencesassert(),getCurSDLoc(),getRoot(),getValue(),llvm::LLVMContext::OB_preallocated,llvm::TargetLowering::CallLoweringInfo::setCallee(),llvm::TargetLowering::CallLoweringInfo::setChain(),llvm::TargetLowering::CallLoweringInfo::setDebugLoc(),llvm::TargetLowering::CallLoweringInfo::setDiscardResult(),llvm::TargetLowering::CallLoweringInfo::setIsPatchPoint(), andllvm::TargetLowering::CallLoweringInfo::setIsPreallocated().

Referenced byLowerCallSiteWithDeoptBundleImpl(), andLowerStatepoint().

◆ resolveDanglingDebugInfo()

void SelectionDAGBuilder::resolveDanglingDebugInfo(constValueV,
SDValue Val 
)

If we saw an earlier dbg_value referring to V, generate the debug data structures now that we've seen its definition.

Definition at line1448 of fileSelectionDAGBuilder.cpp.

Referencesllvm::SelectionDAG::AddDbgValue(),assert(),DAG,llvm::dbgs(),DL,llvm::SDValue::dump(),llvm::UndefValue::get(),llvm::SelectionDAG::getConstantDbgValue(),llvm::SDNode::getIROrder(),llvm::SDValue::getNode(),llvm::DILocalVariable::isValidLocationForIntrinsic(), andLLVM_DEBUG.

Referenced bygetCopyFromRegs(),getNonRegisterValue(), andgetValue().

◆ resolveOrClearDbgInfo()

void SelectionDAGBuilder::resolveOrClearDbgInfo()

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

Definition at line1716 of fileSelectionDAGBuilder.cpp.

ReferencesclearDanglingDebugInfo(), andsalvageUnresolvedDbgValue().

◆ salvageUnresolvedDbgValue()

void SelectionDAGBuilder::salvageUnresolvedDbgValue(constValueV,
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 line1502 of fileSelectionDAGBuilder.cpp.

Referencesllvm::SelectionDAG::AddDbgValue(),llvm::DIExpression::appendOpsToArg(),assert(),DAG,llvm::dbgs(),DL,llvm::SmallVectorBase< Size_T >::empty(),llvm::UndefValue::get(),llvm::SelectionDAG::getConstantDbgValue(),llvm::DIExpression::getNumLocationOperands(),llvm::Value::getType(),handleDebugValue(),LLVM_DEBUG, andllvm::salvageDebugInfoImpl().

Referenced bydropDanglingDebugInfo(), andresolveOrClearDbgInfo().

◆ setUnusedArgValue()

void llvm::SelectionDAGBuilder::setUnusedArgValue(constValueV,
SDValue NewN 
)
inline

Definition at line382 of fileSelectionDAGBuilder.h.

Referencesassert(), andN.

◆ setValue()

void llvm::SelectionDAGBuilder::setValue(constValueV,
SDValue NewN 
)
inline

Definition at line376 of fileSelectionDAGBuilder.h.

Referencesassert(), andN.

Referenced byLowerCallSiteWithDeoptBundleImpl(),LowerCallTo(),LowerStatepoint(), andvisitSwitchCase().

◆ 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 line2757 of fileSelectionDAGBuilder.cpp.

ReferencesCC,llvm::ISD::SETEQ, andllvm::ISD::SETNE.

◆ shouldKeepJumpConditionsTogether()

bool SelectionDAGBuilder::shouldKeepJumpConditionsTogether(constFunctionLoweringInfoFuncInfo,
constBranchInstI,
Instruction::BinaryOps Opc,
constValueLhs,
constValueRhs,
TargetLoweringBase::CondMergingParams Params 
) const

Definition at line2512 of fileSelectionDAGBuilder.cpp.

Referencesllvm::TargetLoweringBase::CondMergingParams::BaseCost,llvm::FunctionLoweringInfo::BPI,collectInstructionDeps(),llvm::MapVector< KeyT, ValueT, MapType, VectorType >::contains(),DAG,FuncInfo,llvm::TargetTransformInfo::getInstructionCost(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::TargetLoweringBase::getTargetMachine(),llvm::TargetMachine::getTargetTransformInfo(),I,llvm::BranchProbabilityInfo::isEdgeHot(),llvm::TargetLoweringBase::CondMergingParams::LikelyBias,llvm::SelectionDAG::MaxRecursionDepth,llvm::TargetTransformInfo::TCK_Latency,llvm::MapVector< KeyT, ValueT, MapType, VectorType >::try_emplace(), andllvm::TargetLoweringBase::CondMergingParams::UnlikelyBias.

◆ UpdateSplitBlock()

void SelectionDAGBuilder::UpdateSplitBlock(MachineBasicBlockFirst,
MachineBasicBlockLast 
)

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

Definition at line3510 of fileSelectionDAGBuilder.cpp.

Referencesllvm::First,llvm::Last,llvm::SwitchCG::BitTestBlock::Parent, andSL.

◆ visit()[1/2]

void SelectionDAGBuilder::visit(constInstructionI)

Definition at line1317 of fileSelectionDAGBuilder.cpp.

Referencesllvm::SelectionDAG::addMMRAMetadata(),llvm::SelectionDAG::addPCSections(),assert(),CopyToExportRegsIfNeeded(),DAG,llvm::errs(),HasTailCall,I,LLVM_DEBUG,visit(), andvisitDbgInfo().

Referenced bygetValueImpl(), andvisit().

◆ visit()[2/2]

void SelectionDAGBuilder::visit(unsigned Opcode,
constUserI 
)

Definition at line1372 of fileSelectionDAGBuilder.cpp.

Referencesllvm_unreachable.

◆ visitBitTestCase()

void SelectionDAGBuilder::visitBitTestCase(SwitchCG::BitTestBlockBB,
MachineBasicBlockNextMBB,
BranchProbability BranchProbToNext,
Register Reg,
SwitchCG::BitTestCaseB,
MachineBasicBlockSwitchBB 
)

visitBitTestCase - this function produces one "bit test"

Definition at line3264 of fileSelectionDAGBuilder.cpp.

Referencesllvm::ISD::AND,B,llvm::ISD::BR,llvm::ISD::BRCOND,llvm::countr_one(),llvm::countr_zero(),DAG,llvm::SelectionDAG::getBasicBlock(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),getControlRoot(),llvm::SelectionDAG::getCopyFromReg(),getCurSDLoc(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::MachineBasicBlock::normalizeSuccProbs(),llvm::popcount(),llvm::SwitchCG::BitTestBlock::Range,llvm::SwitchCG::BitTestBlock::RegVT,llvm::ISD::SETEQ,llvm::ISD::SETNE,llvm::SelectionDAG::setRoot(), andllvm::ISD::SHL.

◆ visitBitTestHeader()

void SelectionDAGBuilder::visitBitTestHeader(SwitchCG::BitTestBlockB,
MachineBasicBlockSwitchBB 
)

visitBitTestHeader - This function emits necessary code to produce value suitable for "bit tests"

Definition at line3202 of fileSelectionDAGBuilder.cpp.

ReferencesB,llvm::ISD::BR,llvm::ISD::BRCOND,llvm::FunctionLoweringInfo::CreateReg(),DAG,FuncInfo,llvm::SelectionDAG::getBasicBlock(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),getControlRoot(),llvm::SelectionDAG::getCopyToReg(),getCurSDLoc(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getNode(),llvm::TargetLoweringBase::getPointerTy(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::EVT::getSimpleVT(),llvm::EVT::getSizeInBits(),llvm::SelectionDAG::getTargetLoweringInfo(),getValue(),llvm::SDValue::getValueType(),llvm::SelectionDAG::getZExtOrTrunc(),llvm::TargetLoweringBase::isTypeLegal(),llvm::isUIntN(),MBB,llvm::MachineBasicBlock::normalizeSuccProbs(),llvm::SelectionDAG::setRoot(),llvm::ISD::SETUGT, andllvm::ISD::SUB.

◆ visitDbgInfo()

void SelectionDAGBuilder::visitDbgInfo(constInstructionI)

Definition at line1229 of fileSelectionDAGBuilder.cpp.

ReferencesaddDanglingDebugInfo(),llvm::SelectionDAG::AddDbgLabel(),llvm::any_of(),assert(),DAG,llvm::dbgs(),llvm::DbgVariableRecord::Declare,dropDanglingDebugInfo(),llvm::SmallVectorBase< Size_T >::empty(),End,FuncInfo,llvm::SelectionDAG::getDbgLabel(),llvm::DbgRecord::getDebugLoc(),llvm::DbgVariableRecord::getExpression(),llvm::SelectionDAG::getFunctionVarLocs(),llvm::DbgVariableRecord::getType(),llvm::DbgVariableRecord::getVariable(),llvm::DbgVariableRecord::getVariableLocationOp(),handleDebugDeclare(),handleDebugValue(),handleKillDebugValue(),llvm::DbgVariableRecord::hasArgList(),I,LLVM_DEBUG,llvm::DbgVariableRecord::location_ops(),llvm::FunctionLoweringInfo::PreprocessedDVRDeclares, andllvm::SmallVectorBase< Size_T >::size().

Referenced byvisit().

◆ visitJumpTable()

void SelectionDAGBuilder::visitJumpTable(SwitchCG::JumpTableJT)

visitJumpTable - EmitJumpTable node in the current MBB

Definition at line2988 of fileSelectionDAGBuilder.cpp.

Referencesassert(),llvm::ISD::BR_JT,DAG,getControlRoot(),llvm::SelectionDAG::getCopyFromReg(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getJumpTable(),llvm::TargetLowering::getJumpTableRegTy(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getTargetLoweringInfo(), andllvm::SelectionDAG::setRoot().

◆ visitJumpTableHeader()

void SelectionDAGBuilder::visitJumpTableHeader(SwitchCG::JumpTableJT,
SwitchCG::JumpTableHeaderJTH,
MachineBasicBlockSwitchBB 
)

visitJumpTableHeader - This function emits necessary code to produce index in theJumpTable from switch case.

Definition at line3002 of fileSelectionDAGBuilder.cpp.

Referencesassert(),llvm::ISD::BR,llvm::ISD::BRCOND,llvm::FunctionLoweringInfo::CreateReg(),DAG,llvm::SwitchCG::JumpTableHeader::FallthroughUnreachable,llvm::SwitchCG::JumpTableHeader::First,FuncInfo,llvm::SelectionDAG::getBasicBlock(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),getControlRoot(),llvm::SelectionDAG::getCopyToReg(),llvm::SelectionDAG::getDataLayout(),llvm::TargetLowering::getJumpTableRegTy(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::SelectionDAG::getTargetLoweringInfo(),getValue(),llvm::SDValue::getValueType(),llvm::SelectionDAG::getZExtOrTrunc(),llvm::SwitchCG::JumpTableHeader::Last,llvm::SelectionDAG::setRoot(),llvm::ISD::SETUGT,llvm::ISD::SUB, andllvm::SwitchCG::JumpTableHeader::SValue.

◆ visitSPDescriptorFailure()

void SelectionDAGBuilder::visitSPDescriptorFailure(StackProtectorDescriptorSPD)

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 classStackProtectorDescriptor.

Definition at line3184 of fileSelectionDAGBuilder.cpp.

ReferencesDAG,getCurSDLoc(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getTarget(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::TargetLowering::makeLibCall(),llvm::TargetOptions::NoTrapAfterNoreturn,llvm::TargetMachine::Options,llvm::TargetLowering::MakeLibCallOptions::setDiscardResult(),llvm::SelectionDAG::setRoot(),llvm::ISD::TRAP, andllvm::TargetOptions::TrapUnreachable.

◆ visitSPDescriptorParent()

void SelectionDAGBuilder::visitSPDescriptorParent(StackProtectorDescriptorSPD,
MachineBasicBlockParentBB 
)

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 classStackProtectorDescriptor.

Definition at line3089 of fileSelectionDAGBuilder.cpp.

Referencesassert(),llvm::ISD::BR,llvm::ISD::BRCOND,DAG,llvm::TargetLowering::emitStackGuardXorFP(),llvm::PointerType::get(),llvm::SelectionDAG::getBasicBlock(),llvm::SelectionDAG::getContext(),getCurSDLoc(),llvm::SelectionDAG::getDataLayout(),llvm::SelectionDAG::getEntryNode(),llvm::StackProtectorDescriptor::getFailureMBB(),llvm::MachinePointerInfo::getFixedStack(),llvm::SelectionDAG::getFrameIndex(),llvm::MachineFunction::getFrameInfo(),llvm::MachineFunction::getFunction(),llvm::SelectionDAG::getLoad(),getLoadStackGuard(),llvm::SelectionDAG::getMachineFunction(),llvm::SelectionDAG::getNode(),llvm::FunctionType::getNumParams(),llvm::SDValue::getOperand(),llvm::FunctionType::getParamType(),llvm::GlobalValue::getParent(),llvm::MachineBasicBlock::getParent(),llvm::TargetLoweringBase::getPointerMemTy(),llvm::TargetLoweringBase::getPointerTy(),llvm::DataLayout::getPrefTypeAlign(),llvm::FunctionType::getReturnType(),llvm::TargetLoweringBase::getSDagStackGuard(),llvm::SelectionDAG::getSetCC(),llvm::TargetLoweringBase::getSetCCResultType(),llvm::TargetLoweringBase::getSSPStackGuardCheck(),llvm::MachineFrameInfo::getStackProtectorIndex(),llvm::StackProtectorDescriptor::getSuccessMBB(),llvm::SelectionDAG::getTargetLoweringInfo(),getValue(),llvm::SDValue::getValueType(),llvm::TargetLowering::LowerCallTo(),llvm::MachineMemOperand::MOVolatile,llvm::TargetLowering::CallLoweringInfo::setCallee(),llvm::TargetLowering::CallLoweringInfo::setChain(),llvm::TargetLowering::CallLoweringInfo::setDebugLoc(),llvm::ISD::SETNE,llvm::SelectionDAG::setRoot(),llvm::TargetLowering::useLoadStackGuardNode(), andllvm::TargetLoweringBase::useStackGuardXorFP().

◆ visitSwitchCase()

void SelectionDAGBuilder::visitSwitchCase(SwitchCG::CaseBlockCB,
MachineBasicBlockSwitchBB 
)

visitSwitchCase - Emits the necessary code to represent a single node in the binary search tree resulting from lowering a switch instruction.

Definition at line2892 of fileSelectionDAGBuilder.cpp.

Referencesassert(),llvm::ISD::BR,llvm::ISD::BRCOND,llvm::SwitchCG::CaseBlock::CC,llvm::SwitchCG::CaseBlock::CmpLHS,llvm::SwitchCG::CaseBlock::CmpMHS,llvm::SwitchCG::CaseBlock::CmpRHS,Cond,DAG,llvm::SwitchCG::CaseBlock::DL,llvm::SwitchCG::CaseBlock::FalseBB,llvm::SwitchCG::CaseBlock::FalseProb,llvm::SelectionDAG::getBasicBlock(),llvm::SelectionDAG::getConstant(),llvm::SelectionDAG::getContext(),getControlRoot(),getCurSDLoc(),llvm::SelectionDAG::getDataLayout(),llvm::ConstantInt::getFalse(),llvm::TargetLoweringBase::getMemValueType(),llvm::SelectionDAG::getNode(),llvm::SelectionDAG::getPtrExtOrTrunc(),llvm::SelectionDAG::getSetCC(),llvm::SelectionDAG::getTargetLoweringInfo(),llvm::ConstantInt::getTrue(),llvm::Value::getType(),getValue(),llvm::SDValue::getValueType(),High,llvm::SwitchCG::CaseBlock::IsUnpredictable,llvm::Low,llvm::MachineBasicBlock::normalizeSuccProbs(),llvm::ISD::SETEQ,llvm::ISD::SETLE,llvm::SelectionDAG::setRoot(),llvm::ISD::SETTRUE,llvm::ISD::SETULE,setValue(),llvm::ISD::SUB,std::swap(),llvm::SwitchCG::CaseBlock::TrueBB,llvm::SwitchCG::CaseBlock::TrueProb, andllvm::ISD::XOR.

Member Data Documentation

◆ AC

AssumptionCache* llvm::SelectionDAGBuilder::AC = nullptr

Definition at line229 of fileSelectionDAGBuilder.h.

Referenced byinit().

◆ BatchAA

BatchAAResults* llvm::SelectionDAGBuilder::BatchAA = nullptr

Definition at line228 of fileSelectionDAGBuilder.h.

Referenced bygetMemCmpLoad(), andinit().

◆ ConstantsOut

DenseMap<constConstant *,unsigned> llvm::SelectionDAGBuilder::ConstantsOut

Definition at line257 of fileSelectionDAGBuilder.h.

◆ Context

LLVMContext* llvm::SelectionDAGBuilder::Context = nullptr

Definition at line275 of fileSelectionDAGBuilder.h.

Referenced byhandleKillDebugValue(), andinit().

◆ DAG

SelectionDAG& llvm::SelectionDAGBuilder::DAG

Definition at line227 of fileSelectionDAGBuilder.h.

Referenced byaddDanglingDebugInfo(),addStackMapLiveVars(),llvm::StatepointLoweringState::allocateStackSlot(),CopyValueToVirtualRegister(),EmitBranchForMergedCondition(),FindMergedConditions(),getCopyFromRegs(),getFrameIndexTy(),getMemCmpLoad(),getUniformBase(),getValueImpl(),handleDebugDeclare(),handleDebugValue(),init(),LowerAsSTATEPOINT(),LowerCallSiteWithDeoptBundleImpl(),LowerCallSiteWithPtrAuthBundle(),LowerCallTo(),LowerDeoptimizeCall(),LowerDeoptimizingReturn(),lowerIncomingStatepointValue(),lowerInvokable(),lowerRangeToAssertZExt(),LowerStatepoint(),lowerStatepointMetaArgs(),pushStackMapConstant(),reservePreviousStackSlotForValue(),resolveDanglingDebugInfo(),salvageUnresolvedDbgValue(),shouldKeepJumpConditionsTogether(),spillIncomingStatepointValue(),visit(),visitBitTestCase(),visitBitTestHeader(),visitDbgInfo(),visitJumpTable(),visitJumpTableHeader(),visitSPDescriptorFailure(),visitSPDescriptorParent(), andvisitSwitchCase().

◆ FuncInfo

FunctionLoweringInfo& llvm::SelectionDAGBuilder::FuncInfo

Information about the function as a whole.

Definition at line260 of fileSelectionDAGBuilder.h.

Referenced byllvm::StatepointLoweringState::allocateStackSlot(),CopyToExportRegsIfNeeded(),CopyValueToVirtualRegister(),ExportFromCurrentBlock(),findPreviousSpillSlot(),getCopyFromRegs(),getValueImpl(),handleDebugValue(),isExportableFromCurrentBlock(),LowerAsSTATEPOINT(),LowerCallTo(),LowerStatepoint(),lowerStatepointMetaArgs(),reservePreviousStackSlotForValue(),shouldKeepJumpConditionsTogether(),llvm::StatepointLoweringState::startNewStatepoint(),visitBitTestHeader(),visitDbgInfo(), andvisitJumpTableHeader().

◆ GFI

GCFunctionInfo* llvm::SelectionDAGBuilder::GFI = nullptr

Garbage collection metadata for the function.

Definition at line266 of fileSelectionDAGBuilder.h.

Referenced byinit(),isGCValue(),LowerAsSTATEPOINT(), andLowerStatepoint().

◆ 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 line273 of fileSelectionDAGBuilder.h.

Referenced byclear(),lowerInvokable(), andvisit().

◆ LibInfo

constTargetLibraryInfo* llvm::SelectionDAGBuilder::LibInfo = nullptr

Definition at line230 of fileSelectionDAGBuilder.h.

Referenced byinit().

◆ LowestSDNodeOrder

constunsigned llvm::SelectionDAGBuilder::LowestSDNodeOrder = 1
static

Lowest valid SDNodeOrder.

The special case 0 is reserved for scheduling nodes without a correspondingSDNode.

Definition at line225 of fileSelectionDAGBuilder.h.

Referenced byclear().

◆ LPadToCallSiteMap

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

Map a landing pad to the call site indexes.

Definition at line269 of fileSelectionDAGBuilder.h.

Referenced byinit().

◆ 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 line172 of fileSelectionDAGBuilder.h.

Referenced byclear(),getMemCmpLoad(),getMemoryRoot(), andgetRoot().

◆ SL

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

Definition at line249 of fileSelectionDAGBuilder.h.

Referenced byEmitBranchForMergedCondition(),init(),lowerRangeToAssertZExt(), andUpdateSplitBlock().

◆ SPDescriptor

StackProtectorDescriptor llvm::SelectionDAGBuilder::SPDescriptor

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

Definition at line253 of fileSelectionDAGBuilder.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 line176 of fileSelectionDAGBuilder.h.

Referenced byclear(),LowerAsSTATEPOINT(),reservePreviousStackSlotForValue(), andspillIncomingStatepointValue().

◆ SwiftError

SwiftErrorValueTracking& llvm::SelectionDAGBuilder::SwiftError

Information about the swifterror values used throughout the function.

Definition at line263 of fileSelectionDAGBuilder.h.

Referenced byLowerCallTo().


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

Generated on Sun Jul 20 2025 19:49:43 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp