class LegalizerInfo

Declaration

class LegalizerInfo { /* full declaration omitted */ };

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:929

Method Overview

Methods

LegalizerInfo()

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:931

void aliasActionDefinitions(
    unsigned int OpcodeTo,
    unsigned int OpcodeFrom)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1130

Parameters

unsigned int OpcodeTo
unsigned int OpcodeFrom

void computeTables()

Description

Compute any ancillary tables needed to quickly decide how an operation should be handled. This must be called after all "set*Action"methods but before any query is made or incorrect results may be returned.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:940

static int
decreaseToSmallerTypesAndIncreaseToSmallest(
    const int& v,
    llvm::LegalizeActions::LegalizeAction
        DecreaseAction,
    llvm::LegalizeActions::LegalizeAction
        IncreaseAction)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1100

Parameters

const int& v
llvm::LegalizeActions::LegalizeAction DecreaseAction
llvm::LegalizeActions::LegalizeAction IncreaseAction

llvm::LegalizeActionStep getAction(
    const llvm::LegalityQuery& Query) const

Description

Determine what action should be taken to legalize the described instruction. Requires computeTables to have been called.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1136

Parameters

const llvm::LegalityQuery& Query

Returns

a description of the next legalization step to perform.

llvm::LegalizeActionStep getAction(
    const llvm::MachineInstr& MI,
    const llvm::MachineRegisterInfo& MRI) const

Description

Determine what action should be taken to legalize the given generic instruction.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1142

Parameters

const llvm::MachineInstr& MI
const llvm::MachineRegisterInfo& MRI

Returns

a description of the next legalization step to perform.

const llvm::LegalizeRuleSet& getActionDefinitions(
    unsigned int Opcode) const

Description

Get the action definitions for the given opcode. Use this to run a LegalityQuery through the definitions.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1106

Parameters

unsigned int Opcode

llvm::LegalizeRuleSet&
getActionDefinitionsBuilder(unsigned int Opcode)

Description

Get the action definition builder for the given opcode. Use this to define the action definitions. It is an error to request an opcode that has already been requested by the multiple-opcode variant.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1113

Parameters

unsigned int Opcode

llvm::LegalizeRuleSet&
getActionDefinitionsBuilder(
    std::initializer_list<unsigned int> Opcodes)

Description

Get the action definition builder for the given set of opcodes. Use this to define the action definitions for multiple opcodes at once. The first opcode given will be considered the representative opcode and will hold the definitions whereas the other opcodes will be configured to refer to the representative opcode. This lowers memory requirements and very slightly improves performance. It would be very easy to introduce unexpected side-effects as a result of this aliasing if it were permitted to request different but intersecting sets of opcodes but that is difficult to keep track of. It is therefore an error to request the same opcode twice using this API, to request an opcode that already has definitions, or to use the single-opcode API on an opcode that has already been requested by this API.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1129

Parameters

std::initializer_list<unsigned int> Opcodes

unsigned int getActionDefinitionsIdx(
    unsigned int Opcode) const

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:935

Parameters

unsigned int Opcode

virtual unsigned int
getExtOpcodeForWideningConstant(
    llvm::LLT SmallTy) const

Description

Return the opcode (SEXT/ZEXT/ANYEXT) that should be performed while widening a constant of type SmallTy which targets can override. For eg, the DAG does (SmallTy.isByteSized() ? G_SEXT : G_ZEXT) which will be the default.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1165

Parameters

llvm::LLT SmallTy

unsigned int getOpcodeIdxForOpcode(
    unsigned int Opcode) const

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:934

Parameters

unsigned int Opcode

static int
increaseToLargerTypesAndDecreaseToLargest(
    const int& v,
    llvm::LegalizeActions::LegalizeAction
        IncreaseAction,
    llvm::LegalizeActions::LegalizeAction
        DecreaseAction)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1095

Parameters

const int& v
llvm::LegalizeActions::LegalizeAction IncreaseAction
llvm::LegalizeActions::LegalizeAction DecreaseAction

bool isLegal(
    const llvm::LegalityQuery& Query) const

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1145

Parameters

const llvm::LegalityQuery& Query

bool isLegal(
    const llvm::MachineInstr& MI,
    const llvm::MachineRegisterInfo& MRI) const

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1148

Parameters

const llvm::MachineInstr& MI
const llvm::MachineRegisterInfo& MRI

bool isLegalOrCustom(
    const llvm::MachineInstr& MI,
    const llvm::MachineRegisterInfo& MRI) const

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1149

Parameters

const llvm::MachineInstr& MI
const llvm::MachineRegisterInfo& MRI

virtual bool legalizeCustom(
    llvm::MachineInstr& MI,
    llvm::MachineRegisterInfo& MRI,
    llvm::MachineIRBuilder& MIRBuilder,
    llvm::GISelChangeObserver& Observer) const

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1152

Parameters

llvm::MachineInstr& MI
llvm::MachineRegisterInfo& MRI
llvm::MachineIRBuilder& MIRBuilder
llvm::GISelChangeObserver& Observer

virtual bool legalizeIntrinsic(
    llvm::MachineInstr& MI,
    llvm::MachineRegisterInfo& MRI,
    llvm::MachineIRBuilder& MIRBuilder) const

Description

Return true if MI is either legal or has been legalized and false if not legal.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1158

Parameters

llvm::MachineInstr& MI
llvm::MachineRegisterInfo& MRI
llvm::MachineIRBuilder& MIRBuilder

static int moreToWiderTypesAndLessToWidest(
    const int& v)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1087

Parameters

const int& v

static int
narrowToSmallerAndUnsupportedIfTooSmall(
    const int& v)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1052

Parameters

const int& v

static int narrowToSmallerAndWidenToSmallest(
    const int& v)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1059

Parameters

const int& v

static bool needsLegalizingToDifferentSize(
    const llvm::LegalizeActions::LegalizeAction
        Action)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:946

Parameters

const llvm::LegalizeActions::LegalizeAction Action

void setAction(
    const llvm::InstrAspect& Aspect,
    llvm::LegalizeActions::LegalizeAction Action)

Description

More friendly way to set an action for common types that have an LLT representation. The LegalizeAction must be one for which NeedsLegalizingToDifferentSize returns false.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:969

Parameters

const llvm::InstrAspect& Aspect
llvm::LegalizeActions::LegalizeAction Action

void setLegalizeScalarToDifferentSizeStrategy(
    const unsigned int Opcode,
    const unsigned int TypeIdx,
    int S)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:994

Parameters

const unsigned int Opcode
const unsigned int TypeIdx
int S

void setLegalizeVectorElementToDifferentSizeStrategy(
    const unsigned int Opcode,
    const unsigned int TypeIdx,
    int S)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1005

Parameters

const unsigned int Opcode
const unsigned int TypeIdx
int S

static int unsupportedForDifferentSizes(
    const int& v)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1024

Parameters

const int& v

void verify(const llvm::MCInstrInfo& MII) const

Description

Perform simple self-diagnostic and assert if there is anything obviously wrong with the actions set up.

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:944

Parameters

const llvm::MCInstrInfo& MII

static int widenToLargerTypesAndNarrowToLargest(
    const int& v)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1035

Parameters

const int& v

static int widenToLargerTypesUnsupportedOtherwise(
    const int& v)

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:1045

Parameters

const int& v

virtual ~LegalizerInfo()

Declared at: llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h:932