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

This class represents the base of a predicate matcher node. More...

#include "Conversion/PDLToPDLInterp/PredicateTree.h"

+ Inheritance diagram for mlir::pdl_to_pdl_interp::MatcherNode:

Public Member Functions

virtual ~MatcherNode ()=default
 
PositiongetPosition () const
 Returns the position on which the question predicate should be checked. More...
 
QualifiergetQuestion () const
 Returns the predicate checked on this node. More...
 
std::unique_ptr< MatcherNode > & getFailureNode ()
 Returns the node that should be visited if this, or a subsequent node fails. More...
 
void setFailureNode (std::unique_ptr< MatcherNode > node)
 Sets the node that should be visited if this, or a subsequent node fails. More...
 
TypeID getMatcherTypeID () const
 Returns the unique type ID of this matcher instance. More...
 

Static Public Member Functions

static std::unique_ptr< MatcherNodegenerateMatcherTree (ModuleOp module, PredicateBuilder &builder, DenseMap< Value, Position *> &valueToPosition)
 Given a module containing PDL pattern operations, generate a matcher tree using the patterns within the given module and return the root matcher node. More...
 

Protected Member Functions

 MatcherNode (TypeID matcherTypeID, Position *position=nullptr, Qualifier *question=nullptr, std::unique_ptr< MatcherNode > failureNode=nullptr)
 

Detailed Description

This class represents the base of a predicate matcher node.

Definition at line 50 of file PredicateTree.h.

Constructor & Destructor Documentation

◆ ~MatcherNode()

virtual mlir::pdl_to_pdl_interp::MatcherNode::~MatcherNode ( )
virtualdefault

◆ MatcherNode()

MatcherNode::MatcherNode ( TypeID  matcherTypeID,
Position position = nullptr,
Qualifier question = nullptr,
std::unique_ptr< MatcherNode failureNode = nullptr 
)
protected

Definition at line 969 of file PredicateTree.cpp.

Member Function Documentation

◆ generateMatcherTree()

std::unique_ptr< MatcherNode > MatcherNode::generateMatcherTree ( ModuleOp  module,
PredicateBuilder builder,
DenseMap< Value, Position *> &  valueToPosition 
)
static

Given a module containing PDL pattern operations, generate a matcher tree using the patterns within the given module and return the root matcher node.

valueToPosition is a map that is populated with the original pdl values and their corresponding positions in the matcher tree.

A pattern.

A root of the pattern chosen among the candidate roots in pdl.rewrite.

The extracted predicates for this pattern and root.

Definition at line 877 of file PredicateTree.cpp.

References buildPredicateList().

◆ getFailureNode()

std::unique_ptr<MatcherNode>& mlir::pdl_to_pdl_interp::MatcherNode::getFailureNode ( )
inline

Returns the node that should be visited if this, or a subsequent node fails.

Definition at line 70 of file PredicateTree.h.

◆ getMatcherTypeID()

TypeID mlir::pdl_to_pdl_interp::MatcherNode::getMatcherTypeID ( ) const
inline

Returns the unique type ID of this matcher instance.

This should not be used directly, and is provided to support type casting.

Definition at line 79 of file PredicateTree.h.

References mlir::pdl_to_pdl_interp::PositionalPredicate::position, and mlir::pdl_to_pdl_interp::PositionalPredicate::question.

Referenced by mlir::pdl_to_pdl_interp::BoolNode::classof(), mlir::pdl_to_pdl_interp::ExitNode::classof(), mlir::pdl_to_pdl_interp::SuccessNode::classof(), and mlir::pdl_to_pdl_interp::SwitchNode::classof().

◆ getPosition()

Position* mlir::pdl_to_pdl_interp::MatcherNode::getPosition ( ) const
inline

Returns the position on which the question predicate should be checked.

Definition at line 63 of file PredicateTree.h.

References mlir::pdl_to_pdl_interp::PositionalPredicate::position.

Referenced by isSamePredicate().

◆ getQuestion()

Qualifier* mlir::pdl_to_pdl_interp::MatcherNode::getQuestion ( ) const
inline

Returns the predicate checked on this node.

Definition at line 66 of file PredicateTree.h.

References mlir::pdl_to_pdl_interp::PositionalPredicate::question.

Referenced by createSwitchOp(), and isSamePredicate().

◆ setFailureNode()

void mlir::pdl_to_pdl_interp::MatcherNode::setFailureNode ( std::unique_ptr< MatcherNode node)
inline

Sets the node that should be visited if this, or a subsequent node fails.

Definition at line 73 of file PredicateTree.h.


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