class LegalizerInfo

Declaration

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

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

Member Variables

private llvm::LegalizeRuleSet[202] RulesForOpcode
private llvm::LegacyLegalizerInfo LegacyInfo
private static const int FirstOp = TargetOpcode::PRE_ISEL_GENERIC_OPCODE_START
private static const int LastOp = TargetOpcode::PRE_ISEL_GENERIC_OPCODE_END

Method Overview

Methods

void aliasActionDefinitions(
    unsigned int OpcodeTo,
    unsigned int OpcodeFrom)

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

Parameters

unsigned int OpcodeTo
unsigned int OpcodeFrom

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:1234

Parameters

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

Returns

a description of the next legalization step to perform.

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:1228

Parameters

const llvm::LegalityQuery& Query

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:1198

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:1221

Parameters

std::initializer_list<unsigned int> Opcodes

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:1205

Parameters

unsigned int Opcode

unsigned int getActionDefinitionsIdx(
    unsigned int Opcode) const

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

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:1269

Parameters

llvm::LLT SmallTy

llvm::LegacyLegalizerInfo&
getLegacyLegalizerInfo()

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

const llvm::LegacyLegalizerInfo&
getLegacyLegalizerInfo() const

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

unsigned int getOpcodeIdxForOpcode(
    unsigned int Opcode) const

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

Parameters

unsigned int Opcode

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

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

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:1246

Parameters

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

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

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

Parameters

const llvm::LegalityQuery& Query

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

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

Parameters

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

virtual bool legalizeCustom(
    llvm::LegalizerHelper& Helper,
    llvm::MachineInstr& MI) const

Description

Called for instructions with the Custom LegalizationAction.

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

Parameters

llvm::LegalizerHelper& Helper
llvm::MachineInstr& MI

virtual bool legalizeIntrinsic(
    llvm::LegalizerHelper& Helper,
    llvm::MachineInstr& MI) const

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

Parameters

llvm::LegalizerHelper& Helper
llvm::MachineInstr& MI

Returns

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

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:1194

Parameters

const llvm::MCInstrInfo& MII

virtual ~LegalizerInfo()

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