MLIR  15.0.0git
Public Member Functions | Static Public Member Functions | List of all members
mlir::PatternBenefit Class Reference

This class represents the benefit of a pattern match in a unitless scheme that ranges from 0 (very little benefit) to 65K. More...

#include "mlir/IR/PatternMatch.h"

Public Member Functions

 PatternBenefit ()=default
 
 PatternBenefit (unsigned benefit)
 
 PatternBenefit (const PatternBenefit &)=default
 
PatternBenefitoperator= (const PatternBenefit &)=default
 
bool isImpossibleToMatch () const
 
unsigned short getBenefit () const
 If the corresponding pattern can match, return its benefit. If the. More...
 
bool operator== (const PatternBenefit &rhs) const
 
bool operator!= (const PatternBenefit &rhs) const
 
bool operator< (const PatternBenefit &rhs) const
 
bool operator> (const PatternBenefit &rhs) const
 
bool operator<= (const PatternBenefit &rhs) const
 
bool operator>= (const PatternBenefit &rhs) const
 

Static Public Member Functions

static PatternBenefit impossibleToMatch ()
 

Detailed Description

This class represents the benefit of a pattern match in a unitless scheme that ranges from 0 (very little benefit) to 65K.

The most common unit to use here is the "number of operations matched" by the pattern.

This also has a sentinel representation that can be used for patterns that fail to match.

Definition at line 32 of file PatternMatch.h.

Constructor & Destructor Documentation

◆ PatternBenefit() [1/3]

mlir::PatternBenefit::PatternBenefit ( )
default

Referenced by impossibleToMatch().

◆ PatternBenefit() [2/3]

PatternBenefit::PatternBenefit ( unsigned  benefit)

Definition at line 18 of file PatternMatch.cpp.

◆ PatternBenefit() [3/3]

mlir::PatternBenefit::PatternBenefit ( const PatternBenefit )
default

Member Function Documentation

◆ getBenefit()

unsigned short PatternBenefit::getBenefit ( ) const

If the corresponding pattern can match, return its benefit. If the.

Definition at line 23 of file PatternMatch.cpp.

References isImpossibleToMatch().

Referenced by mlir::detail::PDLByteCodePattern::create(), executeGetOperandsResults(), isImpossibleToMatch(), and mlir::linalg::populatePadOpVectorizationPatterns().

◆ impossibleToMatch()

static PatternBenefit mlir::PatternBenefit::impossibleToMatch ( )
inlinestatic

Definition at line 41 of file PatternMatch.h.

References PatternBenefit().

Referenced by isImpossibleToMatch(), and mlir::ConversionPattern::matchAndRewrite().

◆ isImpossibleToMatch()

bool mlir::PatternBenefit::isImpossibleToMatch ( ) const
inline

◆ operator!=()

bool mlir::PatternBenefit::operator!= ( const PatternBenefit rhs) const
inline

Definition at line 51 of file PatternMatch.h.

◆ operator<()

bool mlir::PatternBenefit::operator< ( const PatternBenefit rhs) const
inline

Definition at line 52 of file PatternMatch.h.

◆ operator<=()

bool mlir::PatternBenefit::operator<= ( const PatternBenefit rhs) const
inline

Definition at line 56 of file PatternMatch.h.

◆ operator=()

PatternBenefit& mlir::PatternBenefit::operator= ( const PatternBenefit )
default

◆ operator==()

bool mlir::PatternBenefit::operator== ( const PatternBenefit rhs) const
inline

Definition at line 48 of file PatternMatch.h.

◆ operator>()

bool mlir::PatternBenefit::operator> ( const PatternBenefit rhs) const
inline

Definition at line 55 of file PatternMatch.h.

◆ operator>=()

bool mlir::PatternBenefit::operator>= ( const PatternBenefit rhs) const
inline

Definition at line 57 of file PatternMatch.h.


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