MLIR  21.0.0git
Typedefs | Functions
mlir::op_definition_impl Namespace Reference

Typedefs

template<typename T , typename... Args>
using has_single_result_fold_trait = decltype(T::foldTrait(std::declval< Operation * >(), std::declval< ArrayRef< Attribute > >()))
 Trait to check if T provides a 'foldTrait' method for single result operations. More...
 
template<typename T >
using detect_has_single_result_fold_trait = llvm::is_detected< has_single_result_fold_trait, T >
 
template<typename T , typename... Args>
using has_fold_trait = decltype(T::foldTrait(std::declval< Operation * >(), std::declval< ArrayRef< Attribute > >(), std::declval< SmallVectorImpl< OpFoldResult > & >()))
 Trait to check if T provides a general 'foldTrait' method. More...
 
template<typename T >
using detect_has_fold_trait = llvm::is_detected< has_fold_trait, T >
 
template<typename T >
using detect_has_any_fold_trait = std::disjunction< detect_has_fold_trait< T >, detect_has_single_result_fold_trait< T > >
 Trait to check if T provides any foldTrait method. More...
 
template<typename T , typename... Args>
using has_verify_trait = decltype(T::verifyTrait(std::declval< Operation * >()))
 Trait to check if T provides a verifyTrait method. More...
 
template<typename T >
using detect_has_verify_trait = llvm::is_detected< has_verify_trait, T >
 
template<typename T , typename... Args>
using has_verify_region_trait = decltype(T::verifyRegionTrait(std::declval< Operation * >()))
 Trait to check if T provides a verifyTrait method. More...
 
template<typename T >
using detect_has_verify_region_trait = llvm::is_detected< has_verify_region_trait, T >
 

Functions

template<template< typename T > class... Traits>
bool hasTrait (TypeID traitID)
 Returns true if this given Trait ID matches the IDs of any of the provided trait types Traits. More...
 
template<>
bool hasTrait (TypeID traitID)
 
template<typename Trait >
static std::enable_if_t< detect_has_single_result_fold_trait< Trait >::value, LogicalResult > foldTrait (Operation *op, ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results)
 Returns the result of folding a trait that implements a foldTrait function that is specialized for operations that have a single result. More...
 
template<typename Trait >
static std::enable_if_t< detect_has_fold_trait< Trait >::value, LogicalResult > foldTrait (Operation *op, ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results)
 Returns the result of folding a trait that implements a generalized foldTrait function that is supports any operation type. More...
 
template<typename Trait >
static std::enable_if_t<!detect_has_any_fold_trait< Trait >::value, LogicalResult > foldTrait (Operation *, ArrayRef< Attribute >, SmallVectorImpl< OpFoldResult > &)
 
template<typename... Ts>
static LogicalResult foldTraits (Operation *op, ArrayRef< Attribute > operands, SmallVectorImpl< OpFoldResult > &results)
 Given a tuple type containing a set of traits, return the result of folding the given operation. More...
 
template<typename T >
std::enable_if_t< detect_has_verify_trait< T >::value, LogicalResult > verifyTrait (Operation *op)
 Verify the given trait if it provides a verifier. More...
 
template<typename T >
std::enable_if_t<!detect_has_verify_trait< T >::value, LogicalResult > verifyTrait (Operation *)
 
template<typename... Ts>
LogicalResult verifyTraits (Operation *op)
 Given a set of traits, return the result of verifying the given operation. More...
 
template<typename T >
std::enable_if_t< detect_has_verify_region_trait< T >::value, LogicalResult > verifyRegionTrait (Operation *op)
 Verify the given trait if it provides a region verifier. More...
 
template<typename T >
std::enable_if_t<!detect_has_verify_region_trait< T >::value, LogicalResult > verifyRegionTrait (Operation *)
 
template<typename... Ts>
LogicalResult verifyRegionTraits (Operation *op)
 Given a set of traits, return the result of verifying the regions of the given operation. More...
 

Typedef Documentation

◆ detect_has_any_fold_trait

Trait to check if T provides any foldTrait method.

Definition at line 1554 of file OpDefinition.h.

◆ detect_has_fold_trait

template<typename T >
using mlir::op_definition_impl::detect_has_fold_trait = typedef llvm::is_detected<has_fold_trait, T>

Definition at line 1551 of file OpDefinition.h.

◆ detect_has_single_result_fold_trait

template<typename T >
using mlir::op_definition_impl::detect_has_single_result_fold_trait = typedef llvm::is_detected<has_single_result_fold_trait, T>

Definition at line 1542 of file OpDefinition.h.

◆ detect_has_verify_region_trait

template<typename T >
using mlir::op_definition_impl::detect_has_verify_region_trait = typedef llvm::is_detected<has_verify_region_trait, T>

Definition at line 1619 of file OpDefinition.h.

◆ detect_has_verify_trait

template<typename T >
using mlir::op_definition_impl::detect_has_verify_trait = typedef llvm::is_detected<has_verify_trait, T>

Definition at line 1612 of file OpDefinition.h.

◆ has_fold_trait

template<typename T , typename... Args>
using mlir::op_definition_impl::has_fold_trait = typedef decltype(T::foldTrait(std::declval<Operation *>(), std::declval<ArrayRef<Attribute> >(), std::declval<SmallVectorImpl<OpFoldResult> &>()))

Trait to check if T provides a general 'foldTrait' method.

Definition at line 1546 of file OpDefinition.h.

◆ has_single_result_fold_trait

template<typename T , typename... Args>
using mlir::op_definition_impl::has_single_result_fold_trait = typedef decltype(T::foldTrait( std::declval<Operation *>(), std::declval<ArrayRef<Attribute> >()))

Trait to check if T provides a 'foldTrait' method for single result operations.

Definition at line 1539 of file OpDefinition.h.

◆ has_verify_region_trait

template<typename T , typename... Args>
using mlir::op_definition_impl::has_verify_region_trait = typedef decltype(T::verifyRegionTrait(std::declval<Operation *>()))

Trait to check if T provides a verifyTrait method.

Definition at line 1616 of file OpDefinition.h.

◆ has_verify_trait

template<typename T , typename... Args>
using mlir::op_definition_impl::has_verify_trait = typedef decltype(T::verifyTrait(std::declval<Operation *>()))

Trait to check if T provides a verifyTrait method.

Definition at line 1610 of file OpDefinition.h.

Function Documentation

◆ foldTrait() [1/3]

template<typename Trait >
static std::enable_if_t<!detect_has_any_fold_trait<Trait>::value, LogicalResult> mlir::op_definition_impl::foldTrait ( Operation ,
ArrayRef< Attribute ,
SmallVectorImpl< OpFoldResult > &   
)
inlinestatic

Definition at line 1593 of file OpDefinition.h.

Referenced by foldTrait().

◆ foldTrait() [2/3]

template<typename Trait >
static std::enable_if_t<detect_has_single_result_fold_trait<Trait>::value, LogicalResult> mlir::op_definition_impl::foldTrait ( Operation op,
ArrayRef< Attribute operands,
SmallVectorImpl< OpFoldResult > &  results 
)
static

Returns the result of folding a trait that implements a foldTrait function that is specialized for operations that have a single result.

Definition at line 1563 of file OpDefinition.h.

References foldTrait(), mlir::Operation::getResult(), and mlir::Operation::hasTrait().

◆ foldTrait() [3/3]

template<typename Trait >
static std::enable_if_t<detect_has_fold_trait<Trait>::value, LogicalResult> mlir::op_definition_impl::foldTrait ( Operation op,
ArrayRef< Attribute operands,
SmallVectorImpl< OpFoldResult > &  results 
)
static

Returns the result of folding a trait that implements a generalized foldTrait function that is supports any operation type.

Definition at line 1584 of file OpDefinition.h.

References foldTrait().

◆ foldTraits()

template<typename... Ts>
static LogicalResult mlir::op_definition_impl::foldTraits ( Operation op,
ArrayRef< Attribute operands,
SmallVectorImpl< OpFoldResult > &  results 
)
static

Given a tuple type containing a set of traits, return the result of folding the given operation.

Definition at line 1600 of file OpDefinition.h.

◆ hasTrait() [1/2]

template<template< typename T > class... Traits>
bool mlir::op_definition_impl::hasTrait ( TypeID  traitID)
inline

Returns true if this given Trait ID matches the IDs of any of the provided trait types Traits.

Definition at line 1521 of file OpDefinition.h.

Referenced by mlir::arith::AttrConverterConstrainedFPToLLVM< SourceOp, TargetOp >::AttrConverterConstrainedFPToLLVM().

◆ hasTrait() [2/2]

template<>
bool mlir::op_definition_impl::hasTrait ( TypeID  traitID)
inline

◆ verifyRegionTrait() [1/2]

template<typename T >
std::enable_if_t<!detect_has_verify_region_trait<T>::value, LogicalResult> mlir::op_definition_impl::verifyRegionTrait ( Operation )
inline

Definition at line 1649 of file OpDefinition.h.

Referenced by verifyRegionTrait().

◆ verifyRegionTrait() [2/2]

template<typename T >
std::enable_if_t<detect_has_verify_region_trait<T>::value, LogicalResult> mlir::op_definition_impl::verifyRegionTrait ( Operation op)

Verify the given trait if it provides a region verifier.

Definition at line 1643 of file OpDefinition.h.

References verifyRegionTrait().

◆ verifyRegionTraits()

template<typename... Ts>
LogicalResult mlir::op_definition_impl::verifyRegionTraits ( Operation op)

Given a set of traits, return the result of verifying the regions of the given operation.

Definition at line 1656 of file OpDefinition.h.

◆ verifyTrait() [1/2]

template<typename T >
std::enable_if_t<!detect_has_verify_trait<T>::value, LogicalResult> mlir::op_definition_impl::verifyTrait ( Operation )
inline

Definition at line 1630 of file OpDefinition.h.

Referenced by verifyTrait().

◆ verifyTrait() [2/2]

template<typename T >
std::enable_if_t<detect_has_verify_trait<T>::value, LogicalResult> mlir::op_definition_impl::verifyTrait ( Operation op)

Verify the given trait if it provides a verifier.

Definition at line 1625 of file OpDefinition.h.

References verifyTrait().

◆ verifyTraits()

template<typename... Ts>
LogicalResult mlir::op_definition_impl::verifyTraits ( Operation op)

Given a set of traits, return the result of verifying the given operation.

Definition at line 1636 of file OpDefinition.h.