LLVM  7.0.0svn
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...
 
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...
 
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...
 
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)
 
LegalizeRuleSetcustomIf (LegalityPredicate Predicate)
 
LegalizeRuleSetcustomFor (std::initializer_list< LLT > Types)
 
LegalizeRuleSetcustomForCartesianProduct (std::initializer_list< LLT > Types)
 
LegalizeRuleSetcustomForCartesianProduct (std::initializer_list< LLT > Types0, std::initializer_list< LLT > Types1)
 
LegalizeRuleSetwidenScalarToNextPow2 (unsigned TypeIdx, unsigned MinSize=0)
 Widen the scalar to the next power of two that is at least MinSize. More...
 
LegalizeRuleSetnarrowScalar (unsigned TypeIdx, LegalizeMutation Mutation)
 
LegalizeRuleSetminScalar (unsigned TypeIdx, const LLT &Ty)
 Ensure the scalar is at least 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...
 
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...
 
LegalizeActionStep apply (const LegalityQuery &Query) const
 Apply the ruleset to the given LegalityQuery. More...
 

Detailed Description

Definition at line 212 of file LegalizerInfo.h.

Constructor & Destructor Documentation

◆ LegalizeRuleSet()

llvm::LegalizeRuleSet::LegalizeRuleSet ( )
inline

Definition at line 278 of file LegalizerInfo.h.

Member Function Documentation

◆ aliasTo()

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

◆ apply()

LegalizeActionStep LegalizeRuleSet::apply ( const LegalityQuery Query) const

◆ clampMaxNumElements()

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

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

Definition at line 462 of file LegalizerInfo.h.

References llvm::LLT::getElementType(), llvm::LLT::getNumElements(), llvm::LLT::getScalarSizeInBits(), Query(), llvm::LegalityQuery::Types, and llvm::LLT::vector().

◆ 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 447 of file LegalizerInfo.h.

References llvm::LLT::getElementType(), llvm::LLT::getNumElements(), llvm::LLT::getScalarSizeInBits(), Query(), llvm::LegalityQuery::Types, and llvm::LLT::vector().

◆ 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 482 of file LegalizerInfo.h.

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

◆ clampScalar()

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

Limit the range of scalar sizes to MinTy and MaxTy.

Definition at line 430 of file LegalizerInfo.h.

References assert(), and llvm::LLT::isScalar().

◆ customFor()

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

Definition at line 373 of file LegalizerInfo.h.

References llvm::LegalizeActions::Custom.

◆ customForCartesianProduct() [1/2]

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

Definition at line 376 of file LegalizerInfo.h.

References llvm::LegalizeActions::Custom.

◆ customForCartesianProduct() [2/2]

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

Definition at line 380 of file LegalizerInfo.h.

References llvm::LegalizeActions::Custom.

◆ customIf()

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

Definition at line 370 of file LegalizerInfo.h.

References llvm::LegalizeActions::Custom.

◆ fallback()

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

Fallback on the previous implementation.

This should only be used while porting a rule.

Definition at line 494 of file LegalizerInfo.h.

References llvm::ARM_AM::add, llvm::cl::apply(), Query(), 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 357 of file LegalizerInfo.h.

References llvm::LegalizeActions::FewerElements.

◆ getAlias()

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

Definition at line 288 of file LegalizerInfo.h.

◆ isAliasedByAnother()

bool llvm::LegalizeRuleSet::isAliasedByAnother ( )
inline

Definition at line 280 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 295 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ 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 300 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ legalForCartesianProduct() [1/2]

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 305 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ legalForCartesianProduct() [2/2]

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 310 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ legalIf()

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

The instruction is legal if predicate is true.

Definition at line 291 of file LegalizerInfo.h.

References llvm::LegalizeActions::Legal.

◆ libcallFor() [1/2]

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

Definition at line 319 of file LegalizerInfo.h.

References llvm::LegalizeActions::Libcall.

◆ libcallFor() [2/2]

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

Definition at line 323 of file LegalizerInfo.h.

References llvm::LegalizeActions::Libcall.

◆ libcallForCartesianProduct() [1/2]

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

Definition at line 327 of file LegalizerInfo.h.

References llvm::LegalizeActions::Libcall.

◆ libcallForCartesianProduct() [2/2]

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

Definition at line 331 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 316 of file LegalizerInfo.h.

References llvm::LegalizeActions::Libcall.

◆ maxScalar()

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

Ensure the scalar is at most as wide as Ty.

Definition at line 408 of file LegalizerInfo.h.

References llvm::LegalizeMutations::changeTo(), llvm::LLT::getSizeInBits(), and llvm::LegalityPredicates::widerThan().

◆ 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 418 of file LegalizerInfo.h.

References llvm::LegalizeMutations::changeTo(), llvm::LLT::getSizeInBits(), Query(), and llvm::LegalityPredicates::widerThan().

◆ minScalar()

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

Ensure the scalar is at least as wide as Ty.

Definition at line 400 of file LegalizerInfo.h.

References llvm::LegalizeMutations::changeTo(), llvm::LLT::getSizeInBits(), and llvm::LegalityPredicates::narrowerThan().

◆ 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 351 of file LegalizerInfo.h.

References llvm::LegalizeActions::MoreElements.

◆ 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 440 of file LegalizerInfo.h.

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

◆ narrowScalar()

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

Definition at line 394 of file LegalizerInfo.h.

References llvm::LegalityPredicates::isScalar().

◆ 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 344 of file LegalizerInfo.h.

References llvm::LegalizeActions::NarrowScalar.

◆ setIsAliasedByAnother()

void llvm::LegalizeRuleSet::setIsAliasedByAnother ( )
inline

Definition at line 281 of file LegalizerInfo.h.

◆ unsupported()

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

The instruction is unsupported.

Definition at line 363 of file LegalizerInfo.h.

References llvm::LegalizeActions::Unsupported.

◆ unsupportedIf()

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

Definition at line 366 of file LegalizerInfo.h.

References llvm::LegalizeActions::Unsupported.

◆ 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 338 of file LegalizerInfo.h.

References llvm::LegalizeActions::WidenScalar.

◆ 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 387 of file LegalizerInfo.h.

References llvm::LegalityPredicates::sizeNotPow2(), and llvm::LegalizeMutations::widenScalarToNextPow2().


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