class LegalizeRuleSet

Declaration

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

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

Member Variables

private unsigned int AliasOf = 0
When non-zero, the opcode we are an alias of
private bool IsAliasedByAnother = false
If true, there is another opcode that aliases this one
private SmallVector<llvm::LegalizeRule, 2> Rules
private llvm::SmallBitVector TypeIdxsCovered = {MCOI::OPERAND_LAST_GENERIC - MCOI::OPERAND_FIRST_GENERIC + 2}
If bit I is set, this rule set contains a rule that may handle (predicate or perform an action upon (or both)) the type index I. The uncertainty comes from free-form rules executing user-provided lambda functions. We conservatively assume such rules do the right thing and cover all type indices. The bitset is intentionally 1 bit wider than it absolutely needs to be to distinguish such cases from the cases where all type indices are individually handled.
private llvm::SmallBitVector ImmIdxsCovered = {MCOI::OPERAND_LAST_GENERIC_IMM - MCOI::OPERAND_FIRST_GENERIC_IMM + 2}

Method Overview

  • public LegalizeRuleSet()
  • private llvm::LegalizeRuleSet & actionFor(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<LLT> Types)
  • private llvm::LegalizeRuleSet & actionFor(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<LLT> Types, llvm::LegalizeMutation Mutation)
  • private llvm::LegalizeRuleSet & actionFor(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<std::pair<LLT, LLT>> Types)
  • private llvm::LegalizeRuleSet & actionFor(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<std::pair<LLT, LLT>> Types, llvm::LegalizeMutation Mutation)
  • private llvm::LegalizeRuleSet & actionForCartesianProduct(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1, std::initializer_list<LLT> Types2)
  • private llvm::LegalizeRuleSet & actionForCartesianProduct(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<LLT> Types)
  • private llvm::LegalizeRuleSet & actionForCartesianProduct(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1)
  • private llvm::LegalizeRuleSet & actionForTypeWithAnyImm(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<LLT> Types)
  • private llvm::LegalizeRuleSet & actionForTypeWithAnyImm(llvm::LegalizeActions::LegalizeAction Action, std::initializer_list<std::pair<LLT, LLT>> Types)
  • private llvm::LegalizeRuleSet & actionIf(llvm::LegalizeActions::LegalizeAction Action, llvm::LegalityPredicate Predicate)
  • private llvm::LegalizeRuleSet & actionIf(llvm::LegalizeActions::LegalizeAction Action, llvm::LegalityPredicate Predicate, llvm::LegalizeMutation Mutation)
  • private void add(const llvm::LegalizeRule & Rule)
  • public void aliasTo(unsigned int Opcode)
  • public llvm::LegalizeRuleSet & alignNumElementsTo(unsigned int TypeIdx, const llvm::LLT EltTy, unsigned int NumElts)
  • private static bool always(const llvm::LegalityQuery &)
  • public llvm::LegalizeRuleSet & alwaysLegal()
  • public llvm::LegalizeActionStep apply(const llvm::LegalityQuery & Query) const
  • public llvm::LegalizeRuleSet & bitcastIf(llvm::LegalityPredicate Predicate, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & clampMaxNumElements(unsigned int TypeIdx, const llvm::LLT EltTy, unsigned int MaxElements)
  • public llvm::LegalizeRuleSet & clampMaxNumElementsStrict(unsigned int TypeIdx, const llvm::LLT EltTy, unsigned int NumElts)
  • public llvm::LegalizeRuleSet & clampMinNumElements(unsigned int TypeIdx, const llvm::LLT EltTy, unsigned int MinElements)
  • public llvm::LegalizeRuleSet & clampNumElements(unsigned int TypeIdx, const llvm::LLT MinTy, const llvm::LLT MaxTy)
  • public llvm::LegalizeRuleSet & clampScalar(unsigned int TypeIdx, const llvm::LLT MinTy, const llvm::LLT MaxTy)
  • public llvm::LegalizeRuleSet & clampScalarOrElt(unsigned int TypeIdx, const llvm::LLT MinTy, const llvm::LLT MaxTy)
  • public llvm::LegalizeRuleSet & custom()
  • public llvm::LegalizeRuleSet & customFor(std::initializer_list<std::pair<LLT, LLT>> Types)
  • public llvm::LegalizeRuleSet & customFor(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & customForCartesianProduct(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & customForCartesianProduct(std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1)
  • public llvm::LegalizeRuleSet & customForCartesianProduct(std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1, std::initializer_list<LLT> Types2)
  • public llvm::LegalizeRuleSet & customIf(llvm::LegalityPredicate Predicate)
  • public llvm::LegalizeRuleSet & fallback()
  • public llvm::LegalizeRuleSet & fewerElementsIf(llvm::LegalityPredicate Predicate, llvm::LegalizeMutation Mutation)
  • public unsigned int getAlias() const
  • public unsigned int immIdx(unsigned int ImmIdx)
  • public bool isAliasedByAnother()
  • public llvm::LegalizeRuleSet & legalFor(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & legalFor(std::initializer_list<std::pair<LLT, LLT>> Types)
  • public llvm::LegalizeRuleSet & legalForCartesianProduct(std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1, std::initializer_list<LLT> Types2)
  • public llvm::LegalizeRuleSet & legalForCartesianProduct(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & legalForCartesianProduct(std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1)
  • public llvm::LegalizeRuleSet & legalForTypeWithAnyImm(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & legalForTypeWithAnyImm(std::initializer_list<std::pair<LLT, LLT>> Types)
  • public llvm::LegalizeRuleSet & legalForTypesWithMemDesc(std::initializer_list<LegalityPredicates::TypePairAndMemDesc> TypesAndMemDesc)
  • public llvm::LegalizeRuleSet & legalIf(llvm::LegalityPredicate Predicate)
  • public llvm::LegalizeRuleSet & libcall()
  • public llvm::LegalizeRuleSet & libcallFor(std::initializer_list<std::pair<LLT, LLT>> Types)
  • public llvm::LegalizeRuleSet & libcallFor(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & libcallForCartesianProduct(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & libcallForCartesianProduct(std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1)
  • public llvm::LegalizeRuleSet & libcallIf(llvm::LegalityPredicate Predicate)
  • public llvm::LegalizeRuleSet & lower()
  • public llvm::LegalizeRuleSet & lowerFor(std::initializer_list<std::pair<LLT, LLT>> Types, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & lowerFor(std::initializer_list<std::pair<LLT, LLT>> Types)
  • public llvm::LegalizeRuleSet & lowerFor(std::initializer_list<LLT> Types, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & lowerFor(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & lowerForCartesianProduct(std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1, std::initializer_list<LLT> Types2)
  • public llvm::LegalizeRuleSet & lowerForCartesianProduct(std::initializer_list<LLT> Types0, std::initializer_list<LLT> Types1)
  • public llvm::LegalizeRuleSet & lowerIf(llvm::LegalityPredicate Predicate, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & lowerIf(llvm::LegalityPredicate Predicate)
  • public llvm::LegalizeRuleSet & lowerIfMemSizeNotByteSizePow2()
  • public llvm::LegalizeRuleSet & lowerIfMemSizeNotPow2()
  • private void markAllIdxsAsCovered()
  • public llvm::LegalizeRuleSet & maxScalar(unsigned int TypeIdx, const llvm::LLT Ty)
  • public llvm::LegalizeRuleSet & maxScalarEltSameAsIf(llvm::LegalityPredicate Predicate, unsigned int TypeIdx, unsigned int SmallTypeIdx)
  • public llvm::LegalizeRuleSet & maxScalarIf(llvm::LegalityPredicate Predicate, unsigned int TypeIdx, const llvm::LLT Ty)
  • public llvm::LegalizeRuleSet & maxScalarOrElt(unsigned int TypeIdx, const llvm::LLT Ty)
  • public llvm::LegalizeRuleSet & maxScalarSameAs(unsigned int TypeIdx, unsigned int NarrowTypeIdx)
  • public llvm::LegalizeRuleSet & minScalar(unsigned int TypeIdx, const llvm::LLT Ty)
  • public llvm::LegalizeRuleSet & minScalarEltSameAsIf(llvm::LegalityPredicate Predicate, unsigned int TypeIdx, unsigned int LargeTypeIdx)
  • public llvm::LegalizeRuleSet & minScalarOrElt(unsigned int TypeIdx, const llvm::LLT Ty)
  • public llvm::LegalizeRuleSet & minScalarOrEltIf(llvm::LegalityPredicate Predicate, unsigned int TypeIdx, const llvm::LLT Ty)
  • public llvm::LegalizeRuleSet & minScalarSameAs(unsigned int TypeIdx, unsigned int LargeTypeIdx)
  • public llvm::LegalizeRuleSet & moreElementsIf(llvm::LegalityPredicate Predicate, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & moreElementsToNextPow2(unsigned int TypeIdx)
  • public llvm::LegalizeRuleSet & narrowScalar(unsigned int TypeIdx, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & narrowScalarFor(std::initializer_list<std::pair<LLT, LLT>> Types, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & narrowScalarIf(llvm::LegalityPredicate Predicate, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & scalarSameSizeAs(unsigned int TypeIdx, unsigned int SameSizeIdx)
  • public llvm::LegalizeRuleSet & scalarize(unsigned int TypeIdx)
  • public llvm::LegalizeRuleSet & scalarizeIf(llvm::LegalityPredicate Predicate, unsigned int TypeIdx)
  • public void setIsAliasedByAnother()
  • private unsigned int typeIdx(unsigned int TypeIdx)
  • public llvm::LegalizeRuleSet & unsupported()
  • public llvm::LegalizeRuleSet & unsupportedFor(std::initializer_list<LLT> Types)
  • public llvm::LegalizeRuleSet & unsupportedIf(llvm::LegalityPredicate Predicate)
  • public llvm::LegalizeRuleSet & unsupportedIfMemSizeNotPow2()
  • public bool verifyImmIdxsCoverage(unsigned int NumImmIdxs) const
  • public bool verifyTypeIdxsCoverage(unsigned int NumTypeIdxs) const
  • public llvm::LegalizeRuleSet & widenScalarIf(llvm::LegalityPredicate Predicate, llvm::LegalizeMutation Mutation)
  • public llvm::LegalizeRuleSet & widenScalarOrEltToNextPow2(unsigned int TypeIdx, unsigned int MinSize = 0)
  • public llvm::LegalizeRuleSet & widenScalarToNextMultipleOf(unsigned int TypeIdx, unsigned int Size)
  • public llvm::LegalizeRuleSet & widenScalarToNextPow2(unsigned int TypeIdx, unsigned int MinSize = 0)

Methods

LegalizeRuleSet()

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

llvm::LegalizeRuleSet& actionFor(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<LLT> Types)

Description

Use the given action when type index 0 is any type in the given list. Action should not be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& actionFor(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<LLT> Types,
    llvm::LegalizeMutation Mutation)

Description

Use the given action when type index 0 is any type in the given list. Action should be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<LLT> Types
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& actionFor(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<std::pair<LLT, LLT>>
        Types)

Description

Use the given action when type indexes 0 and 1 is any type pair in the given list. Action should not be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<std::pair<LLT, LLT>> Types

llvm::LegalizeRuleSet& actionFor(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<std::pair<LLT, LLT>>
        Types,
    llvm::LegalizeMutation Mutation)

Description

Use the given action when type indexes 0 and 1 is any type pair in the given list. Action should be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<std::pair<LLT, LLT>> Types
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& actionForCartesianProduct(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1,
    std::initializer_list<LLT> Types2)

Description

Use the given action when type indexes 0, 1, and 2 are all in their respective lists. That is, the type triple is in the cartesian product of the lists Action should not be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1
std::initializer_list<LLT> Types2

llvm::LegalizeRuleSet& actionForCartesianProduct(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<LLT> Types)

Description

Use the given action when type indexes 0 and 1 are both in the given list. That is, the type pair is in the cartesian product of the list. Action should not be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& actionForCartesianProduct(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1)

Description

Use the given action when type indexes 0 and 1 are both in their respective lists. That is, the type pair is in the cartesian product of the lists Action should not be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1

llvm::LegalizeRuleSet& actionForTypeWithAnyImm(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<LLT> Types)

Description

Use the given action when type index 0 is any type in the given list and imm index 0 is anything. Action should not be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& actionForTypeWithAnyImm(
    llvm::LegalizeActions::LegalizeAction Action,
    std::initializer_list<std::pair<LLT, LLT>>
        Types)

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
std::initializer_list<std::pair<LLT, LLT>> Types

llvm::LegalizeRuleSet& actionIf(
    llvm::LegalizeActions::LegalizeAction Action,
    llvm::LegalityPredicate Predicate)

Description

Use the given action when the predicate is true. Action should not be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
llvm::LegalityPredicate Predicate

llvm::LegalizeRuleSet& actionIf(
    llvm::LegalizeActions::LegalizeAction Action,
    llvm::LegalityPredicate Predicate,
    llvm::LegalizeMutation Mutation)

Description

Use the given action when the predicate is true. Action should be an action that requires mutation.

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

Parameters

llvm::LegalizeActions::LegalizeAction Action
llvm::LegalityPredicate Predicate
llvm::LegalizeMutation Mutation

void add(const llvm::LegalizeRule& Rule)

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

Parameters

const llvm::LegalizeRule& Rule

void aliasTo(unsigned int Opcode)

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

Parameters

unsigned int Opcode

llvm::LegalizeRuleSet& alignNumElementsTo(
    unsigned int TypeIdx,
    const llvm::LLT EltTy,
    unsigned int NumElts)

Description

Set number of elements to nearest larger multiple of NumElts.

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

Parameters

unsigned int TypeIdx
const llvm::LLT EltTy
unsigned int NumElts

static bool always(const llvm::LegalityQuery&)

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

Parameters

const llvm::LegalityQuery&

llvm::LegalizeRuleSet& alwaysLegal()

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

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

Description

Apply the ruleset to the given LegalityQuery.

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

Parameters

const llvm::LegalityQuery& Query

llvm::LegalizeRuleSet& bitcastIf(
    llvm::LegalityPredicate Predicate,
    llvm::LegalizeMutation Mutation)

Description

The specified type index is coerced if predicate is true.

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

Parameters

llvm::LegalityPredicate Predicate
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& clampMaxNumElements(
    unsigned int TypeIdx,
    const llvm::LLT EltTy,
    unsigned int MaxElements)

Description

Limit the number of elements in EltTy vectors to at most MaxElements.

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

Parameters

unsigned int TypeIdx
const llvm::LLT EltTy
unsigned int MaxElements

llvm::LegalizeRuleSet& clampMaxNumElementsStrict(
    unsigned int TypeIdx,
    const llvm::LLT EltTy,
    unsigned int NumElts)

Description

Express \p EltTy vectors strictly using vectors with \p NumElts elements (or scalars when \p NumElts equals 1). First pad with undef elements to nearest larger multiple of \p NumElts. Then perform split with all sub-instructions having the same type. Using clampMaxNumElements (non-strict) can result in leftover instruction with different type (fewer elements then \p NumElts or scalar). No effect if the type is not a vector.

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

Parameters

unsigned int TypeIdx
const llvm::LLT EltTy
unsigned int NumElts

llvm::LegalizeRuleSet& clampMinNumElements(
    unsigned int TypeIdx,
    const llvm::LLT EltTy,
    unsigned int MinElements)

Description

Limit the number of elements in EltTy vectors to at least MinElements.

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

Parameters

unsigned int TypeIdx
const llvm::LLT EltTy
unsigned int MinElements

llvm::LegalizeRuleSet& clampNumElements(
    unsigned int TypeIdx,
    const llvm::LLT MinTy,
    const llvm::LLT MaxTy)

Description

Limit the number of elements for the given vectors to at least MinTy's number of elements and at most MaxTy's number of elements. No effect if the type is not a vector or does not have the same element type as the constraints. The element type of MinTy and MaxTy must match.

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

Parameters

unsigned int TypeIdx
const llvm::LLT MinTy
const llvm::LLT MaxTy

llvm::LegalizeRuleSet& clampScalar(
    unsigned int TypeIdx,
    const llvm::LLT MinTy,
    const llvm::LLT MaxTy)

Description

Limit the range of scalar sizes to MinTy and MaxTy.

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

Parameters

unsigned int TypeIdx
const llvm::LLT MinTy
const llvm::LLT MaxTy

llvm::LegalizeRuleSet& clampScalarOrElt(
    unsigned int TypeIdx,
    const llvm::LLT MinTy,
    const llvm::LLT MaxTy)

Description

Limit the range of scalar sizes to MinTy and MaxTy.

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

Parameters

unsigned int TypeIdx
const llvm::LLT MinTy
const llvm::LLT MaxTy

llvm::LegalizeRuleSet& custom()

Description

Unconditionally custom lower.

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

llvm::LegalizeRuleSet& customFor(
    std::initializer_list<std::pair<LLT, LLT>>
        Types)

Description

The instruction is custom when type indexes 0 and 1 is any type pair in the given list.

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

Parameters

std::initializer_list<std::pair<LLT, LLT>> Types

llvm::LegalizeRuleSet& customFor(
    std::initializer_list<LLT> Types)

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& customForCartesianProduct(
    std::initializer_list<LLT> Types)

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& customForCartesianProduct(
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1)

Description

The instruction is custom when type indexes 0 and 1 are both in their respective lists.

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

Parameters

std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1

llvm::LegalizeRuleSet& customForCartesianProduct(
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1,
    std::initializer_list<LLT> Types2)

Description

The instruction is custom when when type indexes 0, 1, and 2 are all in their respective lists.

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

Parameters

std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1
std::initializer_list<LLT> Types2

llvm::LegalizeRuleSet& customIf(
    llvm::LegalityPredicate Predicate)

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

Parameters

llvm::LegalityPredicate Predicate

llvm::LegalizeRuleSet& fallback()

Description

Fallback on the previous implementation. This should only be used while porting a rule.

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

llvm::LegalizeRuleSet& fewerElementsIf(
    llvm::LegalityPredicate Predicate,
    llvm::LegalizeMutation Mutation)

Description

Remove elements to reach the type selected by the mutation if the predicate is true.

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

Parameters

llvm::LegalityPredicate Predicate
llvm::LegalizeMutation Mutation

unsigned int getAlias() const

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

unsigned int immIdx(unsigned int ImmIdx)

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

Parameters

unsigned int ImmIdx

bool isAliasedByAnother()

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

llvm::LegalizeRuleSet& legalFor(
    std::initializer_list<LLT> Types)

Description

The instruction is legal when type index 0 is any type in the given list.

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& legalFor(
    std::initializer_list<std::pair<LLT, LLT>>
        Types)

Description

The instruction is legal when type indexes 0 and 1 is any type pair in the given list.

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

Parameters

std::initializer_list<std::pair<LLT, LLT>> Types

llvm::LegalizeRuleSet& legalForCartesianProduct(
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1,
    std::initializer_list<LLT> Types2)

Description

The instruction is legal when type indexes 0, 1, and 2 are both their respective lists.

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

Parameters

std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1
std::initializer_list<LLT> Types2

llvm::LegalizeRuleSet& legalForCartesianProduct(
    std::initializer_list<LLT> Types)

Description

The instruction is legal when type indexes 0 and 1 are both in the given list. That is, the type pair is in the cartesian product of the list.

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& legalForCartesianProduct(
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1)

Description

The instruction is legal when type indexes 0 and 1 are both their respective lists.

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

Parameters

std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1

llvm::LegalizeRuleSet& legalForTypeWithAnyImm(
    std::initializer_list<LLT> Types)

Description

The instruction is legal when type index 0 is any type in the given list and imm index 0 is anything.

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& legalForTypeWithAnyImm(
    std::initializer_list<std::pair<LLT, LLT>>
        Types)

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

Parameters

std::initializer_list<std::pair<LLT, LLT>> Types

llvm::LegalizeRuleSet& legalForTypesWithMemDesc(
    std::initializer_list<
        LegalityPredicates::TypePairAndMemDesc>
        TypesAndMemDesc)

Description

The instruction is legal when type indexes 0 and 1 along with the memory size and minimum alignment is any type and size tuple in the given list.

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

Parameters

std::initializer_list< LegalityPredicates::TypePairAndMemDesc> TypesAndMemDesc

llvm::LegalizeRuleSet& legalIf(
    llvm::LegalityPredicate Predicate)

Description

The instruction is legal if predicate is true.

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

Parameters

llvm::LegalityPredicate Predicate

llvm::LegalizeRuleSet& libcall()

Description

The instruction is emitted as a library call.

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

llvm::LegalizeRuleSet& libcallFor(
    std::initializer_list<std::pair<LLT, LLT>>
        Types)

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

Parameters

std::initializer_list<std::pair<LLT, LLT>> Types

llvm::LegalizeRuleSet& libcallFor(
    std::initializer_list<LLT> Types)

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& libcallForCartesianProduct(
    std::initializer_list<LLT> Types)

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& libcallForCartesianProduct(
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1)

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

Parameters

std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1

llvm::LegalizeRuleSet& libcallIf(
    llvm::LegalityPredicate Predicate)

Description

Like legalIf, but for the Libcall action.

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

Parameters

llvm::LegalityPredicate Predicate

llvm::LegalizeRuleSet& lower()

Description

The instruction is lowered.

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

llvm::LegalizeRuleSet& lowerFor(
    std::initializer_list<std::pair<LLT, LLT>>
        Types,
    llvm::LegalizeMutation Mutation)

Description

The instruction is lowered when type indexes 0 and 1 is any type pair in the given list.

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

Parameters

std::initializer_list<std::pair<LLT, LLT>> Types
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& lowerFor(
    std::initializer_list<std::pair<LLT, LLT>>
        Types)

Description

The instruction is lowered when type indexes 0 and 1 is any type pair in the given list. Keep type index 0 as the same type.

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

Parameters

std::initializer_list<std::pair<LLT, LLT>> Types

llvm::LegalizeRuleSet& lowerFor(
    std::initializer_list<LLT> Types,
    llvm::LegalizeMutation Mutation)

Description

The instruction is lowered when type index 0 is any type in the given list.

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

Parameters

std::initializer_list<LLT> Types
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& lowerFor(
    std::initializer_list<LLT> Types)

Description

The instruction is lowered when type index 0 is any type in the given list. Keep type index 0 as the same type.

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& lowerForCartesianProduct(
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1,
    std::initializer_list<LLT> Types2)

Description

The instruction is lowered when when type indexes 0, 1, and 2 are all in their respective lists.

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

Parameters

std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1
std::initializer_list<LLT> Types2

llvm::LegalizeRuleSet& lowerForCartesianProduct(
    std::initializer_list<LLT> Types0,
    std::initializer_list<LLT> Types1)

Description

The instruction is lowered when type indexes 0 and 1 are both in their respective lists.

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

Parameters

std::initializer_list<LLT> Types0
std::initializer_list<LLT> Types1

llvm::LegalizeRuleSet& lowerIf(
    llvm::LegalityPredicate Predicate,
    llvm::LegalizeMutation Mutation)

Description

The instruction is lowered if predicate is true.

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

Parameters

llvm::LegalityPredicate Predicate
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& lowerIf(
    llvm::LegalityPredicate Predicate)

Description

The instruction is lowered if predicate is true. Keep type index 0 as the same type.

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

Parameters

llvm::LegalityPredicate Predicate

llvm::LegalizeRuleSet&
lowerIfMemSizeNotByteSizePow2()

Description

Lower a memory operation if the memory access size is not a round power of 2 byte size. This is stricter than lowerIfMemSizeNotPow2, and more likely what you want (e.g. this will lower s1, s7 and s24).

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

llvm::LegalizeRuleSet& lowerIfMemSizeNotPow2()

Description

Lower a memory operation if the memory size, rounded to bytes, is not a power of 2. For example, this will not trigger for s1 or s7, but will for s24.

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

void markAllIdxsAsCovered()

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

llvm::LegalizeRuleSet& maxScalar(
    unsigned int TypeIdx,
    const llvm::LLT Ty)

Description

Ensure the scalar is at most as wide as Ty.

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

Parameters

unsigned int TypeIdx
const llvm::LLT Ty

llvm::LegalizeRuleSet& maxScalarEltSameAsIf(
    llvm::LegalityPredicate Predicate,
    unsigned int TypeIdx,
    unsigned int SmallTypeIdx)

Description

Conditionally narrow the scalar or elt to match the size of another.

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

Parameters

llvm::LegalityPredicate Predicate
unsigned int TypeIdx
unsigned int SmallTypeIdx

llvm::LegalizeRuleSet& maxScalarIf(
    llvm::LegalityPredicate Predicate,
    unsigned int TypeIdx,
    const llvm::LLT Ty)

Description

Conditionally limit the maximum size of the scalar. For example, when the maximum size of one type depends on the size of another such as extracting N bits from an M bit container.

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

Parameters

llvm::LegalityPredicate Predicate
unsigned int TypeIdx
const llvm::LLT Ty

llvm::LegalizeRuleSet& maxScalarOrElt(
    unsigned int TypeIdx,
    const llvm::LLT Ty)

Description

Ensure the scalar is at most as wide as Ty.

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

Parameters

unsigned int TypeIdx
const llvm::LLT Ty

llvm::LegalizeRuleSet& maxScalarSameAs(
    unsigned int TypeIdx,
    unsigned int NarrowTypeIdx)

Description

Narrow the scalar to match the size of another.

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

Parameters

unsigned int TypeIdx
unsigned int NarrowTypeIdx

llvm::LegalizeRuleSet& minScalar(
    unsigned int TypeIdx,
    const llvm::LLT Ty)

Description

Ensure the scalar is at least as wide as Ty.

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

Parameters

unsigned int TypeIdx
const llvm::LLT Ty

llvm::LegalizeRuleSet& minScalarEltSameAsIf(
    llvm::LegalityPredicate Predicate,
    unsigned int TypeIdx,
    unsigned int LargeTypeIdx)

Description

Conditionally widen the scalar or elt to match the size of another.

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

Parameters

llvm::LegalityPredicate Predicate
unsigned int TypeIdx
unsigned int LargeTypeIdx

llvm::LegalizeRuleSet& minScalarOrElt(
    unsigned int TypeIdx,
    const llvm::LLT Ty)

Description

Ensure the scalar or element is at least as wide as Ty.

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

Parameters

unsigned int TypeIdx
const llvm::LLT Ty

llvm::LegalizeRuleSet& minScalarOrEltIf(
    llvm::LegalityPredicate Predicate,
    unsigned int TypeIdx,
    const llvm::LLT Ty)

Description

Ensure the scalar or element is at least as wide as Ty.

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

Parameters

llvm::LegalityPredicate Predicate
unsigned int TypeIdx
const llvm::LLT Ty

llvm::LegalizeRuleSet& minScalarSameAs(
    unsigned int TypeIdx,
    unsigned int LargeTypeIdx)

Description

Widen the scalar to match the size of another.

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

Parameters

unsigned int TypeIdx
unsigned int LargeTypeIdx

llvm::LegalizeRuleSet& moreElementsIf(
    llvm::LegalityPredicate Predicate,
    llvm::LegalizeMutation Mutation)

Description

Add more elements to reach the type selected by the mutation if the predicate is true.

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

Parameters

llvm::LegalityPredicate Predicate
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& moreElementsToNextPow2(
    unsigned int TypeIdx)

Description

Add more elements to the vector to reach the next power of two. No effect if the type is not a vector or the element count is a power of two.

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

Parameters

unsigned int TypeIdx

llvm::LegalizeRuleSet& narrowScalar(
    unsigned int TypeIdx,
    llvm::LegalizeMutation Mutation)

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

Parameters

unsigned int TypeIdx
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& narrowScalarFor(
    std::initializer_list<std::pair<LLT, LLT>>
        Types,
    llvm::LegalizeMutation Mutation)

Description

Narrow the scalar, specified in mutation, when type indexes 0 and 1 is any type pair in the given list.

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

Parameters

std::initializer_list<std::pair<LLT, LLT>> Types
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& narrowScalarIf(
    llvm::LegalityPredicate Predicate,
    llvm::LegalizeMutation Mutation)

Description

Narrow the scalar to the one selected by the mutation if the predicate is true.

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

Parameters

llvm::LegalityPredicate Predicate
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& scalarSameSizeAs(
    unsigned int TypeIdx,
    unsigned int SameSizeIdx)

Description

Change the type \p TypeIdx to have the same scalar size as type \p SameSizeIdx.

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

Parameters

unsigned int TypeIdx
unsigned int SameSizeIdx

llvm::LegalizeRuleSet& scalarize(
    unsigned int TypeIdx)

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

Parameters

unsigned int TypeIdx

llvm::LegalizeRuleSet& scalarizeIf(
    llvm::LegalityPredicate Predicate,
    unsigned int TypeIdx)

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

Parameters

llvm::LegalityPredicate Predicate
unsigned int TypeIdx

void setIsAliasedByAnother()

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

unsigned int typeIdx(unsigned int TypeIdx)

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

Parameters

unsigned int TypeIdx

llvm::LegalizeRuleSet& unsupported()

Description

The instruction is unsupported.

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

llvm::LegalizeRuleSet& unsupportedFor(
    std::initializer_list<LLT> Types)

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

Parameters

std::initializer_list<LLT> Types

llvm::LegalizeRuleSet& unsupportedIf(
    llvm::LegalityPredicate Predicate)

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

Parameters

llvm::LegalityPredicate Predicate

llvm::LegalizeRuleSet&
unsupportedIfMemSizeNotPow2()

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

bool verifyImmIdxsCoverage(
    unsigned int NumImmIdxs) const

Description

Check if there is no imm index which is obviously not handled by the LegalizeRuleSet in any way at all.

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

Parameters

unsigned int NumImmIdxs

bool verifyTypeIdxsCoverage(
    unsigned int NumTypeIdxs) const

Description

Check if there is no type index which is obviously not handled by the LegalizeRuleSet in any way at all.

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

Parameters

unsigned int NumTypeIdxs

llvm::LegalizeRuleSet& widenScalarIf(
    llvm::LegalityPredicate Predicate,
    llvm::LegalizeMutation Mutation)

Description

Widen the scalar to the one selected by the mutation if the predicate is true.

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

Parameters

llvm::LegalityPredicate Predicate
llvm::LegalizeMutation Mutation

llvm::LegalizeRuleSet& widenScalarOrEltToNextPow2(
    unsigned int TypeIdx,
    unsigned int MinSize = 0)

Description

Widen the scalar or vector element type to the next power of two that is at least MinSize. No effect if the scalar size is a power of two.

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

Parameters

unsigned int TypeIdx
unsigned int MinSize = 0

llvm::LegalizeRuleSet&
widenScalarToNextMultipleOf(unsigned int TypeIdx,
                            unsigned int Size)

Description

Widen the scalar to the next multiple of Size. No effect if the type is not a scalar or is a multiple of Size.

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

Parameters

unsigned int TypeIdx
unsigned int Size

llvm::LegalizeRuleSet& widenScalarToNextPow2(
    unsigned int TypeIdx,
    unsigned int MinSize = 0)

Description

Widen the scalar to the next power of two that is at least MinSize. No effect if the type is not a scalar or is a power of two.

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

Parameters

unsigned int TypeIdx
unsigned int MinSize = 0