llvm::InstructionSelector

Selects (possibly generic) machine instructions to target-specific opcodes.

Synopsis

Declared in <llvm/CodeGen/GlobalISel/InstructionSelector.h>

class InstructionSelector
    : public GIMatchTableExecutor

Base Classes

NameDescription
GIMatchTableExecutorExecutes GlobalISel match tables for instruction selection and combining.

Types

NameDescription
ExecInfoTy Tables and maps used while interpreting a target match table.

Member Functions

NameDescription
~InstructionSelector [destructor] [virtual]Destroy this instruction selector.
select [virtual]Select instruction I to use only target-specific opcodes.
setupGeneratedPerFunctionState [virtual]Set up target-generated per-function state for MF.
setupMF [virtual]Setup per-MF executor state.

Static Member Functions

NameDescription
fastDecodeULEB128 Decode a ULEB128 value from MatchTable at CurrentIdx.

Data Members

NameDescription
AllObservers Note: InstructionSelect does not track changed instructions. changingInstr() and changedInstr() will never be called on these observers.
BFI Optional block frequency info for size-optimization decisions.
CoverageInfo Optional rule coverage tracking for matched patterns.
CurMBB Basic block currently being matched, when needed by predicates.
MF Machine function currently being processed.
MORE Remark emitter used to report instruction selection diagnostics.
PSI Optional profile summary info for size-optimization decisions.
VT Optional value tracking analysis for the current function.

Protected Types

NameDescription
MatcherState Mutable state shared across match-table opcode handlers.

Protected Type Aliases

NameDescription
ComplexRendererFns Optional list of complex-pattern operand renderer callbacks.
NewMIVector Small vector of newly built machine instructions.
RecordedMIVector Small vector of recorded machine instructions from the match.

Protected Member Functions

NameDescription
executeMatchTable Execute a given matcher table and return true if the match was successful and false otherwise.
getMatchTable [virtual]Return the match table used by this executor.
isBaseWithConstantOffset Return true if the operand is a G_PTR_ADD with a G_CONSTANT RHS.
isObviouslySafeToFold Return true if MI can obviously be folded into IntoMI.
isOperandImmEqual Return true if MO equals immediate Value (or a splat of it).
renderFrameIndex Render a G_FRAME_INDEX operand into MIB.
runCustomAction [virtual]Run a custom match-table action and optionally emit new instructions.
shouldOptForSize Return true if the current function or block should be optimized for size.
testImmPredicate_APFloat [virtual]Test an APFloat immediate predicate against Imm.
testImmPredicate_APInt [virtual]Test an APInt immediate predicate against Imm.
testImmPredicate_I64 [virtual]Test an I64 immediate predicate against Imm.
testMIPredicate_MI [virtual]Test a C++ machine-instruction predicate on MI.
testMOPredicate_MO [virtual]Test a C++ machine-operand predicate on MO.
testSimplePredicate [virtual]Test a simple predicate that takes no match-table arguments.

Protected Static Member Functions

NameDescription
getRemainingOperands Return the operands of MI starting at index FirstVarOp.
readBytesAs Read a value of type Ty from the start of MatchTable.