LLVM  15.0.0git
LegalizerInfo.h File Reference
#include "llvm/ADT/SmallBitVector.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/CodeGen/GlobalISel/LegacyLegalizerInfo.h"
#include "llvm/CodeGen/MachineMemOperand.h"
#include "llvm/CodeGen/TargetOpcodes.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/LowLevelTypeImpl.h"
#include <cassert>
#include <cstdint>
#include <tuple>
#include <utility>
Include dependency graph for LegalizerInfo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Classes

struct  llvm::LegalityQuery
The LegalityQuery object bundles together all the information that's needed to decide whether a given operation is legal or not. More...

struct  llvm::LegalityQuery::MemDesc

struct  llvm::LegalizeActionStep
The result of a query. More...

struct  llvm::LegalityPredicates::TypePairAndMemDesc

class  llvm::LegalizeRule
A single rule in a legalizer info ruleset. More...

class  llvm::LegalizeRuleSet

class  llvm::LegalizerInfo

## Namespaces

llvm
This is an optimization pass for GlobalISel generic memory operations.

llvm::LegalizeActions

llvm::LegalityPredicates

llvm::LegalizeMutations

## Typedefs

using llvm::LegalityPredicate = std::function< bool(const LegalityQuery &)>

using llvm::LegalizeMutation = std::function< std::pair< unsigned, LLT >(const LegalityQuery &)>

## Functions

raw_ostream & llvm::operator<< (raw_ostream &OS, LegalizeActions::LegalizeAction Action)

template<typename Predicate >
Predicate llvm::LegalityPredicates::all (Predicate P0, Predicate P1)
True iff P0 and P1 are true. More...

template<typename Predicate , typename... Args>
Predicate llvm::LegalityPredicates::all (Predicate P0, Predicate P1, Args... args)
True iff all given predicates are true. More...

template<typename Predicate >
Predicate llvm::LegalityPredicates::any (Predicate P0, Predicate P1)
True iff P0 or P1 are true. More...

template<typename Predicate , typename... Args>
Predicate llvm::LegalityPredicates::any (Predicate P0, Predicate P1, Args... args)
True iff any given predicates are true. More...

LegalityPredicate llvm::LegalityPredicates::typeIs (unsigned TypeIdx, LLT TypesInit)
True iff the given type index is the specified type. More...

LegalityPredicate llvm::LegalityPredicates::typeInSet (unsigned TypeIdx, std::initializer_list< LLT > TypesInit)
True iff the given type index is one of the specified types. More...

LegalityPredicate llvm::LegalityPredicates::typeIsNot (unsigned TypeIdx, LLT Type)
True iff the given type index is not the specified type. More...

LegalityPredicate llvm::LegalityPredicates::typePairInSet (unsigned TypeIdx0, unsigned TypeIdx1, std::initializer_list< std::pair< LLT, LLT >> TypesInit)
True iff the given types for the given pair of type indexes is one of the specified type pairs. More...

LegalityPredicate llvm::LegalityPredicates::typePairAndMemDescInSet (unsigned TypeIdx0, unsigned TypeIdx1, unsigned MMOIdx, std::initializer_list< TypePairAndMemDesc > TypesAndMemDescInit)
True iff the given types for the given pair of type indexes is one of the specified type pairs. More...

LegalityPredicate llvm::LegalityPredicates::isScalar (unsigned TypeIdx)
True iff the specified type index is a scalar. More...

LegalityPredicate llvm::LegalityPredicates::isVector (unsigned TypeIdx)
True iff the specified type index is a vector. More...

LegalityPredicate llvm::LegalityPredicates::isPointer (unsigned TypeIdx)
True iff the specified type index is a pointer (with any address space). More...

LegalityPredicate llvm::LegalityPredicates::isPointer (unsigned TypeIdx, unsigned AddrSpace)
True iff the specified type index is a pointer with the specified address space. More...

LegalityPredicate llvm::LegalityPredicates::elementTypeIs (unsigned TypeIdx, LLT EltTy)
True if the type index is a vector with element type EltTy. More...

LegalityPredicate llvm::LegalityPredicates::scalarNarrowerThan (unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's narrower than the given size. More...

LegalityPredicate llvm::LegalityPredicates::scalarWiderThan (unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar that's wider than the given size. More...

LegalityPredicate llvm::LegalityPredicates::scalarOrEltNarrowerThan (unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar or vector with an element type that's narrower than the given size. More...

LegalityPredicate llvm::LegalityPredicates::scalarOrEltWiderThan (unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar or a vector with an element type that's wider than the given size. More...

LegalityPredicate llvm::LegalityPredicates::sizeNotMultipleOf (unsigned TypeIdx, unsigned Size)
True iff the specified type index is a scalar whose size is not a multiple of Size. More...

LegalityPredicate llvm::LegalityPredicates::sizeNotPow2 (unsigned TypeIdx)
True iff the specified type index is a scalar whose size is not a power of. More...

LegalityPredicate llvm::LegalityPredicates::scalarOrEltSizeNotPow2 (unsigned TypeIdx)
True iff the specified type index is a scalar or vector whose element size is not a power of 2. More...

LegalityPredicate llvm::LegalityPredicates::sizeIs (unsigned TypeIdx, unsigned Size)
True if the total bitwidth of the specified type index is Size bits. More...

LegalityPredicate llvm::LegalityPredicates::sameSize (unsigned TypeIdx0, unsigned TypeIdx1)
True iff the specified type indices are both the same bit size. More...

LegalityPredicate llvm::LegalityPredicates::largerThan (unsigned TypeIdx0, unsigned TypeIdx1)
True iff the first type index has a larger total bit size than second type index. More...

LegalityPredicate llvm::LegalityPredicates::smallerThan (unsigned TypeIdx0, unsigned TypeIdx1)
True iff the first type index has a smaller total bit size than second type index. More...

LegalityPredicate llvm::LegalityPredicates::memSizeInBytesNotPow2 (unsigned MMOIdx)
True iff the specified MMO index has a size (rounded to bytes) that is not a power of 2. More...

LegalityPredicate llvm::LegalityPredicates::memSizeNotByteSizePow2 (unsigned MMOIdx)
True iff the specified MMO index has a size that is not an even byte size, or that even byte size is not a power of 2. More...

LegalityPredicate llvm::LegalityPredicates::numElementsNotPow2 (unsigned TypeIdx)
True iff the specified type index is a vector whose element count is not a power of 2. More...

LegalityPredicate llvm::LegalityPredicates::atomicOrderingAtLeastOrStrongerThan (unsigned MMOIdx, AtomicOrdering Ordering)
True iff the specified MMO index has at an atomic ordering of at Ordering or stronger. More...

LegalizeMutation llvm::LegalizeMutations::changeTo (unsigned TypeIdx, LLT Ty)
Select this specific type for the given type index. More...

LegalizeMutation llvm::LegalizeMutations::changeTo (unsigned TypeIdx, unsigned FromTypeIdx)
Keep the same type as the given type index. More...

LegalizeMutation llvm::LegalizeMutations::changeElementTo (unsigned TypeIdx, unsigned FromTypeIdx)
Keep the same scalar or element type as the given type index. More...

LegalizeMutation llvm::LegalizeMutations::changeElementTo (unsigned TypeIdx, LLT Ty)
Keep the same scalar or element type as the given type. More...

LegalizeMutation llvm::LegalizeMutations::changeElementCountTo (unsigned TypeIdx, unsigned FromTypeIdx)
Keep the same scalar or element type as TypeIdx, but take the number of elements from FromTypeIdx. More...

LegalizeMutation llvm::LegalizeMutations::changeElementCountTo (unsigned TypeIdx, LLT Ty)
Keep the same scalar or element type as TypeIdx, but take the number of elements from Ty. More...

LegalizeMutation llvm::LegalizeMutations::changeElementSizeTo (unsigned TypeIdx, unsigned FromTypeIdx)
Change the scalar size or element size to have the same scalar size as type index FromIndex. More...

LegalizeMutation llvm::LegalizeMutations::widenScalarOrEltToNextPow2 (unsigned TypeIdx, unsigned Min=0)
Widen the scalar type or vector element type for the given type index to the next power of 2. More...

LegalizeMutation llvm::LegalizeMutations::widenScalarOrEltToNextMultipleOf (unsigned TypeIdx, unsigned Size)
Widen the scalar type or vector element type for the given type index to next multiple of Size. More...

LegalizeMutation llvm::LegalizeMutations::moreElementsToNextPow2 (unsigned TypeIdx, unsigned Min=0)
Add more elements to the type for the given type index to the next power of. More...

LegalizeMutation llvm::LegalizeMutations::scalarize (unsigned TypeIdx)
Break up the vector type for the given type index into the element type. More...

const MachineInstrllvm::machineFunctionIsIllegal (const MachineFunction &MF)
Checks that MIR is fully legal, returns an illegal instruction if it's not, nullptr otherwise. More...

## Variables

cl::opt< bool > llvm::DisableGISelLegalityCheck

## Detailed Description

Interface for Targets to specify which operations they can successfully select and how the others should be expanded most efficiently.

Definition in file LegalizerInfo.h.