LLVM 19.0.0git
Classes | Public Member Functions | Static Public Member Functions | List of all members
llvm::AMDGPUInstructionSelector Class Referencefinal

#include "Target/AMDGPU/AMDGPUInstructionSelector.h"

Inheritance diagram for llvm::AMDGPUInstructionSelector:
Inheritance graph
[legend]

Public Member Functions

 AMDGPUInstructionSelector (const GCNSubtarget &STI, const AMDGPURegisterBankInfo &RBI, const AMDGPUTargetMachine &TM)
 
bool select (MachineInstr &I) override
 Select the (possibly generic) instruction I to only use target-specific opcodes.
 
void setupMF (MachineFunction &MF, GISelKnownBits *KB, CodeGenCoverage *CoverageInfo, ProfileSummaryInfo *PSI, BlockFrequencyInfo *BFI) override
 Setup per-MF executor state.
 
- Public Member Functions inherited from llvm::InstructionSelector
virtual ~InstructionSelector ()
 
virtual bool select (MachineInstr &I)=0
 Select the (possibly generic) instruction I to only use target-specific opcodes.
 
void setTargetPassConfig (const TargetPassConfig *T)
 
void setRemarkEmitter (MachineOptimizationRemarkEmitter *M)
 
- Public Member Functions inherited from llvm::GIMatchTableExecutor
virtual ~GIMatchTableExecutor ()=default
 
virtual void setupGeneratedPerFunctionState (MachineFunction &MF)=0
 
virtual void setupMF (MachineFunction &mf, GISelKnownBits *kb, CodeGenCoverage *covinfo=nullptr, ProfileSummaryInfo *psi=nullptr, BlockFrequencyInfo *bfi=nullptr)
 Setup per-MF executor state.
 

Static Public Member Functions

static const chargetName ()
 

Additional Inherited Members

- Public Attributes inherited from llvm::GIMatchTableExecutor
CodeGenCoverageCoverageInfo = nullptr
 
GISelKnownBitsKB = nullptr
 
MachineFunctionMF = nullptr
 
ProfileSummaryInfoPSI = nullptr
 
BlockFrequencyInfoBFI = nullptr
 
MachineBasicBlockCurMBB = nullptr
 
- Protected Types inherited from llvm::GIMatchTableExecutor
using ComplexRendererFns = std::optional< SmallVector< std::function< void(MachineInstrBuilder &)>, 4 > >
 
using RecordedMIVector = SmallVector< MachineInstr *, 4 >
 
using NewMIVector = SmallVector< MachineInstrBuilder, 4 >
 
- Protected Member Functions inherited from llvm::GIMatchTableExecutor
bool shouldOptForSize (const MachineFunction *MF) const
 
 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_t * getMatchTable () 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 testSimplePredicate (unsigned) const
 
virtual void runCustomAction (unsigned, const MatcherState &State, NewMIVector &OutMIs) const
 
bool isOperandImmEqual (const MachineOperand &MO, int64_t Value, const MachineRegisterInfo &MRI, bool Splat=false) const
 
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.
 
bool isObviouslySafeToFold (MachineInstr &MI, MachineInstr &IntoMI) const
 Return true if MI can obviously be folded into IntoMI.
 
- Static Protected Member Functions inherited from llvm::GIMatchTableExecutor
template<typename Ty >
static Ty readBytesAs (const uint8_t *MatchTable)
 
- Protected Attributes inherited from llvm::InstructionSelector
const TargetPassConfigTPC = nullptr
 
MachineOptimizationRemarkEmitterMORE = nullptr
 

Detailed Description

Definition at line 48 of file AMDGPUInstructionSelector.h.

Constructor & Destructor Documentation

◆ AMDGPUInstructionSelector()

AMDGPUInstructionSelector::AMDGPUInstructionSelector ( const GCNSubtarget STI,
const AMDGPURegisterBankInfo RBI,
const AMDGPUTargetMachine TM 
)

Definition at line 43 of file AMDGPUInstructionSelector.cpp.

Member Function Documentation

◆ getName()

static const char * llvm::AMDGPUInstructionSelector::getName ( )
static

◆ select()

bool AMDGPUInstructionSelector::select ( MachineInstr I)
overridevirtual

Select the (possibly generic) instruction I to only use target-specific opcodes.

It is OK to insert multiple instructions, but they cannot be generic pre-isel instructions.

Returns
whether selection succeeded.
Precondition
I.getParent() && I.getParent()->getParent()
Postcondition
if returns true: for I in all mutated/inserted instructions: !isPreISelGenericOpcode(I.getOpcode())

Implements llvm::InstructionSelector.

Definition at line 3515 of file AMDGPUInstructionSelector.cpp.

References assert(), llvm::GIMatchTableExecutor::CoverageInfo, llvm::AMDGPU::getImageDimIntrinsicInfo(), llvm::AMDGPU::getIntrinsicID(), I, Intr, MRI, and llvm::LLT::scalar().

◆ setupMF()

void AMDGPUInstructionSelector::setupMF ( MachineFunction mf,
GISelKnownBits kb,
CodeGenCoverage covinfo,
ProfileSummaryInfo psi,
BlockFrequencyInfo bfi 
)
overridevirtual

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