LLVM 24.0.0git
llvm::Combiner Class Referenceabstract

Combiner implementation. More...

#include "llvm/CodeGen/GlobalISel/Combiner.h"

Inheritance diagram for llvm::Combiner:
[legend]

Classes

class  WorkListMaintainer
 This class acts as the glue that joins the CombinerHelper to the overall Combine algorithm. More...

Public Member Functions

 Combiner (MachineFunction &MF, const CombinerInfo &CInfo, GISelValueTracking *VT, GISelCSEInfo *CSEInfo=nullptr)
 If CSEInfo is not null, then the Combiner will use CSEInfo as the observer and also create a CSEMIRBuilder.
 ~Combiner () override
virtual bool tryCombineAll (MachineInstr &I) const =0
bool combineMachineInstrs ()
Public Member Functions inherited from llvm::GIMatchTableExecutor
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.

Protected Member Functions

virtual bool canMatchOpcode (unsigned Opc) const
Protected Member Functions inherited from llvm::GIMatchTableExecutor
bool shouldOptForSize (const MachineFunction *MF) const
LLVM_ABI GIMatchTableExecutor ()
template<class TgtExecutor, class PredicateBitset, class ComplexMatcherMemFn, class CustomRendererFn>
bool executeMatchTable (TgtExecutor &Exec, MatcherState &State, const ExecInfoTy< PredicateBitset, ComplexMatcherMemFn, CustomRendererFn > &ExecInfo, MachineIRBuilder &Builder, const uint8_t *MatchTable, const TargetInstrInfo &TII, MachineRegisterInfo &MRI, const TargetRegisterInfo &TRI, const RegisterBankInfo &RBI, const PredicateBitset &AvailableFeatures, CodeGenCoverage *CoverageInfo) const
 Execute a given matcher table and return true if the match was successful and false otherwise.
virtual const uint8_tgetMatchTable () const
virtual bool testImmPredicate_I64 (unsigned, int64_t) const
virtual bool testImmPredicate_APInt (unsigned, const APInt &) const
virtual bool testImmPredicate_APFloat (unsigned, const APFloat &) const
virtual bool testMIPredicate_MI (unsigned, const MachineInstr &, const MatcherState &State) const
virtual bool testMOPredicate_MO (unsigned, const MachineOperand &, const MatcherState &State) const
virtual bool testSimplePredicate (unsigned) const
virtual bool runCustomAction (unsigned, const MatcherState &State, NewMIVector &OutMIs) const
LLVM_ABI bool isOperandImmEqual (const MachineOperand &MO, int64_t Value, const MachineRegisterInfo &MRI, bool Splat=false) const
LLVM_ABI bool isBaseWithConstantOffset (const MachineOperand &Root, const MachineRegisterInfo &MRI) const
 Return true if the specified operand is a G_PTR_ADD with a G_CONSTANT on the right-hand side.
LLVM_ABI bool isObviouslySafeToFold (MachineInstr &MI, MachineInstr &IntoMI) const
 Return true if MI can obviously be folded into IntoMI.

Protected Attributes

const CombinerInfoCInfo
GISelChangeObserverObserver
MachineIRBuilderB
MachineFunctionMF
MachineRegisterInfoMRI
GISelValueTrackingVT
GISelCSEInfoCSEInfo

Additional Inherited Members

Static Public Member Functions inherited from llvm::GIMatchTableExecutor
static LLVM_ATTRIBUTE_ALWAYS_INLINE uint64_t fastDecodeULEB128 (const uint8_t *LLVM_ATTRIBUTE_RESTRICT MatchTable, uint64_t &CurrentIdx)
Public Attributes inherited from llvm::GIMatchTableExecutor
CodeGenCoverageCoverageInfo = nullptr
GISelValueTrackingVT = nullptr
MachineFunctionMF = nullptr
ProfileSummaryInfoPSI = nullptr
BlockFrequencyInfoBFI = nullptr
MachineBasicBlockCurMBB = nullptr
Protected Types inherited from llvm::GIMatchTableExecutor
using ComplexRendererFns
using RecordedMIVector = SmallVector<MachineInstr *, 4>
using NewMIVector = SmallVector<MachineInstrBuilder, 4>
Static Protected Member Functions inherited from llvm::GIMatchTableExecutor
template<typename Ty>
static Ty readBytesAs (const uint8_t *MatchTable)
static ArrayRef< MachineOperandgetRemainingOperands (const MachineInstr &MI, unsigned FirstVarOp)

Detailed Description

Combiner implementation.

This is per-function, so passes need to recreate one of these each time they enter a new function.

TODO: Is it worth making this module-wide?

Definition at line 33 of file Combiner.h.

Constructor & Destructor Documentation

◆ Combiner()

Combiner::Combiner ( MachineFunction & MF,
const CombinerInfo & CInfo,
GISelValueTracking * VT,
GISelCSEInfo * CSEInfo = nullptr )

If CSEInfo is not null, then the Combiner will use CSEInfo as the observer and also create a CSEMIRBuilder.

Pass nullptr if CSE is not needed.

Definition at line 224 of file Combiner.cpp.

References B, CInfo, CSEInfo, MF, MRI, Observer, and VT.

◆ ~Combiner()

Combiner::~Combiner ( )
overridedefault

Member Function Documentation

◆ canMatchOpcode()

virtual bool llvm::Combiner::canMatchOpcode ( unsigned Opc) const
inlineprotectedvirtual

Definition at line 68 of file Combiner.h.

References Opc.

Referenced by combineMachineInstrs().

◆ combineMachineInstrs()

◆ tryCombineAll()

virtual bool llvm::Combiner::tryCombineAll ( MachineInstr & I) const
pure virtual

References combineMachineInstrs(), and I.

Referenced by combineMachineInstrs().

Member Data Documentation

◆ B

MachineIRBuilder& llvm::Combiner::B
protected

Definition at line 72 of file Combiner.h.

Referenced by Combiner().

◆ CInfo

const CombinerInfo& llvm::Combiner::CInfo
protected

Definition at line 70 of file Combiner.h.

Referenced by combineMachineInstrs(), and Combiner().

◆ CSEInfo

GISelCSEInfo* llvm::Combiner::CSEInfo
protected

Definition at line 77 of file Combiner.h.

Referenced by combineMachineInstrs(), and Combiner().

◆ MF

MachineFunction& llvm::Combiner::MF
protected

Definition at line 73 of file Combiner.h.

Referenced by combineMachineInstrs(), and Combiner().

◆ MRI

MachineRegisterInfo& llvm::Combiner::MRI
protected

◆ Observer

GISelChangeObserver& llvm::Combiner::Observer
protected

Definition at line 71 of file Combiner.h.

Referenced by Combiner().

◆ VT

GISelValueTracking* llvm::Combiner::VT
protected

Definition at line 75 of file Combiner.h.

Referenced by combineMachineInstrs(), and Combiner().


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