LLVM 20.0.0git
|
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameterized by a TargetLowering 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, AAResults *AA, AssumptionCache *AC, 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. | |
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 (const Value *V, unsigned Reg, ISD::NodeType ExtendType=ISD::ANY_EXTEND) |
void | visit (const Instruction &I) |
void | visitDbgInfo (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. | |
void | addDanglingDebugInfo (SmallVectorImpl< Value * > &Values, DILocalVariable *Var, DIExpression *Expr, bool IsVariadic, DebugLoc DL, unsigned Order) |
Register a dbg_value which relies on a Value which we have not yet seen. | |
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. | |
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. | |
void | salvageUnresolvedDbgValue (const Value *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< const Value * > Values, DILocalVariable *Var, DIExpression *Expr, DebugLoc DbgLoc, unsigned Order, bool IsVariadic) |
For a given list of Values, attempt to create and record a SDDbgValue in the SelectionDAG. | |
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, DebugLoc DL) |
void | resolveOrClearDbgInfo () |
Evict any dangling debug information, attempting to salvage it first. | |
SDValue | getValue (const Value *V) |
getValue - Return an SDValue for the given Value. | |
SDValue | getNonRegisterValue (const Value *V) |
getNonRegisterValue - Return an SDValue for the given Value, but don't look in FuncInfo.ValueMap for a virtual register. | |
SDValue | getValueImpl (const Value *V) |
getValueImpl - Helper function for getValue and getNonRegisterValue. | |
void | setValue (const Value *V, SDValue NewN) |
void | setUnusedArgValue (const Value *V, SDValue NewN) |
bool | shouldKeepJumpConditionsTogether (const FunctionLoweringInfo &FuncInfo, const BranchInst &I, Instruction::BinaryOps Opc, const Value *Lhs, const Value *Rhs, TargetLoweringBase::CondMergingParams Params) const |
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. | |
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 (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. | |
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. | |
void | LowerCallTo (const CallBase &CB, SDValue Callee, bool IsTailCall, bool IsMustTailCall, const BasicBlock *EHPadBB=nullptr, const TargetLowering::PtrAuthInfo *PAI=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, AttributeSet RetAttrs, bool IsPatchPoint) |
Populate a CallLowerinInfo (into CLI ) based on the properties of the call being lowered. | |
std::pair< SDValue, SDValue > | lowerInvokable (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. | |
SDValue | LowerAsSTATEPOINT (StatepointLoweringInfo &SI) |
Lower SLI into a STATEPOINT instruction. | |
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) |
void | LowerCallSiteWithPtrAuthBundle (const CallBase &CB, const BasicBlock *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, unsigned Reg, SwitchCG::BitTestCase &B, MachineBasicBlock *SwitchBB) |
visitBitTestCase - this function produces one "bit test" | |
void | visitJumpTable (SwitchCG::JumpTable &JT) |
visitJumpTable - Emit JumpTable 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 the JumpTable 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). | |
SelectionDAG & | DAG |
AAResults * | AA = nullptr |
AssumptionCache * | AC = nullptr |
const TargetLibraryInfo * | LibInfo = nullptr |
std::unique_ptr< SDAGSwitchLowering > | SL |
StackProtectorDescriptor | SPDescriptor |
A StackProtectorDescriptor structure used to communicate stack protector information in between SelectBasicBlock and FinishBasicBlock. | |
DenseMap< const Constant *, unsigned > | ConstantsOut |
FunctionLoweringInfo & | FuncInfo |
Information about the function as a whole. | |
SwiftErrorValueTracking & | SwiftError |
Information about the swifterror values used throughout the function. | |
GCFunctionInfo * | GFI = 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. | |
LLVMContext * | Context = nullptr |
Static Public Attributes | |
static const unsigned | LowestSDNodeOrder = 1 |
Lowest valid SDNodeOrder. | |
SelectionDAGBuilder - This is the common target-independent lowering implementation that is parameterized by a TargetLowering object.
Definition at line 97 of file SelectionDAGBuilder.h.
|
inline |
Definition at line 277 of file SelectionDAGBuilder.h.
References TM.
void SelectionDAGBuilder::addDanglingDebugInfo | ( | SmallVectorImpl< Value * > & | Values, |
DILocalVariable * | Var, | ||
DIExpression * | Expr, | ||
bool | IsVariadic, | ||
DebugLoc | DL, | ||
unsigned | Order | ||
) |
Register a dbg_value which relies on a Value which we have not yet seen.
Definition at line 1406 of file SelectionDAGBuilder.cpp.
References assert(), DAG, DL, handleDanglingVariadicDebugInfo(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by visitDbgInfo().
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 1101 of file SelectionDAGBuilder.cpp.
References llvm::StatepointLoweringState::clear(), HasTailCall, LowestSDNodeOrder, PendingLoads, and StatepointLowering.
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 1114 of file SelectionDAGBuilder.cpp.
Referenced by resolveOrClearDbgInfo().
CopyToExportRegsIfNeeded - If the given value has virtual registers created for it, emit nodes to copy the value into the virtual registers.
Definition at line 2333 of file SelectionDAGBuilder.cpp.
References assert(), CopyValueToVirtualRegister(), FuncInfo, and llvm::FunctionLoweringInfo::ValueMap.
Referenced by visit().
void SelectionDAGBuilder::CopyValueToVirtualRegister | ( | const Value * | V, |
unsigned | Reg, | ||
ISD::NodeType | ExtendType = ISD::ANY_EXTEND |
||
) |
Definition at line 11246 of file SelectionDAGBuilder.cpp.
References llvm::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(), and llvm::FunctionLoweringInfo::PreferredExtendType.
Referenced by CopyToExportRegsIfNeeded(), and ExportFromCurrentBlock().
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 1423 of file SelectionDAGBuilder.cpp.
References llvm::dbgs(), llvm::erase_if(), llvm::DIExpression::fragmentsOverlap(), LLVM_DEBUG, and salvageUnresolvedDbgValue().
Referenced by visitDbgInfo().
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 2425 of file SelectionDAGBuilder.cpp.
References Cond, 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, and TBB.
Referenced by FindMergedConditions().
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 2349 of file SelectionDAGBuilder.cpp.
References CopyValueToVirtualRegister(), FuncInfo, llvm::FunctionLoweringInfo::InitializeRegForValue(), and llvm::FunctionLoweringInfo::isExportedInst().
Referenced by LowerAsSTATEPOINT().
void SelectionDAGBuilder::FindMergedConditions | ( | const Value * | Cond, |
MachineBasicBlock * | TBB, | ||
MachineBasicBlock * | FBB, | ||
MachineBasicBlock * | CurBB, | ||
MachineBasicBlock * | SwitchBB, | ||
Instruction::BinaryOps | Opc, | ||
BranchProbability | TProb, | ||
BranchProbability | FProb, | ||
bool | InvertCond | ||
) |
Definition at line 2618 of file SelectionDAGBuilder.cpp.
References assert(), 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(), and TBB.
Referenced by FindMergedConditions().
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 1169 of file SelectionDAGBuilder.cpp.
Referenced by LowerAsSTATEPOINT(), lowerInvokable(), visitBitTestCase(), visitBitTestHeader(), visitJumpTable(), visitJumpTableHeader(), and visitSwitchCase().
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 1728 of file SelectionDAGBuilder.cpp.
References DAG, FuncInfo, llvm::SelectionDAG::getContext(), llvm::RegsForValue::getCopyFromRegs(), getCurSDLoc(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getEntryNode(), llvm::SelectionDAG::getTargetLoweringInfo(), resolveDanglingDebugInfo(), and llvm::FunctionLoweringInfo::ValueMap.
Referenced by getValue().
|
inline |
Definition at line 319 of file SelectionDAGBuilder.h.
References llvm::Instruction::getDebugLoc().
|
inline |
Definition at line 315 of file SelectionDAGBuilder.h.
Referenced by CopyValueToVirtualRegister(), EmitBranchForMergedCondition(), getCopyFromRegs(), getMemCmpLoad(), getUniformBase(), getValueImpl(), LowerAsSTATEPOINT(), LowerCallTo(), LowerDeoptimizingReturn(), lowerRangeToAssertZExt(), LowerStatepoint(), lowerStatepointMetaArgs(), populateCallLoweringInfo(), pushStackMapConstant(), spillIncomingStatepointValue(), visitBitTestCase(), visitBitTestHeader(), visitSPDescriptorFailure(), visitSPDescriptorParent(), and visitSwitchCase().
|
inline |
Returns the type of FrameIndex and TargetFrameIndex nodes.
Definition at line 498 of file SelectionDAGBuilder.h.
References DAG, llvm::SelectionDAG::getDataLayout(), llvm::TargetLoweringBase::getFrameIndexTy(), and llvm::SelectionDAG::getTargetLoweringInfo().
Referenced by lowerIncomingStatepointValue(), lowerStatepointMetaArgs(), reservePreviousStackSlotForValue(), and spillIncomingStatepointValue().
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 1149 of file SelectionDAGBuilder.cpp.
References PendingLoads.
Referenced by getRoot().
getNonRegisterValue - Return an SDValue for the given Value, but don't look in FuncInfo.ValueMap for a virtual register.
Definition at line 1769 of file SelectionDAGBuilder.cpp.
References getValueImpl(), llvm::isIntOrFPConstant(), N, and resolveDanglingDebugInfo().
Referenced by CopyValueToVirtualRegister().
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 1153 of file SelectionDAGBuilder.cpp.
References getMemoryRoot(), and PendingLoads.
Referenced by LowerAsSTATEPOINT(), LowerCallTo(), lowerIncomingStatepointValue(), lowerInvokable(), and populateCallLoweringInfo().
getValue - Return an SDValue for the given Value.
Definition at line 1748 of file SelectionDAGBuilder.cpp.
References getCopyFromRegs(), getValueImpl(), N, and resolveDanglingDebugInfo().
Referenced by addStackMapLiveVars(), getMemCmpLoad(), getUniformBase(), getValueImpl(), LowerAsSTATEPOINT(), LowerCallSiteWithPtrAuthBundle(), LowerCallTo(), LowerStatepoint(), lowerStatepointMetaArgs(), populateCallLoweringInfo(), reservePreviousStackSlotForValue(), visitBitTestHeader(), visitJumpTableHeader(), visitSPDescriptorParent(), and visitSwitchCase().
getValueImpl - Helper function for getValue and getNonRegisterValue.
Create an SDValue for the given value.
Definition at line 1792 of file SelectionDAGBuilder.cpp.
References assert(), 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::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::SelectionDAG::getVScale(), llvm::FunctionLoweringInfo::InitializeRegForValue(), llvm::EVT::isFloatingPoint(), 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::FunctionLoweringInfo::StaticAllocaMap, and visit().
Referenced by getNonRegisterValue(), and getValue().
void SelectionDAGBuilder::handleDebugDeclare | ( | Value * | Address, |
DILocalVariable * | Variable, | ||
DIExpression * | Expression, | ||
DebugLoc | DL | ||
) |
Definition at line 1178 of file SelectionDAGBuilder.cpp.
References llvm::SelectionDAG::AddDbgValue(), llvm::Address, assert(), DAG, llvm::dbgs(), DL, llvm::SelectionDAG::getDbgValue(), llvm::SelectionDAG::getFrameIndexDbgValue(), llvm::DILocalVariable::isParameter(), LLVM_DEBUG, and N.
Referenced by visitDbgInfo().
bool SelectionDAGBuilder::handleDebugValue | ( | ArrayRef< const Value * > | Values, |
DILocalVariable * | Var, | ||
DIExpression * | Expr, | ||
DebugLoc | DbgLoc, | ||
unsigned | Order, | ||
bool | IsVariadic | ||
) |
For a given list of Values, attempt to create and record a SDDbgValue in the SelectionDAG.
Definition at line 1582 of file SelectionDAGBuilder.cpp.
References llvm::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, and llvm::FunctionLoweringInfo::ValueMap.
Referenced by handleKillDebugValue(), salvageUnresolvedDbgValue(), and visitDbgInfo().
void SelectionDAGBuilder::handleKillDebugValue | ( | DILocalVariable * | Var, |
DIExpression * | Expr, | ||
DebugLoc | DbgLoc, | ||
unsigned | Order | ||
) |
Create a record for a kill location debug intrinsic.
Definition at line 1571 of file SelectionDAGBuilder.cpp.
References Context, llvm::DIExpression::convertToUndefExpression(), llvm::PoisonValue::get(), llvm::Type::getInt1Ty(), handleDebugValue(), and Poison.
Referenced by visitDbgInfo().
void SelectionDAGBuilder::init | ( | GCFunctionInfo * | gfi, |
AAResults * | AA, | ||
AssumptionCache * | AC, | ||
const TargetLibraryInfo * | li | ||
) |
Definition at line 1087 of file SelectionDAGBuilder.cpp.
References aa, AA, AC, 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, and SL.
bool SelectionDAGBuilder::isExportableFromCurrentBlock | ( | const Value * | V, |
const BasicBlock * | FromBB | ||
) |
Definition at line 2360 of file SelectionDAGBuilder.cpp.
References FuncInfo, llvm::BasicBlock::isEntryBlock(), and llvm::FunctionLoweringInfo::isExportedInst().
Referenced by EmitBranchForMergedCondition().
SDValue SelectionDAGBuilder::LowerAsSTATEPOINT | ( | SelectionDAGBuilder::StatepointLoweringInfo & | SI | ) |
Lower SLI
into a STATEPOINT instruction.
Definition at line 708 of file StatepointLowering.cpp.
References llvm::append_range(), assert(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::count(), llvm::FunctionLoweringInfo::CreateRegs(), DAG, llvm::dbgs(), llvm::SelectionDAG::DeleteNode(), llvm::SmallVectorTemplateCommon< T, typename >::end(), 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::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, and llvm::FunctionLoweringInfo::StatepointRelocationRecord::VReg.
Referenced by LowerCallSiteWithDeoptBundleImpl(), and LowerStatepoint().
void SelectionDAGBuilder::LowerCallSiteWithDeoptBundle | ( | const CallBase * | Call, |
SDValue | Callee, | ||
const BasicBlock * | EHPadBB | ||
) |
Definition at line 1174 of file StatepointLowering.cpp.
References LowerCallSiteWithDeoptBundleImpl().
void SelectionDAGBuilder::LowerCallSiteWithDeoptBundleImpl | ( | const CallBase * | Call, |
SDValue | Callee, | ||
const BasicBlock * | EHPadBB, | ||
bool | VarArgDisallowed, | ||
bool | ForceVoidReturnTy | ||
) |
Definition at line 1140 of file StatepointLowering.cpp.
References DAG, llvm::dbgs(), llvm::StatepointDirectives::DeoptBundleStatepointID, llvm::SelectionDAG::getContext(), llvm::Type::getVoidTy(), LLVM_DEBUG, LowerAsSTATEPOINT(), lowerRangeToAssertZExt(), llvm::None, llvm::LLVMContext::OB_deopt, llvm::parseStatepointDirectivesFromAttrs(), populateCallLoweringInfo(), and setValue().
Referenced by LowerCallSiteWithDeoptBundle(), and LowerDeoptimizeCall().
void SelectionDAGBuilder::LowerCallSiteWithPtrAuthBundle | ( | const CallBase & | CB, |
const BasicBlock * | EHPadBB | ||
) |
Definition at line 9469 of file SelectionDAGBuilder.cpp.
References assert(), DAG, llvm::CallBase::getCalledOperand(), llvm::SelectionDAG::getDataLayout(), llvm::CallBase::getOperandBundle(), getValue(), llvm::CallBase::isMustTailCall(), llvm::CallBase::isTailCall(), and LowerCallTo().
void SelectionDAGBuilder::LowerCallTo | ( | const CallBase & | CB, |
SDValue | Callee, | ||
bool | IsTailCall, | ||
bool | IsMustTailCall, | ||
const BasicBlock * | EHPadBB = nullptr , |
||
const TargetLowering::PtrAuthInfo * | PAI = nullptr |
||
) |
Definition at line 8726 of file SelectionDAGBuilder.cpp.
References llvm::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(), and SwiftError.
Referenced by LowerCallSiteWithPtrAuthBundle().
Definition at line 1302 of file StatepointLowering.cpp.
References DAG, llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getExternalSymbol(), llvm::SelectionDAG::getTargetLoweringInfo(), and LowerCallSiteWithDeoptBundleImpl().
void SelectionDAGBuilder::LowerDeoptimizingReturn | ( | ) |
Definition at line 1315 of file StatepointLowering.cpp.
References DAG, getCurSDLoc(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getRoot(), llvm::SelectionDAG::getTarget(), llvm::TargetMachine::Options, llvm::SelectionDAG::setRoot(), llvm::ISD::TRAP, and llvm::TargetOptions::TrapUnreachable.
std::pair< SDValue, SDValue > SelectionDAGBuilder::lowerInvokable | ( | TargetLowering::CallLoweringInfo & | CLI, |
const BasicBlock * | EHPadBB = nullptr |
||
) |
Definition at line 8685 of file SelectionDAGBuilder.cpp.
References assert(), llvm::TargetLowering::CallLoweringInfo::CB, DAG, getControlRoot(), getRoot(), llvm::SelectionDAG::getTargetLoweringInfo(), HasTailCall, llvm::TargetLowering::CallLoweringInfo::IsTailCall, llvm::TargetLowering::LowerCallTo(), llvm::TargetLowering::CallLoweringInfo::setChain(), and llvm::SelectionDAG::setRoot().
Referenced by lowerCallFromStatepointLoweringInfo(), and LowerCallTo().
SDValue SelectionDAGBuilder::lowerRangeToAssertZExt | ( | SelectionDAG & | DAG, |
const Instruction & | I, | ||
SDValue | Op | ||
) |
Definition at line 10404 of file SelectionDAGBuilder.cpp.
References llvm::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(), and SL.
Referenced by LowerCallSiteWithDeoptBundleImpl(), and LowerCallTo().
void SelectionDAGBuilder::LowerStatepoint | ( | const GCStatepointInst & | I, |
const BasicBlock * | EHPadBB = nullptr |
||
) |
Definition at line 1014 of file StatepointLowering.cpp.
References llvm::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(), and llvm::FunctionLoweringInfo::ValueMap.
void SelectionDAGBuilder::populateCallLoweringInfo | ( | TargetLowering::CallLoweringInfo & | CLI, |
const CallBase * | Call, | ||
unsigned | ArgIdx, | ||
unsigned | NumArgs, | ||
SDValue | Callee, | ||
Type * | ReturnTy, | ||
AttributeSet | RetAttrs, | ||
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 10445 of file SelectionDAGBuilder.cpp.
References assert(), 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(), and llvm::TargetLowering::CallLoweringInfo::setIsPreallocated().
Referenced by LowerCallSiteWithDeoptBundleImpl(), and LowerStatepoint().
If we saw an earlier dbg_value referring to V, generate the debug data structures now that we've seen its definition.
Definition at line 1451 of file SelectionDAGBuilder.cpp.
References llvm::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(), and LLVM_DEBUG.
Referenced by getCopyFromRegs(), getNonRegisterValue(), and getValue().
void SelectionDAGBuilder::resolveOrClearDbgInfo | ( | ) |
Evict any dangling debug information, attempting to salvage it first.
Definition at line 1718 of file SelectionDAGBuilder.cpp.
References clearDanglingDebugInfo(), and salvageUnresolvedDbgValue().
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 1505 of file SelectionDAGBuilder.cpp.
References llvm::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, and llvm::salvageDebugInfoImpl().
Referenced by dropDanglingDebugInfo(), and resolveOrClearDbgInfo().
Definition at line 382 of file SelectionDAGBuilder.h.
Definition at line 376 of file SelectionDAGBuilder.h.
Referenced by LowerCallSiteWithDeoptBundleImpl(), LowerCallTo(), LowerStatepoint(), and visitSwitchCase().
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 2749 of file SelectionDAGBuilder.cpp.
References CC, llvm::ISD::SETEQ, and llvm::ISD::SETNE.
bool SelectionDAGBuilder::shouldKeepJumpConditionsTogether | ( | const FunctionLoweringInfo & | FuncInfo, |
const BranchInst & | I, | ||
Instruction::BinaryOps | Opc, | ||
const Value * | Lhs, | ||
const Value * | Rhs, | ||
TargetLoweringBase::CondMergingParams | Params | ||
) | const |
Definition at line 2504 of file SelectionDAGBuilder.cpp.
References llvm::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(), and llvm::TargetLoweringBase::CondMergingParams::UnlikelyBias.
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 3505 of file SelectionDAGBuilder.cpp.
References llvm::First, llvm::Last, llvm::SwitchCG::BitTestBlock::Parent, and SL.
void SelectionDAGBuilder::visit | ( | const Instruction & | I | ) |
Definition at line 1320 of file SelectionDAGBuilder.cpp.
References llvm::SelectionDAG::addMMRAMetadata(), llvm::SelectionDAG::addPCSections(), assert(), CopyToExportRegsIfNeeded(), DAG, llvm::errs(), HasTailCall, I, LLVM_DEBUG, visit(), and visitDbgInfo().
Referenced by getValueImpl(), and visit().
Definition at line 1375 of file SelectionDAGBuilder.cpp.
References llvm_unreachable.
void SelectionDAGBuilder::visitBitTestCase | ( | SwitchCG::BitTestBlock & | BB, |
MachineBasicBlock * | NextMBB, | ||
BranchProbability | BranchProbToNext, | ||
unsigned | Reg, | ||
SwitchCG::BitTestCase & | B, | ||
MachineBasicBlock * | SwitchBB | ||
) |
visitBitTestCase - this function produces one "bit test"
Definition at line 3258 of file SelectionDAGBuilder.cpp.
References llvm::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(), and llvm::ISD::SHL.
void SelectionDAGBuilder::visitBitTestHeader | ( | SwitchCG::BitTestBlock & | B, |
MachineBasicBlock * | SwitchBB | ||
) |
visitBitTestHeader - This function emits necessary code to produce value suitable for "bit tests"
Definition at line 3196 of file SelectionDAGBuilder.cpp.
References B, 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, and llvm::ISD::SUB.
void SelectionDAGBuilder::visitDbgInfo | ( | const Instruction & | I | ) |
Definition at line 1232 of file SelectionDAGBuilder.cpp.
References addDanglingDebugInfo(), 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, and llvm::SmallVectorBase< Size_T >::size().
Referenced by visit().
void SelectionDAGBuilder::visitJumpTable | ( | SwitchCG::JumpTable & | JT | ) |
visitJumpTable - Emit JumpTable node in the current MBB
Definition at line 2976 of file SelectionDAGBuilder.cpp.
References assert(), llvm::ISD::BR_JT, DAG, getControlRoot(), llvm::SelectionDAG::getCopyFromReg(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getJumpTable(), llvm::TargetLowering::getJumpTableRegTy(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetLoweringInfo(), and llvm::SelectionDAG::setRoot().
void SelectionDAGBuilder::visitJumpTableHeader | ( | SwitchCG::JumpTable & | JT, |
SwitchCG::JumpTableHeader & | JTH, | ||
MachineBasicBlock * | SwitchBB | ||
) |
visitJumpTableHeader - This function emits necessary code to produce index in the JumpTable from switch case.
Definition at line 2990 of file SelectionDAGBuilder.cpp.
References assert(), 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, and llvm::SwitchCG::JumpTableHeader::SValue.
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 3172 of file SelectionDAGBuilder.cpp.
References DAG, getCurSDLoc(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getTargetLoweringInfo(), llvm::TargetMachine::getTargetTriple(), llvm::Triple::isPS(), llvm::Triple::isWasm(), llvm::TargetLowering::makeLibCall(), llvm::TargetLowering::MakeLibCallOptions::setDiscardResult(), llvm::SelectionDAG::setRoot(), and llvm::ISD::TRAP.
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 3077 of file SelectionDAGBuilder.cpp.
References assert(), 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(), and llvm::TargetLoweringBase::useStackGuardXorFP().
void SelectionDAGBuilder::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.
Definition at line 2881 of file SelectionDAGBuilder.cpp.
References assert(), 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::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, and llvm::ISD::XOR.
AAResults* llvm::SelectionDAGBuilder::AA = nullptr |
Definition at line 228 of file SelectionDAGBuilder.h.
Referenced by getMemCmpLoad(), and init().
AssumptionCache* llvm::SelectionDAGBuilder::AC = nullptr |
Definition at line 229 of file SelectionDAGBuilder.h.
Referenced by init().
Definition at line 257 of file SelectionDAGBuilder.h.
LLVMContext* llvm::SelectionDAGBuilder::Context = nullptr |
Definition at line 275 of file SelectionDAGBuilder.h.
Referenced by handleKillDebugValue(), and init().
SelectionDAG& llvm::SelectionDAGBuilder::DAG |
Definition at line 227 of file SelectionDAGBuilder.h.
Referenced by addDanglingDebugInfo(), 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(), and visitSwitchCase().
FunctionLoweringInfo& llvm::SelectionDAGBuilder::FuncInfo |
Information about the function as a whole.
Definition at line 260 of file SelectionDAGBuilder.h.
Referenced by llvm::StatepointLoweringState::allocateStackSlot(), CopyToExportRegsIfNeeded(), CopyValueToVirtualRegister(), ExportFromCurrentBlock(), findPreviousSpillSlot(), getCopyFromRegs(), getValueImpl(), handleDebugValue(), isExportableFromCurrentBlock(), LowerAsSTATEPOINT(), LowerCallTo(), LowerStatepoint(), lowerStatepointMetaArgs(), reservePreviousStackSlotForValue(), shouldKeepJumpConditionsTogether(), llvm::StatepointLoweringState::startNewStatepoint(), visitBitTestHeader(), visitDbgInfo(), and visitJumpTableHeader().
GCFunctionInfo* llvm::SelectionDAGBuilder::GFI = nullptr |
Garbage collection metadata for the function.
Definition at line 266 of file SelectionDAGBuilder.h.
Referenced by init(), isGCValue(), LowerAsSTATEPOINT(), and LowerStatepoint().
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 273 of file SelectionDAGBuilder.h.
Referenced by clear(), lowerInvokable(), and visit().
const TargetLibraryInfo* llvm::SelectionDAGBuilder::LibInfo = nullptr |
Definition at line 230 of file SelectionDAGBuilder.h.
Referenced by init().
Lowest valid SDNodeOrder.
The special case 0 is reserved for scheduling nodes without a corresponding SDNode.
Definition at line 225 of file SelectionDAGBuilder.h.
Referenced by clear().
DenseMap<MachineBasicBlock *, SmallVector<unsigned, 4> > llvm::SelectionDAGBuilder::LPadToCallSiteMap |
Map a landing pad to the call site indexes.
Definition at line 269 of file SelectionDAGBuilder.h.
Referenced by init().
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 172 of file SelectionDAGBuilder.h.
Referenced by clear(), getMemCmpLoad(), getMemoryRoot(), and getRoot().
std::unique_ptr<SDAGSwitchLowering> llvm::SelectionDAGBuilder::SL |
Definition at line 249 of file SelectionDAGBuilder.h.
Referenced by EmitBranchForMergedCondition(), init(), lowerRangeToAssertZExt(), and UpdateSplitBlock().
StackProtectorDescriptor llvm::SelectionDAGBuilder::SPDescriptor |
A StackProtectorDescriptor structure used to communicate stack protector information in between SelectBasicBlock and FinishBasicBlock.
Definition at line 253 of file SelectionDAGBuilder.h.
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 176 of file SelectionDAGBuilder.h.
Referenced by clear(), LowerAsSTATEPOINT(), reservePreviousStackSlotForValue(), and spillIncomingStatepointValue().
SwiftErrorValueTracking& llvm::SelectionDAGBuilder::SwiftError |
Information about the swifterror values used throughout the function.
Definition at line 263 of file SelectionDAGBuilder.h.
Referenced by LowerCallTo().