MLIR 24.0.0git
mlir::pdll::ast::PatternDecl Class Reference

This Decl represents a single Pattern. More...

#include "mlir/Tools/PDLL/AST/Nodes.h"

Inheritance diagram for mlir::pdll::ast::PatternDecl:

Public Member Functions

std::optional< uint16_t > getBenefit () const
 Return the benefit of this pattern if specified, or std::nullopt.
bool hasBoundedRewriteRecursion () const
 Return if this pattern has bounded rewrite recursion.
const CompoundStmt * getBody () const
 Return the body of this pattern.
const OpRewriteStmt * getRootRewriteStmt () const
 Return the root rewrite statement of this pattern.
Public Member Functions inherited from mlir::pdll::ast::Decl
const Name * getName () const
 Return the name of the decl, or nullptr if it doesn't have one.
void setDocComment (Context &ctx, StringRef comment)
 Set the documentation comment for this decl.
std::optional< StringRef > getDocComment () const
 Return the documentation comment attached to this decl if it has been set.
Public Member Functions inherited from mlir::pdll::ast::Node
TypeID getTypeID () const
 Return the type identifier of this node.
SMRange getLoc () const
 Return the location of this node.
void print (raw_ostream &os) const
 Print this node to the given stream.
void walk (function_ref< void(const Node *)> walkFn) const
 Walk all of the nodes including, and nested under, this node in pre-order.
template<typename WalkFnT, typename ArgT = typename llvm::function_traits< WalkFnT>::template arg_t<0>>
std::enable_if_t<!std::is_convertible< const Node *, ArgT >::value > walk (WalkFnT &&walkFn) const

Static Public Member Functions

static PatternDecl * create (Context &ctx, SMRange location, const Name *name, std::optional< uint16_t > benefit, bool hasBoundedRecursion, const CompoundStmt *body)
Static Public Member Functions inherited from mlir::pdll::ast::Node::NodeBase< PatternDecl, Decl >
static bool classof (const Node *node)
 Provide type casting support.
Static Public Member Functions inherited from mlir::pdll::ast::Decl
static bool classof (const Node *node)
 Provide type casting support.

Additional Inherited Members

Public Types inherited from mlir::pdll::ast::Node::NodeBase< PatternDecl, Decl >
using Base
Protected Member Functions inherited from mlir::pdll::ast::Node::NodeBase< PatternDecl, Decl >
 NodeBase (SMRange loc, Args &&...args)
Protected Member Functions inherited from mlir::pdll::ast::Decl
 Decl (TypeID typeID, SMRange loc, const Name *name=nullptr)
Protected Member Functions inherited from mlir::pdll::ast::Node
 Node (TypeID typeID, SMRange loc)

Detailed Description

This Decl represents a single Pattern.

Definition at line 1043 of file Nodes.h.

Member Function Documentation

◆ create()

PatternDecl * PatternDecl::create ( Context & ctx,
SMRange location,
const Name * name,
std::optional< uint16_t > benefit,
bool hasBoundedRecursion,
const CompoundStmt * body )
static

Definition at line 513 of file Nodes.cpp.

References mlir::pdll::ast::Context::getAllocator().

◆ getBenefit()

std::optional< uint16_t > mlir::pdll::ast::PatternDecl::getBenefit ( ) const
inline

Return the benefit of this pattern if specified, or std::nullopt.

Definition at line 1051 of file Nodes.h.

◆ getBody()

const CompoundStmt * mlir::pdll::ast::PatternDecl::getBody ( ) const
inline

Return the body of this pattern.

Definition at line 1057 of file Nodes.h.

◆ getRootRewriteStmt()

const OpRewriteStmt * mlir::pdll::ast::PatternDecl::getRootRewriteStmt ( ) const
inline

Return the root rewrite statement of this pattern.

Definition at line 1060 of file Nodes.h.

◆ hasBoundedRewriteRecursion()

bool mlir::pdll::ast::PatternDecl::hasBoundedRewriteRecursion ( ) const
inline

Return if this pattern has bounded rewrite recursion.

Definition at line 1054 of file Nodes.h.


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