MLIR  16.0.0git
Classes | Public Member Functions | List of all members
mlir::bufferization::OpFilter Class Reference

#include "mlir/Dialect/Bufferization/IR/BufferizableOpInterface.h"

Classes

struct  Entry
 An op filter entry. More...
 

Public Member Functions

bool isOpAllowed (Operation *op) const
 Return whether the op is allowed or not. More...
 
template<typename... DialectTs>
void allowDialect ()
 Allow the given dialects. More...
 
template<typename... DialectTs>
void denyDialect ()
 Deny the given dialects. More...
 
void allowDialect (StringRef dialectNamespace)
 Allow the given dialect. More...
 
template<typename... OpTys>
void allowOperation ()
 Allow the given ops. More...
 
template<typename... OpTys>
void denyOperation ()
 Deny the given ops. More...
 
void allowOperation (StringRef opName)
 Allow the given op. More...
 
void denyOperation (StringRef opName)
 Deny the given op. More...
 
void allowOperation (Entry::FilterFn fn)
 Allow ops that are matched by fn. More...
 
void denyOperation (Entry::FilterFn fn)
 Deny ops that are matched by fn. More...
 

Detailed Description

Definition at line 26 of file BufferizableOpInterface.h.

Member Function Documentation

◆ allowDialect() [1/2]

template<typename... DialectTs>
void mlir::bufferization::OpFilter::allowDialect ( )
inline

Allow the given dialects.

This function adds one or multiple ALLOW entries.

Definition at line 53 of file BufferizableOpInterface.h.

Referenced by denyOperation(), mlir::bufferization::getPartialBufferizationOptions(), and mlir::bufferization::populateEliminateBufferizeMaterializationsPatterns().

◆ allowDialect() [2/2]

void mlir::bufferization::OpFilter::allowDialect ( StringRef  dialectNamespace)
inline

Allow the given dialect.

This function adds an ALLOW entry.

Definition at line 70 of file BufferizableOpInterface.h.

◆ allowOperation() [1/3]

template<typename... OpTys>
void mlir::bufferization::OpFilter::allowOperation ( )
inline

Allow the given ops.

This function adds one or multiple ALLOW entries.

Definition at line 81 of file BufferizableOpInterface.h.

Referenced by allowOperation(), denyOperation(), mlir::bufferization::populateEliminateBufferizeMaterializationsPatterns(), and mlir::sparse_tensor::BufferizeDenseOpsPass::runOnOperation().

◆ allowOperation() [2/3]

void mlir::bufferization::OpFilter::allowOperation ( StringRef  opName)
inline

Allow the given op.

This function adds an ALLOW entry.

Definition at line 96 of file BufferizableOpInterface.h.

References allowOperation().

◆ allowOperation() [3/3]

void mlir::bufferization::OpFilter::allowOperation ( Entry::FilterFn  fn)
inline

Allow ops that are matched by fn.

This function adds an ALLOW entry.

Definition at line 116 of file BufferizableOpInterface.h.

References mlir::bufferization::OpFilter::Entry::fn.

◆ denyDialect()

template<typename... DialectTs>
void mlir::bufferization::OpFilter::denyDialect ( )
inline

Deny the given dialects.

This function adds one or multiple DENY entries.

Definition at line 63 of file BufferizableOpInterface.h.

Referenced by denyOperation().

◆ denyOperation() [1/3]

template<typename... OpTys>
void mlir::bufferization::OpFilter::denyOperation ( )
inline

Deny the given ops.

This function adds one or multiple DENY entries.

Definition at line 89 of file BufferizableOpInterface.h.

Referenced by denyOperation().

◆ denyOperation() [2/3]

void mlir::bufferization::OpFilter::denyOperation ( StringRef  opName)
inline

Deny the given op.

This function adds a DENY entry.

Definition at line 106 of file BufferizableOpInterface.h.

References denyOperation().

◆ denyOperation() [3/3]

void mlir::bufferization::OpFilter::denyOperation ( Entry::FilterFn  fn)
inline

Deny ops that are matched by fn.

This function adds a DENY entry.

Definition at line 123 of file BufferizableOpInterface.h.

References allowDialect(), allowOperation(), denyDialect(), denyOperation(), and mlir::bufferization::OpFilter::Entry::fn.

◆ isOpAllowed()

bool OpFilter::isOpAllowed ( Operation op) const

Return whether the op is allowed or not.

If the filter does not have an ALLOW rule, ops are allowed by default, unless they are explicitly marked as DENY. If the filter has at least one ALLOW rule, ops are denied by default and only allowed if they match an ALLOW rule and no DENY rule.

Definition at line 236 of file BufferizableOpInterface.cpp.

Referenced by mlir::bufferization::bufferizeOp(), hasTensorSemantics(), and mlir::bufferization::BufferizationOptions::isOpAllowed().


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