LLVM 20.0.0git
Classes | Namespaces | Typedefs | Enumerations | Functions | Variables
LegalizerInfo.h File Reference

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

#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/CodeGenTypes/LowLevelType.h"
#include "llvm/MC/MCInstrDesc.h"
#include "llvm/Support/AtomicOrdering.h"
#include "llvm/Support/CommandLine.h"
#include <cassert>
#include <cstdint>
#include <tuple>
#include <utility>

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

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::LegalizeActions
 
namespace  llvm::LegalityPredicates
 
namespace  llvm::LegalizeMutations
 

Typedefs

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

Enumerations

enum  llvm::LegalizeActions::LegalizeAction : std::uint8_t {
  llvm::LegalizeActions::Legal , llvm::LegalizeActions::NarrowScalar , llvm::LegalizeActions::WidenScalar , llvm::LegalizeActions::FewerElements ,
  llvm::LegalizeActions::MoreElements , llvm::LegalizeActions::Bitcast , llvm::LegalizeActions::Lower , llvm::LegalizeActions::Libcall ,
  llvm::LegalizeActions::Custom , llvm::LegalizeActions::Unsupported , llvm::LegalizeActions::NotFound , llvm::LegalizeActions::UseLegacyRules
}
 

Functions

raw_ostream & llvm::operator<< (raw_ostream &OS, LegalizeActions::LegalizeAction Action)
 
template<typename Predicate >
Predicate llvm::LegalityPredicates::predNot (Predicate P)
 True iff P is false.
 
template<typename Predicate >
Predicate llvm::LegalityPredicates::all (Predicate P0, Predicate P1)
 True iff P0 and P1 are true.
 
template<typename Predicate , typename... Args>
Predicate llvm::LegalityPredicates::all (Predicate P0, Predicate P1, Args... args)
 True iff all given predicates are true.
 
template<typename Predicate >
Predicate llvm::LegalityPredicates::any (Predicate P0, Predicate P1)
 True iff P0 or P1 are true.
 
template<typename Predicate , typename... Args>
Predicate llvm::LegalityPredicates::any (Predicate P0, Predicate P1, Args... args)
 True iff any given predicates are true.
 
LegalityPredicate llvm::LegalityPredicates::typeIs (unsigned TypeIdx, LLT TypesInit)
 True iff the given type index is the specified type.
 
LegalityPredicate llvm::LegalityPredicates::typeInSet (unsigned TypeIdx, std::initializer_list< LLT > TypesInit)
 True iff the given type index is one of the specified types.
 
LegalityPredicate llvm::LegalityPredicates::typeIsNot (unsigned TypeIdx, LLT Type)
 True iff the given type index is not the specified type.
 
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.
 
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.
 
LegalityPredicate llvm::LegalityPredicates::isScalar (unsigned TypeIdx)
 True iff the specified type index is a scalar.
 
LegalityPredicate llvm::LegalityPredicates::isVector (unsigned TypeIdx)
 True iff the specified type index is a vector.
 
LegalityPredicate llvm::LegalityPredicates::isPointer (unsigned TypeIdx)
 True iff the specified type index is a pointer (with any address space).
 
LegalityPredicate llvm::LegalityPredicates::isPointer (unsigned TypeIdx, unsigned AddrSpace)
 True iff the specified type index is a pointer with the specified address space.
 
LegalityPredicate llvm::LegalityPredicates::elementTypeIs (unsigned TypeIdx, LLT EltTy)
 True if the type index is a vector with element type EltTy.
 
LegalityPredicate llvm::LegalityPredicates::scalarNarrowerThan (unsigned TypeIdx, unsigned Size)
 True iff the specified type index is a scalar that's narrower than the given size.
 
LegalityPredicate llvm::LegalityPredicates::scalarWiderThan (unsigned TypeIdx, unsigned Size)
 True iff the specified type index is a scalar that's wider than the given size.
 
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.
 
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.
 
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.
 
LegalityPredicate llvm::LegalityPredicates::sizeNotPow2 (unsigned TypeIdx)
 True iff the specified type index is a scalar whose size is not a power of.
 
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.
 
LegalityPredicate llvm::LegalityPredicates::sizeIs (unsigned TypeIdx, unsigned Size)
 True if the total bitwidth of the specified type index is Size bits.
 
LegalityPredicate llvm::LegalityPredicates::sameSize (unsigned TypeIdx0, unsigned TypeIdx1)
 True iff the specified type indices are both the same bit size.
 
LegalityPredicate llvm::LegalityPredicates::largerThan (unsigned TypeIdx0, unsigned TypeIdx1)
 True iff the first type index has a larger total bit size than second type index.
 
LegalityPredicate llvm::LegalityPredicates::smallerThan (unsigned TypeIdx0, unsigned TypeIdx1)
 True iff the first type index has a smaller total bit size than second type index.
 
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.
 
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.
 
LegalityPredicate llvm::LegalityPredicates::numElementsNotPow2 (unsigned TypeIdx)
 True iff the specified type index is a vector whose element count is not a power of 2.
 
LegalityPredicate llvm::LegalityPredicates::atomicOrderingAtLeastOrStrongerThan (unsigned MMOIdx, AtomicOrdering Ordering)
 True iff the specified MMO index has at an atomic ordering of at Ordering or stronger.
 
LegalizeMutation llvm::LegalizeMutations::changeTo (unsigned TypeIdx, LLT Ty)
 Select this specific type for the given type index.
 
LegalizeMutation llvm::LegalizeMutations::changeTo (unsigned TypeIdx, unsigned FromTypeIdx)
 Keep the same type as the given type index.
 
LegalizeMutation llvm::LegalizeMutations::changeElementTo (unsigned TypeIdx, unsigned FromTypeIdx)
 Keep the same scalar or element type as the given type index.
 
LegalizeMutation llvm::LegalizeMutations::changeElementTo (unsigned TypeIdx, LLT Ty)
 Keep the same scalar or element type as the given type.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
LegalizeMutation llvm::LegalizeMutations::scalarize (unsigned TypeIdx)
 Break up the vector type for the given type index into the element type.
 
const MachineInstrllvm::machineFunctionIsIllegal (const MachineFunction &MF)
 Checks that MIR is fully legal, returns an illegal instruction if it's not, nullptr otherwise.
 

Variables

cl::opt< boolllvm::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.