LLVM 17.0.0git
|
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruction selectors. More...
#include "llvm/CodeGen/SelectionDAGISel.h"
Public Member Functions | |
SelectionDAGISel (char &ID, TargetMachine &tm, CodeGenOpt::Level OL=CodeGenOpt::Default) | |
~SelectionDAGISel () override | |
const TargetLowering * | getTargetLowering () const |
void | getAnalysisUsage (AnalysisUsage &AU) const override |
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. | |
bool | runOnMachineFunction (MachineFunction &MF) override |
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis. | |
virtual void | emitFunctionEntryCode () |
virtual void | PreprocessISelDAG () |
PreprocessISelDAG - This hook allows targets to hack on the graph before instruction selection starts. | |
virtual void | PostprocessISelDAG () |
PostprocessISelDAG() - This hook allows the target to hack on the graph right after selection. | |
virtual void | Select (SDNode *N)=0 |
Main hook for targets to transform nodes into machine nodes. | |
virtual bool | SelectInlineAsmMemoryOperand (const SDValue &Op, unsigned ConstraintID, std::vector< SDValue > &OutOps) |
SelectInlineAsmMemoryOperand - Select the specified address as a target addressing mode, according to the specified constraint. | |
virtual bool | IsProfitableToFold (SDValue N, SDNode *U, SDNode *Root) const |
IsProfitableToFold - Returns true if it's profitable to fold the specific operand node N of U during instruction selection that starts at Root. | |
bool | CheckAndMask (SDValue LHS, ConstantSDNode *RHS, int64_t DesiredMaskS) const |
CheckAndMask - The isel is trying to match something like (and X, 255). | |
bool | CheckOrMask (SDValue LHS, ConstantSDNode *RHS, int64_t DesiredMaskS) const |
CheckOrMask - The isel is trying to match something like (or X, 255). | |
virtual bool | CheckPatternPredicate (unsigned PredNo) const |
CheckPatternPredicate - This function is generated by tblgen in the target. | |
virtual bool | CheckNodePredicate (SDNode *N, unsigned PredNo) const |
CheckNodePredicate - This function is generated by tblgen in the target. | |
virtual bool | CheckNodePredicateWithOperands (SDNode *N, unsigned PredNo, const SmallVectorImpl< SDValue > &Operands) const |
CheckNodePredicateWithOperands - This function is generated by tblgen in the target. | |
virtual bool | CheckComplexPattern (SDNode *Root, SDNode *Parent, SDValue N, unsigned PatternNo, SmallVectorImpl< std::pair< SDValue, SDNode * > > &Result) |
virtual SDValue | RunSDNodeXForm (SDValue V, unsigned XFormNo) |
void | SelectCodeCommon (SDNode *NodeToMatch, const unsigned char *MatcherTable, unsigned TableSize) |
virtual bool | ComplexPatternFuncMutatesDAG () const |
Return true if complex patterns for this target can mutate the DAG. | |
bool | mayRaiseFPException (SDNode *Node) const |
Return whether the node may raise an FP exception. | |
bool | isOrEquivalentToAdd (const SDNode *N) const |
![]() | |
bool | doInitialization (Module &) override |
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run. | |
![]() | |
FunctionPass (char &pid) | |
Pass * | createPrinterPass (raw_ostream &OS, const std::string &Banner) const override |
createPrinterPass - Get a function printer pass. | |
virtual bool | runOnFunction (Function &F)=0 |
runOnFunction - Virtual method overriden by subclasses to do the per-function processing of the pass. | |
void | assignPassManager (PMStack &PMS, PassManagerType T) override |
Find appropriate Function Pass Manager or Call Graph Pass Manager in the PM Stack and add self into that manager. | |
PassManagerType | getPotentialPassManagerType () const override |
Return what kind of Pass Manager can manage this pass. | |
![]() | |
Pass (PassKind K, char &pid) | |
Pass (const Pass &)=delete | |
Pass & | operator= (const Pass &)=delete |
virtual | ~Pass () |
PassKind | getPassKind () const |
virtual StringRef | getPassName () const |
getPassName - Return a nice clean name for a pass. | |
AnalysisID | getPassID () const |
getPassID - Return the PassID number that corresponds to this pass. | |
virtual bool | doInitialization (Module &) |
doInitialization - Virtual method overridden by subclasses to do any necessary initialization before any pass is run. | |
virtual bool | doFinalization (Module &) |
doFinalization - Virtual method overriden by subclasses to do any necessary clean up after all passes have run. | |
virtual void | print (raw_ostream &OS, const Module *M) const |
print - Print out the internal state of the pass. | |
void | dump () const |
virtual Pass * | createPrinterPass (raw_ostream &OS, const std::string &Banner) const =0 |
createPrinterPass - Get a Pass appropriate to print the IR this pass operates on (Module, Function or MachineFunction). | |
virtual void | assignPassManager (PMStack &, PassManagerType) |
Each pass is responsible for assigning a pass manager to itself. | |
virtual void | preparePassManager (PMStack &) |
Check if available pass managers are suitable for this pass or not. | |
virtual PassManagerType | getPotentialPassManagerType () const |
Return what kind of Pass Manager can manage this pass. | |
void | setResolver (AnalysisResolver *AR) |
AnalysisResolver * | getResolver () const |
virtual void | getAnalysisUsage (AnalysisUsage &) const |
getAnalysisUsage - This function should be overriden by passes that need analysis information to do their job. | |
virtual void | releaseMemory () |
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memory when it is no longer needed. | |
virtual void * | getAdjustedAnalysisPointer (AnalysisID ID) |
getAdjustedAnalysisPointer - This method is used when a pass implements an analysis interface through multiple inheritance. | |
virtual ImmutablePass * | getAsImmutablePass () |
virtual PMDataManager * | getAsPMDataManager () |
virtual void | verifyAnalysis () const |
verifyAnalysis() - This member can be implemented by a analysis pass to check state of analysis information. | |
virtual void | dumpPassStructure (unsigned Offset=0) |
template<typename AnalysisType > | |
AnalysisType * | getAnalysisIfAvailable () const |
getAnalysisIfAvailable<AnalysisType>() - Subclasses use this function to get analysis information that might be around, for example to update it. | |
bool | mustPreserveAnalysisID (char &AID) const |
mustPreserveAnalysisID - This method serves the same function as getAnalysisIfAvailable, but works if you just have an AnalysisID. | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis () const |
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysis (Function &F, bool *Changed=nullptr) |
getAnalysis<AnalysisType>() - This function is used by subclasses to get to the analysis information that they claim to use by overriding the getAnalysisUsage function. | |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI) const |
template<typename AnalysisType > | |
AnalysisType & | getAnalysisID (AnalysisID PI, Function &F, bool *Changed=nullptr) |
Static Public Member Functions | |
static bool | IsLegalToFold (SDValue N, SDNode *U, SDNode *Root, CodeGenOpt::Level OptLevel, bool IgnoreChains=false) |
IsLegalToFold - Returns true if the specific operand node N of U can be folded during instruction selection that starts at Root. | |
static void | InvalidateNodeId (SDNode *N) |
static int | getUninvalidatedNodeId (SDNode *N) |
static void | EnforceNodeIdInvariant (SDNode *N) |
static int | getNumFixedFromVariadicInfo (unsigned Flags) |
getNumFixedFromVariadicInfo - Transform an EmitNode flags word into the number of fixed arity values that should be skipped when copying from the root. | |
![]() | |
static const PassInfo * | lookupPassInfo (const void *TI) |
static const PassInfo * | lookupPassInfo (StringRef Arg) |
static Pass * | createPass (AnalysisID ID) |
Public Attributes | |
TargetMachine & | TM |
const TargetLibraryInfo * | LibInfo |
std::unique_ptr< FunctionLoweringInfo > | FuncInfo |
SwiftErrorValueTracking * | SwiftError |
MachineFunction * | MF |
MachineRegisterInfo * | RegInfo |
SelectionDAG * | CurDAG |
std::unique_ptr< SelectionDAGBuilder > | SDB |
AAResults * | AA = nullptr |
AssumptionCache * | AC = nullptr |
GCFunctionInfo * | GFI = nullptr |
CodeGenOpt::Level | OptLevel |
const TargetInstrInfo * | TII |
const TargetLowering * | TLI |
bool | FastISelFailed |
SmallPtrSet< const Instruction *, 4 > | ElidedArgCopyInstrs |
std::unique_ptr< OptimizationRemarkEmitter > | ORE |
Current optimization remark emitter. | |
Protected Member Functions | |
void | ReplaceUses (SDValue F, SDValue T) |
ReplaceUses - replace all uses of the old node F with the use of the new node T. | |
void | ReplaceUses (const SDValue *F, const SDValue *T, unsigned Num) |
ReplaceUses - replace all uses of the old nodes F with the use of the new nodes T. | |
void | ReplaceUses (SDNode *F, SDNode *T) |
ReplaceUses - replace all uses of the old node F with the use of the new node T. | |
void | ReplaceNode (SDNode *F, SDNode *T) |
Replace all uses of F with T , then remove F from the DAG. | |
void | SelectInlineAsmMemoryOperands (std::vector< SDValue > &Ops, const SDLoc &DL) |
SelectInlineAsmMemoryOperands - Calls to this are automatically generated by tblgen. | |
virtual StringRef | getPatternForIndex (unsigned index) |
getPatternForIndex - Patterns selected by tablegen during ISEL | |
virtual StringRef | getIncludePathForIndex (unsigned index) |
getIncludePathForIndex - get the td source location of pattern instantiation | |
bool | shouldOptForSize (const MachineFunction *MF) const |
![]() | |
MachineFunctionPass (char &ID) | |
virtual bool | runOnMachineFunction (MachineFunction &MF)=0 |
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis. | |
void | getAnalysisUsage (AnalysisUsage &AU) const override |
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this. | |
virtual MachineFunctionProperties | getRequiredProperties () const |
virtual MachineFunctionProperties | getSetProperties () const |
virtual MachineFunctionProperties | getClearedProperties () const |
![]() | |
bool | skipFunction (const Function &F) const |
Optional passes call this function to check whether the pass should be skipped. | |
Protected Attributes | |
unsigned | DAGSize = 0 |
DAGSize - Size of DAG being instruction selected. | |
SelectionDAGISel - This is the common base class used for SelectionDAG-based pattern-matching instruction selectors.
Definition at line 41 of file SelectionDAGISel.h.
anonymous enum |
Enumerator | |
---|---|
OPFL_None | |
OPFL_Chain | |
OPFL_GlueInput | |
OPFL_GlueOutput | |
OPFL_MemRefs | |
OPFL_Variadic0 | |
OPFL_Variadic1 | |
OPFL_Variadic2 | |
OPFL_Variadic3 | |
OPFL_Variadic4 | |
OPFL_Variadic5 | |
OPFL_Variadic6 | |
OPFL_VariadicInfo |
Definition at line 175 of file SelectionDAGISel.h.
Definition at line 116 of file SelectionDAGISel.h.
|
explicit |
|
override |
Definition at line 332 of file SelectionDAGISel.cpp.
References CurDAG, and SwiftError.
bool SelectionDAGISel::CheckAndMask | ( | SDValue | LHS, |
ConstantSDNode * | RHS, | ||
int64_t | DesiredMaskS | ||
) | const |
CheckAndMask - The isel is trying to match something like (and X, 255).
If the dag combiner simplified the 255, we still want to match. RHS is the actual value in the DAG on the RHS of an AND, and DesiredMaskS is the value specified in the .td file (e.g. 255).
Definition at line 2003 of file SelectionDAGISel.cpp.
References CurDAG, llvm::APInt::isSubsetOf(), LHS, llvm::SelectionDAG::MaskedValueIsZero(), and RHS.
Referenced by CheckAndImm().
|
inlinevirtual |
Definition at line 288 of file SelectionDAGISel.h.
References llvm_unreachable.
Referenced by SelectCodeCommon().
|
inlinevirtual |
CheckNodePredicate - This function is generated by tblgen in the target.
It runs node predicate number PredNo and returns true if it succeeds or false if it fails. The number is a private implementation detail to the code tblgen produces.
Definition at line 273 of file SelectionDAGISel.h.
References llvm_unreachable.
Referenced by CheckNodePredicate(), and SelectCodeCommon().
|
inlinevirtual |
CheckNodePredicateWithOperands - This function is generated by tblgen in the target.
It runs node predicate number PredNo and returns true if it succeeds or false if it fails. The number is a private implementation detail to the code tblgen produces.
Definition at line 282 of file SelectionDAGISel.h.
References llvm_unreachable.
Referenced by SelectCodeCommon().
bool SelectionDAGISel::CheckOrMask | ( | SDValue | LHS, |
ConstantSDNode * | RHS, | ||
int64_t | DesiredMaskS | ||
) | const |
CheckOrMask - The isel is trying to match something like (or X, 255).
If the dag combiner simplified the 255, we still want to match. RHS is the actual value in the DAG on the RHS of an OR, and DesiredMaskS is the value specified in the .td file (e.g. 255).
Definition at line 2032 of file SelectionDAGISel.cpp.
References llvm::SelectionDAG::computeKnownBits(), CurDAG, llvm::APInt::isSubsetOf(), LHS, llvm::KnownBits::One, and RHS.
Referenced by CheckOrImm().
CheckPatternPredicate - This function is generated by tblgen in the target.
It runs the specified pattern predicate and returns true if it succeeds or false if it fails. The number is a private implementation detail to the code tblgen produces.
Definition at line 265 of file SelectionDAGISel.h.
References llvm_unreachable.
Referenced by CheckPatternPredicate(), and SelectCodeCommon().
|
inlinevirtual |
Return true if complex patterns for this target can mutate the DAG.
Reimplemented in llvm::HexagonDAGToDAGISel.
Definition at line 303 of file SelectionDAGISel.h.
Referenced by SelectCodeCommon().
|
inlinevirtual |
Reimplemented in llvm::HexagonDAGToDAGISel.
Definition at line 74 of file SelectionDAGISel.h.
|
static |
Definition at line 1050 of file SelectionDAGISel.cpp.
References llvm::SmallVectorBase< Size_T >::empty(), InvalidateNodeId(), N, llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, bool >::push_back().
Referenced by ReplaceNode(), and ReplaceUses().
|
overridevirtual |
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
For MachineFunctionPasses, calling AU.preservesCFG() indicates that the pass does not modify the MachineBasicBlock CFG.
Reimplemented from llvm::MachineFunctionPass.
Reimplemented in AMDGPUDAGToDAGISel, and llvm::MipsDAGToDAGISel.
Definition at line 337 of file SelectionDAGISel.cpp.
References llvm::AnalysisUsage::addPreserved(), llvm::AnalysisUsage::addRequired(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::LazyBlockFrequencyInfoPass::getLazyBFIAnalysisUsage(), llvm::CodeGenOpt::None, OptLevel, and UseMBPI.
Referenced by AMDGPUDAGToDAGISel::getAnalysisUsage(), and llvm::MipsDAGToDAGISel::getAnalysisUsage().
|
inlineprotectedvirtual |
getIncludePathForIndex - get the td source location of pattern instantiation
Definition at line 245 of file SelectionDAGISel.h.
References llvm_unreachable.
Referenced by SelectCodeCommon().
|
inlinestatic |
getNumFixedFromVariadicInfo - Transform an EmitNode flags word into the number of fixed arity values that should be skipped when copying from the root.
Definition at line 195 of file SelectionDAGISel.h.
References Flags, and OPFL_VariadicInfo.
Referenced by SelectCodeCommon().
|
inlineprotectedvirtual |
getPatternForIndex - Patterns selected by tablegen during ISEL
Definition at line 240 of file SelectionDAGISel.h.
References llvm_unreachable.
Referenced by SelectCodeCommon().
|
inline |
Definition at line 68 of file SelectionDAGISel.h.
References TLI.
Referenced by llvm::MipsDAGToDAGISel::getGlobalBaseReg(), AMDGPUDAGToDAGISel::PostprocessISelDAG(), and AMDGPUDAGToDAGISel::Select().
|
static |
|
static |
Definition at line 1069 of file SelectionDAGISel.cpp.
References N.
Referenced by EnforceNodeIdInvariant(), and insertDAGNode().
|
static |
IsLegalToFold - Returns true if the specific operand node N of U can be folded during instruction selection that starts at Root.
FIXME: This is a static member function because the MSP430/X86 targets, which uses it during isel. This could become a proper member.
Definition at line 2185 of file SelectionDAGISel.cpp.
References findGlueUse(), findNonImmUse(), llvm::SDNode::getNumValues(), llvm::SDNode::getValueType(), N, llvm::CodeGenOpt::None, and OptLevel.
Referenced by llvm::RISCVDAGToDAGISel::Select(), and SelectCodeCommon().
Definition at line 3854 of file SelectionDAGISel.cpp.
References A, assert(), llvm::CallingConv::C, llvm::MachineFunction::getFrameInfo(), llvm::MachineFrameInfo::getObjectAlign(), MF, N, and llvm::ISD::OR.
IsProfitableToFold - Returns true if it's profitable to fold the specific operand node N of U during instruction selection that starts at Root.
Definition at line 2177 of file SelectionDAGISel.cpp.
References N, llvm::CodeGenOpt::None, and OptLevel.
Referenced by llvm::RISCVDAGToDAGISel::Select(), and SelectCodeCommon().
Return whether the node may raise an FP exception.
Definition at line 3840 of file SelectionDAGISel.cpp.
References llvm::MCInstrInfo::get(), llvm::MCInstrDesc::mayRaiseFPException(), N, and TII.
Referenced by SelectCodeCommon().
|
inlinevirtual |
PostprocessISelDAG() - This hook allows the target to hack on the graph right after selection.
Reimplemented in AMDGPUDAGToDAGISel, and llvm::RISCVDAGToDAGISel.
Definition at line 82 of file SelectionDAGISel.h.
|
inlinevirtual |
PreprocessISelDAG - This hook allows targets to hack on the graph before instruction selection starts.
Reimplemented in AMDGPUDAGToDAGISel, llvm::HexagonDAGToDAGISel, and llvm::RISCVDAGToDAGISel.
Definition at line 78 of file SelectionDAGISel.h.
Replace all uses of F
with T
, then remove F
from the DAG.
Definition at line 228 of file SelectionDAGISel.h.
References CurDAG, EnforceNodeIdInvariant(), F, llvm::SelectionDAG::RemoveDeadNode(), and llvm::SelectionDAG::ReplaceAllUsesWith().
Referenced by AMDGPUDAGToDAGISel::Select(), llvm::RISCVDAGToDAGISel::Select(), llvm::HexagonDAGToDAGISel::SelectAddSubCarry(), llvm::HexagonDAGToDAGISel::SelectConstant(), llvm::HexagonDAGToDAGISel::SelectConstantFP(), llvm::HexagonDAGToDAGISel::SelectD2P(), llvm::HexagonDAGToDAGISel::SelectExtractSubvector(), llvm::HvxSelector::selectExtractSubvector(), llvm::HexagonDAGToDAGISel::SelectFrameIndex(), llvm::HexagonDAGToDAGISel::SelectIntrinsicWOChain(), llvm::HexagonDAGToDAGISel::SelectP2D(), llvm::HexagonDAGToDAGISel::SelectQ2V(), llvm::HvxSelector::selectRor(), llvm::HexagonDAGToDAGISel::SelectSHL(), llvm::HvxSelector::selectShuffle(), llvm::HexagonDAGToDAGISel::SelectTypecast(), llvm::HexagonDAGToDAGISel::SelectV2Q(), llvm::HexagonDAGToDAGISel::SelectV65Gather(), llvm::HexagonDAGToDAGISel::SelectV65GatherPred(), llvm::HexagonDAGToDAGISel::SelectVAlign(), llvm::HvxSelector::selectVAlign(), llvm::HexagonDAGToDAGISel::SelectVAlignAddr(), llvm::RISCVDAGToDAGISel::selectVSETVLI(), llvm::RISCVDAGToDAGISel::selectVSSEG(), llvm::RISCVDAGToDAGISel::selectVSXSEG(), llvm::RISCVDAGToDAGISel::tryIndexedLoad(), llvm::RISCVDAGToDAGISel::tryShrinkShlLogicImm(), and llvm::RISCVDAGToDAGISel::trySignedBitfieldExtract().
|
inlineprotected |
ReplaceUses - replace all uses of the old nodes F with the use of the new nodes T.
Definition at line 214 of file SelectionDAGISel.h.
References CurDAG, EnforceNodeIdInvariant(), F, and llvm::SelectionDAG::ReplaceAllUsesOfValuesWith().
ReplaceUses - replace all uses of the old node F with the use of the new node T.
Definition at line 222 of file SelectionDAGISel.h.
References CurDAG, EnforceNodeIdInvariant(), F, and llvm::SelectionDAG::ReplaceAllUsesWith().
ReplaceUses - replace all uses of the old node F with the use of the new node T.
Definition at line 207 of file SelectionDAGISel.h.
References CurDAG, EnforceNodeIdInvariant(), F, and llvm::SelectionDAG::ReplaceAllUsesOfValueWith().
Referenced by AMDGPUDAGToDAGISel::PostprocessISelDAG(), llvm::RISCVDAGToDAGISel::Select(), llvm::HexagonDAGToDAGISel::SelectBrevLdIntrinsic(), SelectCodeCommon(), llvm::HexagonDAGToDAGISel::SelectHVXDualOutput(), llvm::HexagonDAGToDAGISel::SelectIndexedStore(), llvm::HexagonDAGToDAGISel::SelectNewCircIntrinsic(), llvm::RISCVDAGToDAGISel::selectVLSEG(), llvm::RISCVDAGToDAGISel::selectVLSEGFF(), llvm::RISCVDAGToDAGISel::selectVLXSEG(), llvm::HexagonDAGToDAGISel::StoreInstrForLoadIntrinsic(), and llvm::HexagonDAGToDAGISel::tryLoadOfLoadIntrinsic().
|
overridevirtual |
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformation or analysis.
Implements llvm::MachineFunctionPass.
Reimplemented in AMDGPUDAGToDAGISel, llvm::HexagonDAGToDAGISel, llvm::LoongArchDAGToDAGISel, llvm::MipsDAGToDAGISel, llvm::NVPTXDAGToDAGISel, and llvm::RISCVDAGToDAGISel.
Definition at line 382 of file SelectionDAGISel.cpp.
References AA, AC, assert(), llvm::MachineBasicBlock::begin(), llvm::BuildMI(), llvm::Function::callsFunctionThatReturnsTwice(), computeUsesMSVCFloatingPoint(), CurDAG, llvm::dbgs(), llvm::LLVMContext::diagnose(), DL, E, llvm::MachineRegisterInfo::EmitLiveInCopies(), llvm::TargetOptions::EnableFastISel, EnableFastISelAbort, EnableFastISelFallbackReport, llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::MachineBasicBlock::end(), FastISelFailed, llvm::MachineFunction::finalizeDebugInstrRefs(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::find(), From, llvm::MachineFunction::front(), llvm::MCInstrInfo::get(), llvm::Function::getContext(), llvm::MachineBasicBlock::getFirstTerminator(), llvm::MachineFunction::getFrameInfo(), llvm::MachineFunction::getFunction(), llvm::TargetSubtargetInfo::getInstrInfo(), llvm::MachineFunction::getMMI(), llvm::Value::getName(), llvm::MachineInstr::getOperand(), llvm::GlobalValue::getParent(), llvm::MachineInstr::getParent(), llvm::MachineFunction::getProperties(), llvm::MachineOperand::getReg(), llvm::MachineFunction::getRegInfo(), llvm::TargetSubtargetInfo::getRegisterInfo(), llvm::MachineFunction::getSubtarget(), llvm::TargetSubtargetInfo::getTargetLowering(), llvm::TargetMachine::getTargetTriple(), llvm::MachineRegisterInfo::getVRegDef(), GFI, llvm::MachineFrameInfo::hasCalls(), llvm::Function::hasGC(), llvm::MachineFunction::hasInlineAsm(), llvm::MachineFunctionProperties::hasProperty(), I, llvm::SelectionDAG::init(), llvm::TargetLowering::initializeSplitCSR(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::MachineBasicBlock::insert(), llvm::MachineBasicBlock::insertAfter(), llvm::TargetLowering::insertCopiesSplitCSR(), llvm::isAssignmentTrackingEnabled(), llvm::MCInstrDesc::isCall(), llvm::MachineInstr::isCopy(), llvm::MachineInstr::isDebugValue(), llvm::MCInstrDesc::isReturn(), llvm::Register::isVirtual(), LibInfo, llvm::MachineRegisterInfo::liveins(), LLVM_DEBUG, MBB, MF, MI, MRI, llvm::CodeGenOpt::None, llvm::TargetMachine::Options, OptLevel, ORE, llvm::MachineFunction::print(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), RegInfo, llvm::TargetMachine::resetTargetOptions(), SDB, llvm::MachineFunctionProperties::Selected, llvm::MachineFunction::setExposesReturnsTwice(), llvm::SwiftErrorValueTracking::setFunction(), llvm::MachineFrameInfo::setHasCalls(), llvm::MachineFunction::setHasInlineAsm(), llvm::MachineFunction::setUseDebugInstrRef(), llvm::MachineFunction::shouldUseDebugInstrRef(), llvm::FunctionPass::skipFunction(), llvm::MachineBasicBlock::succ_empty(), llvm::succ_empty(), llvm::TargetLowering::supportSplitCSR(), SwiftError, TII, TLI, TM, TRI, llvm::MachineRegisterInfo::use_instr_begin(), llvm::MachineRegisterInfo::use_instr_end(), llvm::MachineFunction::useDebugInstrRef(), UseMBPI, UseMI, and llvm::Register::virtReg2Index().
Referenced by AMDGPUDAGToDAGISel::runOnMachineFunction(), llvm::HexagonDAGToDAGISel::runOnMachineFunction(), llvm::LoongArchDAGToDAGISel::runOnMachineFunction(), llvm::MipsDAGToDAGISel::runOnMachineFunction(), llvm::NVPTXDAGToDAGISel::runOnMachineFunction(), and llvm::RISCVDAGToDAGISel::runOnMachineFunction().
|
inlinevirtual |
Definition at line 294 of file SelectionDAGISel.h.
References llvm_unreachable.
Referenced by SelectCodeCommon().
|
pure virtual |
Main hook for targets to transform nodes into machine nodes.
Implemented in AMDGPUDAGToDAGISel, llvm::HexagonDAGToDAGISel, llvm::LoongArchDAGToDAGISel, and llvm::RISCVDAGToDAGISel.
void SelectionDAGISel::SelectCodeCommon | ( | SDNode * | NodeToMatch, |
const unsigned char * | MatcherTable, | ||
unsigned | TableSize | ||
) |
Definition at line 2917 of file SelectionDAGISel.cpp.
References llvm::ISD::ANNOTATION_LABEL, llvm::any_of(), llvm::SmallVectorImpl< T >::append(), llvm::ISD::ARITH_FENCE, assert(), llvm::ISD::AssertAlign, llvm::ISD::AssertSext, llvm::ISD::AssertZext, llvm::SmallVectorTemplateCommon< T, typename >::back(), llvm::ISD::BasicBlock, llvm::SmallVectorTemplateCommon< T, typename >::begin(), CheckAndImm(), CheckChild2CondCode(), CheckChildInteger(), CheckChildSame(), CheckChildType(), CheckComplexPattern(), CheckCondCode(), CheckInteger(), CheckNodePredicate(), CheckNodePredicateWithOperands(), CheckOpcode(), CheckOrImm(), CheckPatternPredicate(), CheckSame(), CheckType(), CheckValueType(), llvm::SmallVectorImpl< T >::clear(), ComplexPatternFuncMutatesDAG(), llvm::ISD::Constant, llvm::ISD::ConstantFP, llvm::ISD::CopyFromReg, llvm::ISD::CopyToReg, CurDAG, llvm::dbgs(), decodeSignRotatedValue(), llvm::ISD::DELETED_NODE, E, llvm::ISD::EH_LABEL, llvm::SmallVectorBase< Size_T >::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::ISD::EntryToken, llvm::erase_value(), Flags, llvm::ISD::FREEZE, llvm::MCInstrInfo::get(), llvm::SelectionDAG::getCopyToReg(), llvm::SelectionDAG::getDataLayout(), llvm::SelectionDAG::getEntryNode(), getIncludePathForIndex(), llvm::SelectionDAG::getMachineNode(), llvm::SDValue::getNode(), getNumFixedFromVariadicInfo(), llvm::SDNode::getNumOperands(), llvm::SDNode::getNumValues(), llvm::SDNode::getOpcode(), llvm::SDNode::getOperand(), getPatternForIndex(), llvm::TargetLoweringBase::getPointerTy(), llvm::SelectionDAG::getRegister(), llvm::EVT::getSizeInBits(), llvm::SelectionDAG::getTargetConstant(), llvm::SelectionDAG::getTargetConstantFP(), llvm::SDValue::getValue(), llvm::SDValue::getValueSizeInBits(), llvm::SDValue::getValueType(), llvm::SDNode::getValueType(), GetVBR(), llvm::SelectionDAG::getVTList(), HandleMergeInputChains(), llvm::ISD::HANDLENODE, Idx, llvm::ISD::INLINEASM, llvm::ISD::INLINEASM_BR, llvm::is_contained(), llvm::ISD::isConstantSplatVectorAllOnes(), llvm::ISD::isConstantSplatVectorAllZeros(), IsLegalToFold(), llvm::SDNode::isMachineOpcode(), IsPredicateKnownToFail(), IsProfitableToFold(), llvm::ISD::LIFETIME_END, llvm::ISD::LIFETIME_START, LLVM_DEBUG, llvm::MCInstrDesc::mayLoad(), mayRaiseFPException(), llvm::MCInstrDesc::mayStore(), llvm::ISD::MCSymbol, llvm::ISD::MDNODE_SDNODE, llvm::ISD::MEMBARRIER, N, OPC_CaptureGlueInput, OPC_CheckAndImm, OPC_CheckChild0Integer, OPC_CheckChild0Same, OPC_CheckChild0Type, OPC_CheckChild1Integer, OPC_CheckChild1Same, OPC_CheckChild1Type, OPC_CheckChild2CondCode, OPC_CheckChild2Integer, OPC_CheckChild2Same, OPC_CheckChild2Type, OPC_CheckChild3Integer, OPC_CheckChild3Same, OPC_CheckChild3Type, OPC_CheckChild4Integer, OPC_CheckChild4Type, OPC_CheckChild5Type, OPC_CheckChild6Type, OPC_CheckChild7Type, OPC_CheckComplexPat, OPC_CheckCondCode, OPC_CheckFoldableChainNode, OPC_CheckImmAllOnesV, OPC_CheckImmAllZerosV, OPC_CheckInteger, OPC_CheckOpcode, OPC_CheckOrImm, OPC_CheckPatternPredicate, OPC_CheckPredicate, OPC_CheckPredicateWithOperands, OPC_CheckSame, OPC_CheckType, OPC_CheckTypeRes, OPC_CheckValueType, OPC_CompleteMatch, OPC_Coverage, OPC_EmitConvertToTarget, OPC_EmitCopyToReg, OPC_EmitCopyToReg2, OPC_EmitInteger, OPC_EmitMergeInputChains, OPC_EmitMergeInputChains1_0, OPC_EmitMergeInputChains1_1, OPC_EmitMergeInputChains1_2, OPC_EmitNode, OPC_EmitNode0, OPC_EmitNode1, OPC_EmitNode2, OPC_EmitNodeXForm, OPC_EmitRegister, OPC_EmitRegister2, OPC_EmitStringInteger, OPC_MorphNodeTo, OPC_MorphNodeTo0, OPC_MorphNodeTo1, OPC_MorphNodeTo2, OPC_MoveChild, OPC_MoveChild0, OPC_MoveChild1, OPC_MoveChild2, OPC_MoveChild3, OPC_MoveChild4, OPC_MoveChild5, OPC_MoveChild6, OPC_MoveChild7, OPC_MoveParent, OPC_RecordChild0, OPC_RecordChild1, OPC_RecordChild2, OPC_RecordChild3, OPC_RecordChild4, OPC_RecordChild5, OPC_RecordChild6, OPC_RecordChild7, OPC_RecordMemRef, OPC_RecordNode, OPC_Scope, OPC_SwitchOpcode, OPC_SwitchType, Operands, OPFL_Chain, OPFL_GlueInput, OPFL_GlueOutput, OPFL_MemRefs, OPFL_VariadicInfo, OptLevel, llvm::ISD::PATCHPOINT, llvm::SmallVectorTemplateBase< T, bool >::pop_back(), llvm::ISD::PSEUDO_PROBE, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::ISD::READ_REGISTER, llvm::ISD::Register, llvm::ISD::RegisterMask, llvm::SelectionDAG::RemoveDeadNode(), ReplaceUses(), llvm::SmallVectorImpl< T >::resize(), RunSDNodeXForm(), llvm::SelectionDAG::salvageDebugInfo(), llvm::SDNode::setNodeId(), llvm::SelectionDAG::setNodeMemRefs(), llvm::SmallVectorBase< Size_T >::size(), llvm::ISD::STACKMAP, llvm::ISD::TargetBlockAddress, llvm::ISD::TargetConstant, llvm::ISD::TargetConstantFP, llvm::ISD::TargetConstantPool, llvm::ISD::TargetExternalSymbol, llvm::ISD::TargetFrameIndex, llvm::ISD::TargetGlobalAddress, llvm::ISD::TargetGlobalTLSAddress, llvm::ISD::TargetJumpTable, TII, TLI, llvm::ISD::TokenFactor, llvm::ISD::UNDEF, llvm::SDNode::use_begin(), llvm::SDNode::use_empty(), llvm::SDNode::use_end(), and llvm::ISD::WRITE_REGISTER.
|
inlinevirtual |
SelectInlineAsmMemoryOperand - Select the specified address as a target addressing mode, according to the specified constraint.
If this does not match or is not implemented, return true. The resultant operands (which will appear in the machine instruction) should be added to the OutOps vector.
Reimplemented in llvm::HexagonDAGToDAGISel, llvm::LoongArchDAGToDAGISel, llvm::NVPTXDAGToDAGISel, and llvm::RISCVDAGToDAGISel.
Definition at line 92 of file SelectionDAGISel.h.
Referenced by SelectInlineAsmMemoryOperands().
|
protected |
SelectInlineAsmMemoryOperands - Calls to this are automatically generated by tblgen.
Others should not call it.
Definition at line 2062 of file SelectionDAGISel.cpp.
References llvm::append_range(), assert(), CurDAG, DL, Flags, llvm::InlineAsm::getFlagWord(), llvm::InlineAsm::getFlagWordForMem(), llvm::InlineAsm::getMemoryConstraintID(), llvm::InlineAsm::getNumOperandRegisters(), llvm::SelectionDAG::getTargetConstant(), llvm::InlineAsm::isFuncKind(), llvm::InlineAsm::isMemKind(), llvm::InlineAsm::isUseOperandTiedToDef(), llvm::InlineAsm::Kind_Func, llvm::InlineAsm::Kind_Mem, llvm::InlineAsm::Op_AsmString, llvm::InlineAsm::Op_ExtraInfo, llvm::InlineAsm::Op_FirstOperand, llvm::InlineAsm::Op_InputChain, llvm::InlineAsm::Op_MDNode, llvm::report_fatal_error(), SelectInlineAsmMemoryOperand(), and std::swap().
|
inlineprotected |
Definition at line 249 of file SelectionDAGISel.h.
References CurDAG, and llvm::SelectionDAG::shouldOptForSize().
AAResults* llvm::SelectionDAGISel::AA = nullptr |
Definition at line 51 of file SelectionDAGISel.h.
Referenced by llvm::createVLIWDAGScheduler(), runOnMachineFunction(), and llvm::HexagonDAGToDAGISel::SelectVAlignAddr().
AssumptionCache* llvm::SelectionDAGISel::AC = nullptr |
Definition at line 52 of file SelectionDAGISel.h.
Referenced by runOnMachineFunction().
SelectionDAG* llvm::SelectionDAGISel::CurDAG |
Definition at line 49 of file SelectionDAGISel.h.
Referenced by llvm::RISCVDAGToDAGISel::addVectorLoadStoreOperands(), CheckAndMask(), CheckOrMask(), llvm::HexagonDAGToDAGISel::DetectUseSxtw(), llvm::MipsDAGToDAGISel::getGlobalBaseReg(), IsPredicateKnownToFail(), llvm::HexagonDAGToDAGISel::LoadInstrForLoadIntrinsic(), AMDGPUDAGToDAGISel::matchLoadD16FromBuildVector(), AMDGPUDAGToDAGISel::PostprocessISelDAG(), llvm::RISCVDAGToDAGISel::PostprocessISelDAG(), AMDGPUDAGToDAGISel::PreprocessISelDAG(), llvm::HexagonDAGToDAGISel::PreprocessISelDAG(), llvm::RISCVDAGToDAGISel::PreprocessISelDAG(), ReplaceNode(), ReplaceUses(), runOnMachineFunction(), AMDGPUDAGToDAGISel::Select(), llvm::RISCVDAGToDAGISel::Select(), llvm::LoongArchDAGToDAGISel::SelectAddrConstant(), llvm::HexagonDAGToDAGISel::SelectAddrFI(), llvm::RISCVDAGToDAGISel::SelectAddrFrameIndex(), llvm::RISCVDAGToDAGISel::SelectAddrRegImm(), llvm::RISCVDAGToDAGISel::SelectAddrRegRegScale(), llvm::HexagonDAGToDAGISel::SelectAddSubCarry(), llvm::HexagonDAGToDAGISel::SelectAnyImmediate(), llvm::HexagonDAGToDAGISel::SelectAnyInt(), llvm::LoongArchDAGToDAGISel::SelectBaseAddr(), llvm::HexagonDAGToDAGISel::SelectBrevLdIntrinsic(), AMDGPUDAGToDAGISel::SelectBuildVector(), SelectCodeCommon(), llvm::HexagonDAGToDAGISel::SelectConstant(), llvm::HexagonDAGToDAGISel::SelectConstantFP(), llvm::HexagonDAGToDAGISel::SelectD2P(), llvm::HexagonDAGToDAGISel::SelectExtractSubvector(), llvm::RISCVDAGToDAGISel::selectFPImm(), llvm::RISCVDAGToDAGISel::SelectFrameAddrRegImm(), llvm::HexagonDAGToDAGISel::SelectFrameIndex(), llvm::HexagonDAGToDAGISel::SelectGlobalAddress(), llvm::HexagonDAGToDAGISel::SelectHVXDualOutput(), llvm::HexagonDAGToDAGISel::SelectIndexedStore(), llvm::HexagonDAGToDAGISel::SelectInlineAsmMemoryOperand(), llvm::LoongArchDAGToDAGISel::SelectInlineAsmMemoryOperand(), llvm::NVPTXDAGToDAGISel::SelectInlineAsmMemoryOperand(), llvm::RISCVDAGToDAGISel::SelectInlineAsmMemoryOperand(), SelectInlineAsmMemoryOperands(), llvm::HexagonDAGToDAGISel::SelectIntrinsicWChain(), llvm::HexagonDAGToDAGISel::SelectIntrinsicWOChain(), llvm::HexagonDAGToDAGISel::SelectNewCircIntrinsic(), llvm::HexagonDAGToDAGISel::SelectP2D(), llvm::HexagonDAGToDAGISel::SelectQ2V(), llvm::RISCVDAGToDAGISel::selectRVVSimm5(), llvm::RISCVDAGToDAGISel::selectSETCC(), llvm::RISCVDAGToDAGISel::selectSExtBits(), llvm::LoongArchDAGToDAGISel::selectSExti32(), llvm::LoongArchDAGToDAGISel::selectShiftMask(), llvm::RISCVDAGToDAGISel::selectShiftMask(), llvm::HexagonDAGToDAGISel::SelectSHL(), llvm::RISCVDAGToDAGISel::selectSHXADD_UWOp(), llvm::RISCVDAGToDAGISel::selectSHXADDOp(), llvm::RISCVDAGToDAGISel::selectSimm5Shl2(), llvm::HexagonDAGToDAGISel::SelectTypecast(), llvm::HexagonDAGToDAGISel::SelectV2Q(), llvm::HexagonDAGToDAGISel::SelectV65Gather(), llvm::HexagonDAGToDAGISel::SelectV65GatherPred(), llvm::HexagonDAGToDAGISel::SelectVAlign(), llvm::HexagonDAGToDAGISel::SelectVAlignAddr(), llvm::RISCVDAGToDAGISel::selectVLOp(), llvm::RISCVDAGToDAGISel::selectVLSEG(), llvm::RISCVDAGToDAGISel::selectVLSEGFF(), llvm::RISCVDAGToDAGISel::selectVLXSEG(), llvm::RISCVDAGToDAGISel::selectVSETVLI(), llvm::RISCVDAGToDAGISel::selectVSplatSimm5(), llvm::RISCVDAGToDAGISel::selectVSplatSimm5Plus1(), llvm::RISCVDAGToDAGISel::selectVSplatSimm5Plus1NonZero(), llvm::RISCVDAGToDAGISel::selectVSplatUimm5(), llvm::RISCVDAGToDAGISel::selectVSSEG(), llvm::RISCVDAGToDAGISel::selectVSXSEG(), llvm::RISCVDAGToDAGISel::selectZExtBits(), llvm::LoongArchDAGToDAGISel::selectZExti32(), shouldOptForSize(), llvm::HexagonDAGToDAGISel::StoreInstrForLoadIntrinsic(), llvm::RISCVDAGToDAGISel::tryIndexedLoad(), llvm::HexagonDAGToDAGISel::tryLoadOfLoadIntrinsic(), llvm::RISCVDAGToDAGISel::tryShrinkShlLogicImm(), llvm::RISCVDAGToDAGISel::trySignedBitfieldExtract(), and ~SelectionDAGISel().
|
protected |
DAGSize - Size of DAG being instruction selected.
Definition at line 203 of file SelectionDAGISel.h.
SmallPtrSet<const Instruction *, 4> llvm::SelectionDAGISel::ElidedArgCopyInstrs |
Definition at line 58 of file SelectionDAGISel.h.
bool llvm::SelectionDAGISel::FastISelFailed |
Definition at line 57 of file SelectionDAGISel.h.
Referenced by runOnMachineFunction().
std::unique_ptr<FunctionLoweringInfo> llvm::SelectionDAGISel::FuncInfo |
Definition at line 45 of file SelectionDAGISel.h.
GCFunctionInfo* llvm::SelectionDAGISel::GFI = nullptr |
Definition at line 53 of file SelectionDAGISel.h.
Referenced by runOnMachineFunction().
const TargetLibraryInfo* llvm::SelectionDAGISel::LibInfo |
Definition at line 44 of file SelectionDAGISel.h.
Referenced by runOnMachineFunction().
MachineFunction* llvm::SelectionDAGISel::MF |
Definition at line 47 of file SelectionDAGISel.h.
Referenced by llvm::createBURRListDAGScheduler(), llvm::createDAGLinearizer(), llvm::createDefaultScheduler(), llvm::createFastDAGScheduler(), llvm::createHybridListDAGScheduler(), llvm::createILPListDAGScheduler(), llvm::createSourceListDAGScheduler(), llvm::createVLIWDAGScheduler(), llvm::HexagonDAGToDAGISel::emitFunctionEntryCode(), llvm::MipsDAGToDAGISel::getGlobalBaseReg(), isOrEquivalentToAdd(), llvm::OptLevelChanger::OptLevelChanger(), llvm::RISCVDAGToDAGISel::PreprocessISelDAG(), llvm::ResourcePriorityQueue::ResourcePriorityQueue(), runOnMachineFunction(), AMDGPUDAGToDAGISel::runOnMachineFunction(), llvm::HexagonDAGToDAGISel::runOnMachineFunction(), llvm::LoongArchDAGToDAGISel::runOnMachineFunction(), llvm::MipsDAGToDAGISel::runOnMachineFunction(), llvm::NVPTXDAGToDAGISel::runOnMachineFunction(), llvm::RISCVDAGToDAGISel::runOnMachineFunction(), llvm::HexagonDAGToDAGISel::SelectAddrFI(), llvm::HexagonDAGToDAGISel::SelectFrameIndex(), and llvm::OptLevelChanger::~OptLevelChanger().
CodeGenOpt::Level llvm::SelectionDAGISel::OptLevel |
Definition at line 54 of file SelectionDAGISel.h.
Referenced by llvm::createMipsSEISelDag(), getAnalysisUsage(), IsLegalToFold(), IsProfitableToFold(), llvm::OptLevelChanger::OptLevelChanger(), runOnMachineFunction(), SelectCodeCommon(), and llvm::OptLevelChanger::~OptLevelChanger().
std::unique_ptr<OptimizationRemarkEmitter> llvm::SelectionDAGISel::ORE |
Current optimization remark emitter.
Used to report things like combines and FastISel failures.
Definition at line 62 of file SelectionDAGISel.h.
Referenced by runOnMachineFunction().
MachineRegisterInfo* llvm::SelectionDAGISel::RegInfo |
Definition at line 48 of file SelectionDAGISel.h.
Referenced by runOnMachineFunction().
std::unique_ptr<SelectionDAGBuilder> llvm::SelectionDAGISel::SDB |
Definition at line 50 of file SelectionDAGISel.h.
Referenced by runOnMachineFunction().
SwiftErrorValueTracking* llvm::SelectionDAGISel::SwiftError |
Definition at line 46 of file SelectionDAGISel.h.
Referenced by runOnMachineFunction(), and ~SelectionDAGISel().
const TargetInstrInfo* llvm::SelectionDAGISel::TII |
Definition at line 55 of file SelectionDAGISel.h.
Referenced by mayRaiseFPException(), runOnMachineFunction(), and SelectCodeCommon().
const TargetLowering* llvm::SelectionDAGISel::TLI |
Definition at line 56 of file SelectionDAGISel.h.
Referenced by llvm::createDefaultScheduler(), llvm::createHybridListDAGScheduler(), llvm::createILPListDAGScheduler(), getTargetLowering(), IsPredicateKnownToFail(), llvm::RISCVDAGToDAGISel::PreprocessISelDAG(), llvm::ResourcePriorityQueue::ResourcePriorityQueue(), runOnMachineFunction(), llvm::RISCVDAGToDAGISel::Select(), SelectCodeCommon(), and llvm::RISCVDAGToDAGISel::selectFPImm().
TargetMachine& llvm::SelectionDAGISel::TM |
Definition at line 43 of file SelectionDAGISel.h.
Referenced by llvm::createMipsSEISelDag(), llvm::OptLevelChanger::OptLevelChanger(), runOnMachineFunction(), llvm::RISCVDAGToDAGISel::Select(), and llvm::OptLevelChanger::~OptLevelChanger().