LLVM  13.0.0git
Public Member Functions | List of all members
llvm::LegalizeRuleSet Class Reference

#include "llvm/CodeGen/GlobalISel/LegalizerInfo.h"

Public Member Functions

 LegalizeRuleSet ()
 
bool isAliasedByAnother ()
 
void setIsAliasedByAnother ()
 
void aliasTo (unsigned Opcode)
 
unsigned getAlias () const
 
LegalizeRuleSetlegalIf (LegalityPredicate Predicate)
 The instruction is legal if predicate is true. More...
 
LegalizeRuleSetlegalFor (std::initializer_list< LLT > Types)
 The instruction is legal when type index 0 is any type in the given list. More...
 
LegalizeRuleSetlegalFor (std::initializer_list< std::pair< LLT, LLT >> Types)
 The instruction is legal when type indexes 0 and 1 is any type pair in the given list. More...
 
LegalizeRuleSetlegalForTypeWithAnyImm (std::initializer_list< LLT > Types)
 The instruction is legal when type index 0 is any type in the given list and imm index 0 is anything. More...
 
LegalizeRuleSetlegalForTypeWithAnyImm (std::initializer_list< std::pair< LLT, LLT >> Types)
 
LegalizeRuleSetlegalForTypesWithMemDesc (std::initializer_list< LegalityPredicates::TypePairAndMemDesc > TypesAndMemDesc)
 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. More...
 
LegalizeRuleSetlegalForCartesianProduct (std::initializer_list< LLT > Types)
 The instruction is legal when type indexes 0 and 1 are both in the given list. More...
 
LegalizeRuleSetlegalForCartesianProduct (std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
 The instruction is legal when type indexes 0 and 1 are both their respective lists. More...
 
LegalizeRuleSetlegalForCartesianProduct (std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1, std::initializer_list< LLT > Types2)
 The instruction is legal when type indexes 0, 1, and 2 are both their respective lists. More...
 
LegalizeRuleSetalwaysLegal ()
 
LegalizeRuleSetbitcastIf (LegalityPredicate Predicate, LegalizeMutation Mutation)
 The specified type index is coerced if predicate is true. More...
 
LegalizeRuleSetlower ()
 The instruction is lowered. More...
 
LegalizeRuleSetlowerIf (LegalityPredicate Predicate)
 The instruction is lowered if predicate is true. More...
 
LegalizeRuleSetlowerIf (LegalityPredicate Predicate, LegalizeMutation Mutation)
 The instruction is lowered if predicate is true. More...
 
LegalizeRuleSetlowerFor (std::initializer_list< LLT > Types)
 The instruction is lowered when type index 0 is any type in the given list. More...
 
LegalizeRuleSetlowerFor (std::initializer_list< LLT > Types, LegalizeMutation Mutation)
 The instruction is lowered when type index 0 is any type in the given list. More...
 
LegalizeRuleSetlowerFor (std::initializer_list< std::pair< LLT, LLT >> Types)
 The instruction is lowered when type indexes 0 and 1 is any type pair in the given list. More...
 
LegalizeRuleSetlowerFor (std::initializer_list< std::pair< LLT, LLT >> Types, LegalizeMutation Mutation)
 The instruction is lowered when type indexes 0 and 1 is any type pair in the given list. More...
 
LegalizeRuleSetlowerForCartesianProduct (std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
 The instruction is lowered when type indexes 0 and 1 are both in their respective lists. More...
 
LegalizeRuleSetlowerForCartesianProduct (std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1, std::initializer_list< LLT > Types2)
 The instruction is lowered when when type indexes 0, 1, and 2 are all in their respective lists. More...
 
LegalizeRuleSetlibcall ()
 The instruction is emitted as a library call. More...
 
LegalizeRuleSetlibcallIf (LegalityPredicate Predicate)
 Like legalIf, but for the Libcall action. More...
 
LegalizeRuleSetlibcallFor (std::initializer_list< LLT > Types)
 
LegalizeRuleSetlibcallFor (std::initializer_list< std::pair< LLT, LLT >> Types)
 
LegalizeRuleSetlibcallForCartesianProduct (std::initializer_list< LLT > Types)
 
LegalizeRuleSetlibcallForCartesianProduct (std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
 
LegalizeRuleSetwidenScalarIf (LegalityPredicate Predicate, LegalizeMutation Mutation)
 Widen the scalar to the one selected by the mutation if the predicate is true. More...
 
LegalizeRuleSetnarrowScalarIf (LegalityPredicate Predicate, LegalizeMutation Mutation)
 Narrow the scalar to the one selected by the mutation if the predicate is true. More...
 
LegalizeRuleSetnarrowScalarFor (std::initializer_list< std::pair< LLT, LLT >> Types, LegalizeMutation Mutation)
 Narrow the scalar, specified in mutation, when type indexes 0 and 1 is any type pair in the given list. More...
 
LegalizeRuleSetmoreElementsIf (LegalityPredicate Predicate, LegalizeMutation Mutation)
 Add more elements to reach the type selected by the mutation if the predicate is true. More...
 
LegalizeRuleSetfewerElementsIf (LegalityPredicate Predicate, LegalizeMutation Mutation)
 Remove elements to reach the type selected by the mutation if the predicate is true. More...
 
LegalizeRuleSetunsupported ()
 The instruction is unsupported. More...
 
LegalizeRuleSetunsupportedIf (LegalityPredicate Predicate)
 
LegalizeRuleSetunsupportedFor (std::initializer_list< LLT > Types)
 
LegalizeRuleSetunsupportedIfMemSizeNotPow2 ()
 
LegalizeRuleSetlowerIfMemSizeNotPow2 ()
 
LegalizeRuleSetcustomIf (LegalityPredicate Predicate)
 
LegalizeRuleSetcustomFor (std::initializer_list< LLT > Types)
 
LegalizeRuleSetcustomFor (std::initializer_list< std::pair< LLT, LLT >> Types)
 The instruction is custom when type indexes 0 and 1 is any type pair in the given list. More...
 
LegalizeRuleSetcustomForCartesianProduct (std::initializer_list< LLT > Types)
 
LegalizeRuleSetcustomForCartesianProduct (std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
 
LegalizeRuleSetcustom ()
 Unconditionally custom lower. More...
 
LegalizeRuleSetwidenScalarToNextPow2 (unsigned TypeIdx, unsigned MinSize=0)
 Widen the scalar to the next power of two that is at least MinSize. More...
 
LegalizeRuleSetwidenScalarOrEltToNextPow2 (unsigned TypeIdx, unsigned MinSize=0)
 Widen the scalar or vector element type to the next power of two that is at least MinSize. More...
 
LegalizeRuleSetnarrowScalar (unsigned TypeIdx, LegalizeMutation Mutation)
 
LegalizeRuleSetscalarize (unsigned TypeIdx)
 
LegalizeRuleSetscalarizeIf (LegalityPredicate Predicate, unsigned TypeIdx)
 
LegalizeRuleSetminScalarOrElt (unsigned TypeIdx, const LLT Ty)
 Ensure the scalar or element is at least as wide as Ty. More...
 
LegalizeRuleSetminScalarOrEltIf (LegalityPredicate Predicate, unsigned TypeIdx, const LLT Ty)
 Ensure the scalar or element is at least as wide as Ty. More...
 
LegalizeRuleSetminScalar (unsigned TypeIdx, const LLT Ty)
 Ensure the scalar is at least as wide as Ty. More...
 
LegalizeRuleSetmaxScalarOrElt (unsigned TypeIdx, const LLT Ty)
 Ensure the scalar is at most as wide as Ty. More...
 
LegalizeRuleSetmaxScalar (unsigned TypeIdx, const LLT Ty)
 Ensure the scalar is at most as wide as Ty. More...
 
LegalizeRuleSetmaxScalarIf (LegalityPredicate Predicate, unsigned TypeIdx, const LLT Ty)
 Conditionally limit the maximum size of the scalar. More...
 
LegalizeRuleSetclampScalar (unsigned TypeIdx, const LLT MinTy, const LLT MaxTy)
 Limit the range of scalar sizes to MinTy and MaxTy. More...
 
LegalizeRuleSetclampScalarOrElt (unsigned TypeIdx, const LLT MinTy, const LLT MaxTy)
 Limit the range of scalar sizes to MinTy and MaxTy. More...
 
LegalizeRuleSetminScalarSameAs (unsigned TypeIdx, unsigned LargeTypeIdx)
 Widen the scalar to match the size of another. More...
 
LegalizeRuleSetmaxScalarSameAs (unsigned TypeIdx, unsigned NarrowTypeIdx)
 Narrow the scalar to match the size of another. More...
 
LegalizeRuleSetscalarSameSizeAs (unsigned TypeIdx, unsigned SameSizeIdx)
 Change the type TypeIdx to have the same scalar size as type SameSizeIdx. More...
 
LegalizeRuleSetminScalarEltSameAsIf (LegalityPredicate Predicate, unsigned TypeIdx, unsigned LargeTypeIdx)
 Conditionally widen the scalar or elt to match the size of another. More...
 
LegalizeRuleSetmaxScalarEltSameAsIf (LegalityPredicate Predicate, unsigned TypeIdx, unsigned SmallTypeIdx)
 Conditionally narrow the scalar or elt to match the size of another. More...
 
LegalizeRuleSetmoreElementsToNextPow2 (unsigned TypeIdx)
 Add more elements to the vector to reach the next power of two. More...
 
LegalizeRuleSetclampMinNumElements (unsigned TypeIdx, const LLT EltTy, unsigned MinElements)
 Limit the number of elements in EltTy vectors to at least MinElements. More...
 
LegalizeRuleSetclampMaxNumElements (unsigned TypeIdx, const LLT EltTy, unsigned MaxElements)
 Limit the number of elements in EltTy vectors to at most MaxElements. More...
 
LegalizeRuleSetclampNumElements (unsigned TypeIdx, const LLT MinTy, const LLT MaxTy)
 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. More...
 
LegalizeRuleSetfallback ()
 Fallback on the previous implementation. More...
 
bool verifyTypeIdxsCoverage (unsigned NumTypeIdxs) const
 Check if there is no type index which is obviously not handled by the LegalizeRuleSet in any way at all. More...
 
bool verifyImmIdxsCoverage (unsigned NumImmIdxs) const
 Check if there is no imm index which is obviously not handled by the LegalizeRuleSet in any way at all. More...
 
LegalizeActionStep apply (const LegalityQuery &Query) const
 Apply the ruleset to the given LegalityQuery. More...
 

Detailed Description

Definition at line 363 of file LegalizerInfo.h.

Constructor & Destructor Documentation

◆ LegalizeRuleSet()

llvm::LegalizeRuleSet::LegalizeRuleSet ( )
inline

Definition at line 518 of file LegalizerInfo.h.

Member Function Documentation

◆ aliasTo()

void llvm::LegalizeRuleSet::aliasTo ( unsigned  Opcode)
inline

Definition at line 522 of file LegalizerInfo.h.

References assert().

Referenced by llvm::LegalizerInfo::aliasActionDefinitions().

◆ alwaysLegal()

LegalizeRuleSet& llvm::LegalizeRuleSet::alwaysLegal ( )
inline

◆ apply()

LegalizeActionStep LegalizeRuleSet::apply ( const LegalityQuery Query) const

◆ bitcastIf()

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

The specified type index is coerced if predicate is true.

Definition at line 595 of file LegalizerInfo.h.

References llvm::LegalizeActions::Bitcast, and Mutation.

◆ clampMaxNumElements()

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

◆ clampMinNumElements()

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

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

Definition at line 987 of file LegalizerInfo.h.

References llvm::LLT::getElementType(), llvm::LLT::getNumElements(), llvm::LLT::isVector(), llvm::LegalizeActions::MoreElements, llvm::LegalityQuery::Types, and llvm::LLT::vector().

Referenced by clampNumElements().

◆ clampNumElements()

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

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.

Definition at line 1028 of file LegalizerInfo.h.

References assert(), clampMaxNumElements(), clampMinNumElements(), llvm::LLT::getElementType(), and llvm::LLT::getNumElements().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ clampScalar()

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

◆ clampScalarOrElt()

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

Limit the range of scalar sizes to MinTy and MaxTy.

Definition at line 909 of file LegalizerInfo.h.

References maxScalarOrElt(), and minScalarOrElt().

Referenced by llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo().

◆ custom()

LegalizeRuleSet& llvm::LegalizeRuleSet::custom ( )
inline

Unconditionally custom lower.

Definition at line 793 of file LegalizerInfo.h.

References customIf().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ customFor() [1/2]

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

◆ customFor() [2/2]

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

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

Definition at line 779 of file LegalizerInfo.h.

References llvm::LegalizeActions::Custom.

◆ customForCartesianProduct() [1/2]

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

◆ customForCartesianProduct() [2/2]

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

Definition at line 787 of file LegalizerInfo.h.

References llvm::LegalizeActions::Custom.

◆ customIf()

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

◆ fallback()

LegalizeRuleSet& llvm::LegalizeRuleSet::fallback ( )
inline

Fallback on the previous implementation.

This should only be used while porting a rule.

Definition at line 1040 of file LegalizerInfo.h.

References always(), and llvm::LegalizeActions::UseLegacyRules.

◆ fewerElementsIf()

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

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

Definition at line 737 of file LegalizerInfo.h.

References llvm::LegalizeActions::FewerElements, and Mutation.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), and llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo().

◆ getAlias()

unsigned llvm::LegalizeRuleSet::getAlias ( ) const
inline

Definition at line 528 of file LegalizerInfo.h.

◆ isAliasedByAnother()

bool llvm::LegalizeRuleSet::isAliasedByAnother ( )
inline

Definition at line 520 of file LegalizerInfo.h.

◆ legalFor() [1/2]

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

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

Definition at line 538 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo(), and llvm::MipsLegalizerInfo::MipsLegalizerInfo().

◆ legalFor() [2/2]

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

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

Definition at line 543 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ legalForCartesianProduct() [1/3]

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

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.

Definition at line 570 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), and llvm::MipsLegalizerInfo::MipsLegalizerInfo().

◆ legalForCartesianProduct() [2/3]

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

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

Definition at line 575 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ legalForCartesianProduct() [3/3]

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

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

Definition at line 581 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ legalForTypesWithMemDesc()

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

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.

Definition at line 561 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal, and llvm::LegalityPredicates::typePairAndMemDescInSet().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ legalForTypeWithAnyImm() [1/2]

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

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

Definition at line 548 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ legalForTypeWithAnyImm() [2/2]

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

Definition at line 553 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ legalIf()

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

◆ libcall()

LegalizeRuleSet& llvm::LegalizeRuleSet::libcall ( )
inline

The instruction is emitted as a library call.

Definition at line 668 of file LegalizerInfo.h.

References always(), and llvm::LegalizeActions::Libcall.

Referenced by llvm::X86LegalizerInfo::X86LegalizerInfo().

◆ libcallFor() [1/2]

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

◆ libcallFor() [2/2]

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

Definition at line 687 of file LegalizerInfo.h.

References llvm::LegalizeActions::Libcall.

◆ libcallForCartesianProduct() [1/2]

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

◆ libcallForCartesianProduct() [2/2]

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

Definition at line 695 of file LegalizerInfo.h.

References llvm::LegalizeActions::Libcall.

◆ libcallIf()

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

Like legalIf, but for the Libcall action.

Definition at line 677 of file LegalizerInfo.h.

References llvm::LegalizeActions::Libcall.

◆ lower()

LegalizeRuleSet& llvm::LegalizeRuleSet::lower ( )
inline

◆ lowerFor() [1/4]

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

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

Keep type index 0 as the same type.

Definition at line 630 of file LegalizerInfo.h.

References llvm::LegalizeActions::Lower.

Referenced by llvm::MipsLegalizerInfo::MipsLegalizerInfo().

◆ lowerFor() [2/4]

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

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

Definition at line 635 of file LegalizerInfo.h.

References llvm::LegalizeActions::Lower, and Mutation.

◆ lowerFor() [3/4]

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

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.

Definition at line 641 of file LegalizerInfo.h.

References llvm::LegalizeActions::Lower.

◆ lowerFor() [4/4]

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

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

Definition at line 646 of file LegalizerInfo.h.

References llvm::LegalizeActions::Lower, and Mutation.

◆ lowerForCartesianProduct() [1/2]

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

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

Definition at line 652 of file LegalizerInfo.h.

References llvm::LegalizeActions::Lower.

◆ lowerForCartesianProduct() [2/2]

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

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

Definition at line 659 of file LegalizerInfo.h.

References llvm::LegalizeActions::Lower.

◆ lowerIf() [1/2]

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

The instruction is lowered if predicate is true.

Keep type index 0 as the same type.

Definition at line 613 of file LegalizerInfo.h.

References llvm::LegalizeActions::Lower.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ lowerIf() [2/2]

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

The instruction is lowered if predicate is true.

Definition at line 621 of file LegalizerInfo.h.

References llvm::LegalizeActions::Lower, and Mutation.

◆ lowerIfMemSizeNotPow2()

LegalizeRuleSet& llvm::LegalizeRuleSet::lowerIfMemSizeNotPow2 ( )
inline

◆ maxScalar()

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

◆ maxScalarEltSameAsIf()

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

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

Definition at line 960 of file LegalizerInfo.h.

References narrowScalarIf(), T, and llvm::LegalityQuery::Types.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ maxScalarIf()

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

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.

Definition at line 886 of file LegalizerInfo.h.

References llvm::LegalizeMutations::changeElementTo(), llvm::LLT::getSizeInBits(), llvm::LLT::isScalar(), llvm::LegalizeActions::NarrowScalar, and llvm::LegalityQuery::Types.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ maxScalarOrElt()

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

◆ maxScalarSameAs()

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

Narrow the scalar to match the size of another.

Definition at line 926 of file LegalizerInfo.h.

References llvm::LegalizeMutations::changeElementSizeTo(), narrowScalarIf(), and llvm::LegalityQuery::Types.

Referenced by scalarSameSizeAs().

◆ minScalar()

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

◆ minScalarEltSameAsIf()

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

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

Definition at line 944 of file LegalizerInfo.h.

References T, llvm::LegalityQuery::Types, and widenScalarIf().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ minScalarOrElt()

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

◆ minScalarOrEltIf()

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

◆ minScalarSameAs()

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

Widen the scalar to match the size of another.

Definition at line 915 of file LegalizerInfo.h.

References llvm::LegalizeMutations::changeElementSizeTo(), llvm::LegalityQuery::Types, and widenScalarIf().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), and scalarSameSizeAs().

◆ moreElementsIf()

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

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

Definition at line 728 of file LegalizerInfo.h.

References llvm::LegalizeActions::MoreElements, and Mutation.

Referenced by llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo().

◆ moreElementsToNextPow2()

LegalizeRuleSet& llvm::LegalizeRuleSet::moreElementsToNextPow2 ( unsigned  TypeIdx)
inline

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.

Definition at line 979 of file LegalizerInfo.h.

References llvm::LegalizeActions::MoreElements, llvm::LegalizeMutations::moreElementsToNextPow2(), and llvm::LegalityPredicates::numElementsNotPow2().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo().

◆ narrowScalar()

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

◆ narrowScalarFor()

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

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

Definition at line 721 of file LegalizerInfo.h.

References Mutation, and llvm::LegalizeActions::NarrowScalar.

◆ narrowScalarIf()

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

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

Definition at line 711 of file LegalizerInfo.h.

References Mutation, and llvm::LegalizeActions::NarrowScalar.

Referenced by maxScalarEltSameAsIf(), and maxScalarSameAs().

◆ scalarize()

LegalizeRuleSet& llvm::LegalizeRuleSet::scalarize ( unsigned  TypeIdx)
inline

◆ scalarizeIf()

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

◆ scalarSameSizeAs()

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

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

Definition at line 938 of file LegalizerInfo.h.

References maxScalarSameAs(), and minScalarSameAs().

◆ setIsAliasedByAnother()

void llvm::LegalizeRuleSet::setIsAliasedByAnother ( )
inline

Definition at line 521 of file LegalizerInfo.h.

◆ unsupported()

LegalizeRuleSet& llvm::LegalizeRuleSet::unsupported ( )
inline

The instruction is unsupported.

Definition at line 746 of file LegalizerInfo.h.

References llvm::LegalizeActions::Unsupported.

◆ unsupportedFor()

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

Definition at line 754 of file LegalizerInfo.h.

References llvm::LegalizeActions::Unsupported.

◆ unsupportedIf()

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

◆ unsupportedIfMemSizeNotPow2()

LegalizeRuleSet& llvm::LegalizeRuleSet::unsupportedIfMemSizeNotPow2 ( )
inline

◆ verifyImmIdxsCoverage()

bool LegalizeRuleSet::verifyImmIdxsCoverage ( unsigned  NumImmIdxs) const

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

Precondition
Type indices of the opcode form a dense [0, NumTypeIdxs) set.

Definition at line 237 of file LegalizerInfo.cpp.

References llvm::dbgs(), and LLVM_DEBUG.

Referenced by llvm::LegalizerInfo::verify().

◆ verifyTypeIdxsCoverage()

bool LegalizeRuleSet::verifyTypeIdxsCoverage ( unsigned  NumTypeIdxs) const

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

Precondition
Type indices of the opcode form a dense [0, NumTypeIdxs) set.

Definition at line 214 of file LegalizerInfo.cpp.

References llvm::dbgs(), and LLVM_DEBUG.

Referenced by llvm::LegalizerInfo::verify().

◆ widenScalarIf()

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

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

Definition at line 702 of file LegalizerInfo.h.

References Mutation, and llvm::LegalizeActions::WidenScalar.

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), minScalarEltSameAsIf(), and minScalarSameAs().

◆ widenScalarOrEltToNextPow2()

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

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.

Definition at line 809 of file LegalizerInfo.h.

References llvm::LegalityPredicates::scalarOrEltSizeNotPow2(), llvm::LegalizeActions::WidenScalar, and llvm::LegalizeMutations::widenScalarOrEltToNextPow2().

◆ widenScalarToNextPow2()

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

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.

Definition at line 799 of file LegalizerInfo.h.

References llvm::LegalityPredicates::sizeNotPow2(), llvm::LegalizeActions::WidenScalar, and llvm::LegalizeMutations::widenScalarOrEltToNextPow2().

Referenced by llvm::AArch64LegalizerInfo::AArch64LegalizerInfo(), and llvm::AMDGPULegalizerInfo::AMDGPULegalizerInfo().


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