|
LLVM 24.0.0git
|
Provides the logic to execute GlobalISel match tables, which are used by the instruction selector and instruction combiners as their engine to match and apply MIR patterns. More...
#include "llvm/CodeGen/GlobalISel/GIMatchTableExecutor.h"
Classes | |
| struct | ExecInfoTy |
| struct | MatcherState |
Public Member Functions | |
| virtual | ~GIMatchTableExecutor ()=default |
| virtual void | setupGeneratedPerFunctionState (MachineFunction &MF)=0 |
| virtual void | setupMF (MachineFunction &mf, GISelValueTracking *vt, CodeGenCoverage *covinfo=nullptr, ProfileSummaryInfo *psi=nullptr, BlockFrequencyInfo *bfi=nullptr) |
| Setup per-MF executor state. | |
Static Public Member Functions | |
| static LLVM_ATTRIBUTE_ALWAYS_INLINE uint64_t | fastDecodeULEB128 (const uint8_t *LLVM_ATTRIBUTE_RESTRICT MatchTable, uint64_t &CurrentIdx) |
Public Attributes | |
| CodeGenCoverage * | CoverageInfo = nullptr |
| GISelValueTracking * | VT = nullptr |
| MachineFunction * | MF = nullptr |
| ProfileSummaryInfo * | PSI = nullptr |
| BlockFrequencyInfo * | BFI = nullptr |
| MachineBasicBlock * | CurMBB = nullptr |
| unsigned | HwMode = 0 |
Protected Types | |
| using | ComplexRendererFns |
| using | RecordedMIVector = SmallVector<MachineInstr *, 4> |
| using | NewMIVector = SmallVector<MachineInstrBuilder, 4> |
Static Protected Member Functions | |
| template<typename Ty> | |
| static Ty | readBytesAs (const uint8_t *MatchTable) |
| static ArrayRef< MachineOperand > | getRemainingOperands (const MachineInstr &MI, unsigned FirstVarOp) |
Provides the logic to execute GlobalISel match tables, which are used by the instruction selector and instruction combiners as their engine to match and apply MIR patterns.
Definition at line 638 of file GIMatchTableExecutor.h.
|
protected |
Definition at line 671 of file GIMatchTableExecutor.h.
|
protected |
Definition at line 674 of file GIMatchTableExecutor.h.
|
protected |
Definition at line 673 of file GIMatchTableExecutor.h.
|
virtualdefault |
|
protecteddefault |
References CoverageInfo, LLVM_ABI, MRI, TII, and TRI.
|
protected |
Execute a given matcher table and return true if the match was successful and false otherwise.
Definition at line 44 of file GIMatchTableExecutorImpl.h.
References AbstractManglingParser< Derived, Alloc >::NumOps, llvm::MachineInstrBuilder::add(), assert(), llvm::canReplaceReg(), llvm::GISelChangeObserver::changedInstr(), llvm::GISelChangeObserver::changingAllUsesOfReg(), llvm::GISelChangeObserver::changingInstr(), llvm::GIMatchTableExecutor::ExecInfoTy< PredicateBitset, ComplexMatcherMemFn, CustomRendererFn >::ComplexPredicates, llvm::constrainOperandRegClass(), llvm::constrainSelectedInstRegOperands(), CoverageInfo, llvm::GIMatchTableExecutor::ExecInfoTy< PredicateBitset, ComplexMatcherMemFn, CustomRendererFn >::CustomRenderers, llvm::dbgs(), DEBUG_WITH_TYPE, llvm::Default, llvm::drop_begin(), E(), llvm::SmallVectorTemplateCommon< T, typename >::empty(), llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::end(), llvm::ConstantInt::equalsInt(), llvm::GISelChangeObserver::erasingInstr(), fastDecodeULEB128(), llvm::GIMatchTableExecutor::ExecInfoTy< PredicateBitset, ComplexMatcherMemFn, CustomRendererFn >::FeatureBitsets, llvm::DenseMapBase< StorageT, KeyT, ValueT, KeyInfoT, BucketT >::find(), llvm::GISelChangeObserver::finishedChangingAllUsesOfReg(), llvm::IntegerType::get(), llvm::MachineMemOperand::getAddrSpace(), llvm::MachineMemOperand::getAlign(), llvm::MachineOperand::getCImm(), llvm::getDefIgnoringCopies(), getFlags(), llvm::getFltSemanticForLLT(), llvm::MachineOperand::getImm(), llvm::MachineInstrBuilder::getInstr(), llvm::MachineOperand::getIntrinsicID(), getLLTForHwMode(), llvm::MachineInstr::getMF(), llvm::MachineOperand::getPredicate(), llvm::MachineOperand::getReg(), llvm::RegisterBankInfo::getRegBank(), llvm::RegisterBankInfo::getRegBankFromRegClass(), getRootFlagsToDrop(), llvm::MachineMemOperand::getSize(), llvm::LLT::getSizeInBits(), llvm::MachineMemOperand::getSizeInBits(), llvm::getSrcRegIgnoringCopies(), llvm::LocationSize::getValue(), llvm::GICXXCustomAction_Invalid, llvm::GICXXPred_Invalid, llvm::GIM_CheckAPFloatImmPredicate, llvm::GIM_CheckAPIntImmPredicate, llvm::GIM_CheckAtomicOrdering, llvm::GIM_CheckAtomicOrderingOrStrongerThan, llvm::GIM_CheckAtomicOrderingWeakerThan, llvm::GIM_CheckCanReplaceReg, llvm::GIM_CheckCmpPredicate, llvm::GIM_CheckComplexPattern, llvm::GIM_CheckConstantInt, llvm::GIM_CheckConstantInt8, llvm::GIM_CheckCxxInsnPredicate, llvm::GIM_CheckHasNoUse, llvm::GIM_CheckHasOneUse, llvm::GIM_CheckI64ImmPredicate, llvm::GIM_CheckImmOperandPredicate, llvm::GIM_CheckIntrinsicID, llvm::GIM_CheckIsBuildVectorAllOnes, llvm::GIM_CheckIsBuildVectorAllZeros, llvm::GIM_CheckIsImm, llvm::GIM_CheckIsMBB, llvm::GIM_CheckIsSafeToFold, llvm::GIM_CheckIsSameOperand, llvm::GIM_CheckIsSameOperandIgnoreCopies, llvm::GIM_CheckLeafOperandPredicate, llvm::GIM_CheckLiteralInt, llvm::GIM_CheckMemoryAddressSpace, llvm::GIM_CheckMemoryAlignment, llvm::GIM_CheckMemorySizeEqualTo, llvm::GIM_CheckMemorySizeEqualToLLT, llvm::GIM_CheckMemorySizeGreaterThanLLT, llvm::GIM_CheckMemorySizeLessThanLLT, llvm::GIM_CheckNumOperands, llvm::GIM_CheckNumOperandsGE, llvm::GIM_CheckNumOperandsLE, llvm::GIM_CheckOpcode, llvm::GIM_CheckOpcodeIsEither, llvm::GIM_CheckPointerToAny, llvm::GIM_CheckPointerToAnyByHwMode, llvm::GIM_CheckRegBankForClass, llvm::GIM_CheckSimplePredicate, llvm::GIM_CheckType, llvm::GIM_CheckTypeByHwMode, llvm::GIM_MIFlags, llvm::GIM_MIFlagsNot, llvm::GIM_RecordInsn, llvm::GIM_RecordInsnIgnoreCopies, llvm::GIM_RecordNamedOperand, llvm::GIM_RecordRegType, llvm::GIM_Reject, llvm::GIM_RootCheckRegBankForClass, llvm::GIM_RootCheckType, llvm::GIM_RootCheckTypeByHwMode, llvm::GIM_SwitchOpcode, llvm::GIM_SwitchType, llvm::GIM_SwitchTypeShape, llvm::GIM_Try, llvm::GIM_Try_CheckFeatures, llvm::GIR_AddCFPImm, llvm::GIR_AddCImm, llvm::GIR_AddImm, llvm::GIR_AddImm8, llvm::GIR_AddImplicitDef, llvm::GIR_AddImplicitUse, llvm::GIR_AddIntrinsicID, llvm::GIR_AddRegister, llvm::GIR_AddSimpleTempRegister, llvm::GIR_AddTempRegister, llvm::GIR_AddTempSubRegister, llvm::GIR_BuildConstant, llvm::GIR_BuildMI, llvm::GIR_BuildRootMI, llvm::GIR_ComplexRenderer, llvm::GIR_ComplexSubOperandRenderer, llvm::GIR_ComplexSubOperandSubRegRenderer, llvm::GIR_ConstrainOperandRC, llvm::GIR_ConstrainSelectedInstOperands, llvm::GIR_Copy, llvm::GIR_CopyConstantAsSImm, llvm::GIR_CopyFConstantAsFPImm, llvm::GIR_CopyMIFlags, llvm::GIR_CopyOrAddZeroReg, llvm::GIR_CopyRemaining, llvm::GIR_CopySubReg, llvm::GIR_Coverage, llvm::GIR_CustomOperandRenderer, llvm::GIR_CustomRenderer, llvm::GIR_Done, llvm::GIR_DoneWithCustomAction, llvm::GIR_EraseFromParent, llvm::GIR_EraseRootFromParent_Done, llvm::GIR_MakeTempReg, llvm::GIR_MakeTempRegByHwMode, llvm::GIR_MergeMemOperands, llvm::GIR_MutateOpcode, llvm::GIR_ReplaceReg, llvm::GIR_ReplaceRegWithTempReg, llvm::GIR_RootConstrainSelectedInstOperands, llvm::GIR_RootToRootCopy, llvm::GIR_SetImplicitDefDead, llvm::GIR_SetMIFlags, llvm::GIR_UnsetMIFlags, I, Imm, llvm::Implicit, llvm::isAtLeastOrStrongerThan(), llvm::isBuildVectorAllOnes(), llvm::isBuildVectorAllZeros(), llvm::MachineOperand::isCImm(), llvm::MachineOperand::isImm(), llvm::MachineOperand::isIntrinsicID(), llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownGE(), llvm::details::FixedOrScalableQuantity< TypeSize, uint64_t >::isKnownLE(), isObviouslySafeToFold(), isOperandImmEqual(), llvm::Register::isPhysical(), llvm::MachineOperand::isPredicate(), llvm::MachineOperand::isReg(), llvm::isStrongerThan(), llvm_unreachable, llvm::MachineInstr::mayRaiseFPException(), MF, MI, llvm::MinAlign(), MRI, llvm::MachineInstr::NoFPExcept, llvm::MachineInstr::operands(), llvm::SmallVectorImpl< T >::pop_back_val(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), readBytesAs(), llvm::SmallVectorImpl< T >::resize(), runCustomAction(), llvm::LLT::scalar(), llvm::MachineInstrBuilder::setMIFlags(), llvm::SignExtend64(), llvm::Size, llvm::SmallVectorTemplateCommon< T, typename >::size(), llvm::Success, testImmPredicate_APFloat(), testImmPredicate_APInt(), testImmPredicate_I64(), testMIPredicate_MI(), testMOPredicate_MO(), testSimplePredicate(), TII, TRI, llvm::GIMatchTableExecutor::ExecInfoTy< PredicateBitset, ComplexMatcherMemFn, CustomRendererFn >::TypeIDMap, llvm::GIMatchTableExecutor::ExecInfoTy< PredicateBitset, ComplexMatcherMemFn, CustomRendererFn >::TypeObjects, uint64_t, and V.
|
inlinestatic |
Definition at line 821 of file GIMatchTableExecutor.h.
References LLVM_ATTRIBUTE_RESTRICT, LLVM_UNLIKELY, and uint64_t.
Referenced by executeMatchTable().
|
inlineprotectedvirtual |
Definition at line 747 of file GIMatchTableExecutor.h.
References llvm_unreachable.
Referenced by executeMatchTable().
Definition at line 743 of file GIMatchTableExecutor.h.
References llvm_unreachable.
|
inlinestaticprotected |
Definition at line 808 of file GIMatchTableExecutor.h.
References llvm::drop_begin(), MI, and Operands.
|
inlineprotectedvirtual |
Definition at line 784 of file GIMatchTableExecutor.h.
Referenced by executeMatchTable().
|
protected |
Return true if the specified operand is a G_PTR_ADD with a G_CONSTANT on the right-hand side.
GlobalISel's separation of pointer and integer types means that we don't need to worry about G_OR with equivalent semantics.
Definition at line 47 of file GIMatchTableExecutor.cpp.
References llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), llvm::MIPatternMatch::m_GConstant(), llvm::MIPatternMatch::m_GPtrAdd(), llvm::MIPatternMatch::m_Reg(), llvm::MIPatternMatch::mi_match(), and MRI.
|
protected |
Return true if MI can obviously be folded into IntoMI.
MI and IntoMI do not need to be in the same basic blocks, but MI must preceed IntoMI.
Definition at line 56 of file GIMatchTableExecutor.cpp.
References llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::MachineInstr::getParent(), llvm::instructionsWithoutDebug(), and MI.
Referenced by executeMatchTable().
|
protected |
Definition at line 31 of file GIMatchTableExecutor.cpp.
References llvm::getIConstantSplatVal(), llvm::getIConstantVRegValWithLookThrough(), llvm::MachineOperand::getReg(), llvm::MachineOperand::isReg(), MRI, and llvm::Splat.
Referenced by executeMatchTable().
|
inlinestaticprotected |
Definition at line 802 of file GIMatchTableExecutor.h.
Referenced by executeMatchTable().
|
inlineprotectedvirtual |
Definition at line 779 of file GIMatchTableExecutor.h.
References llvm_unreachable.
Referenced by executeMatchTable().
|
pure virtual |
|
inlinevirtual |
Setup per-MF executor state.
Reimplemented in llvm::AMDGPUInstructionSelector.
Definition at line 656 of file GIMatchTableExecutor.h.
References BFI, CoverageInfo, CurMBB, llvm::MCSubtargetInfo::getHwMode(), llvm::MachineFunction::getSubtarget(), HwMode, MF, PSI, setupGeneratedPerFunctionState(), and VT.
Referenced by llvm::Combiner::combineMachineInstrs(), and llvm::AMDGPUInstructionSelector::setupMF().
|
inlineprotected |
Definition at line 693 of file GIMatchTableExecutor.h.
References BFI, CurMBB, F, MF, PSI, and llvm::shouldOptimizeForSize().
|
inlineprotectedvirtual |
Definition at line 759 of file GIMatchTableExecutor.h.
References llvm_unreachable.
Referenced by executeMatchTable().
|
inlineprotectedvirtual |
Definition at line 755 of file GIMatchTableExecutor.h.
References llvm_unreachable.
Referenced by executeMatchTable().
|
inlineprotectedvirtual |
Definition at line 751 of file GIMatchTableExecutor.h.
References llvm_unreachable.
Referenced by executeMatchTable().
|
inlineprotectedvirtual |
Definition at line 763 of file GIMatchTableExecutor.h.
References llvm_unreachable.
Referenced by executeMatchTable().
|
inlineprotectedvirtual |
Definition at line 769 of file GIMatchTableExecutor.h.
References llvm_unreachable.
Referenced by executeMatchTable().
|
inlineprotectedvirtual |
Definition at line 775 of file GIMatchTableExecutor.h.
References llvm_unreachable.
Referenced by executeMatchTable().
| BlockFrequencyInfo* llvm::GIMatchTableExecutor::BFI = nullptr |
Definition at line 646 of file GIMatchTableExecutor.h.
Referenced by llvm::AMDGPUInstructionSelector::getName(), llvm::AMDGPUInstructionSelector::setupMF(), setupMF(), and shouldOptForSize().
| CodeGenCoverage* llvm::GIMatchTableExecutor::CoverageInfo = nullptr |
Definition at line 642 of file GIMatchTableExecutor.h.
Referenced by executeMatchTable(), llvm::AMDGPUInstructionSelector::getName(), GIMatchTableExecutor(), llvm::AMDGPUInstructionSelector::select(), llvm::AMDGPUInstructionSelector::setupMF(), and setupMF().
| MachineBasicBlock* llvm::GIMatchTableExecutor::CurMBB = nullptr |
Definition at line 648 of file GIMatchTableExecutor.h.
Referenced by setupMF(), and shouldOptForSize().
| unsigned llvm::GIMatchTableExecutor::HwMode = 0 |
Definition at line 651 of file GIMatchTableExecutor.h.
Referenced by setupMF().
| MachineFunction* llvm::GIMatchTableExecutor::MF = nullptr |
Definition at line 644 of file GIMatchTableExecutor.h.
Referenced by executeMatchTable(), llvm::AMDGPUInstructionSelector::getName(), setupGeneratedPerFunctionState(), llvm::AMDGPUInstructionSelector::setupMF(), setupMF(), and shouldOptForSize().
| ProfileSummaryInfo* llvm::GIMatchTableExecutor::PSI = nullptr |
Definition at line 645 of file GIMatchTableExecutor.h.
Referenced by llvm::AMDGPUInstructionSelector::getName(), llvm::AMDGPUInstructionSelector::setupMF(), setupMF(), and shouldOptForSize().
| GISelValueTracking* llvm::GIMatchTableExecutor::VT = nullptr |
Definition at line 643 of file GIMatchTableExecutor.h.
Referenced by llvm::AMDGPUInstructionSelector::getName(), llvm::AMDGPUInstructionSelector::setupMF(), and setupMF().