MLIR  20.0.0git
Public Types | Static Public Member Functions | List of all members
mlir::linalg::RegionMatcher Struct Reference

A struct containing common matchers over linalg op's region. More...

#include "mlir/Dialect/Linalg/Utils/Utils.h"

Public Types

enum class  BinaryOpKind { IAdd }
 

Static Public Member Functions

static std::optional< BinaryOpKindmatchAsScalarBinaryOp (GenericOp op)
 Matches the given linalg op if its body is performing binary operation on int or float scalar values and returns the binary op kind. More...
 

Detailed Description

A struct containing common matchers over linalg op's region.

Definition at line 323 of file Utils.h.

Member Enumeration Documentation

◆ BinaryOpKind

Enumerator
IAdd 

Definition at line 324 of file Utils.h.

Member Function Documentation

◆ matchAsScalarBinaryOp()

std::optional< RegionMatcher::BinaryOpKind > RegionMatcher::matchAsScalarBinaryOp ( GenericOp  op)
static

Matches the given linalg op if its body is performing binary operation on int or float scalar values and returns the binary op kind.

The linalg op's region is expected to be

{
^bb(%a: <scalar-type>, %b: <scalar-type>):
%0 = <binary-op> %a, %b: <scalar-type>
linalg.yield %0: <scalar-type>
}

Definition at line 96 of file Utils.cpp.

References mlir::Block::front(), mlir::Block::getArgument(), mlir::Block::getNumArguments(), mlir::Block::getOperations(), mlir::Value::getType(), mlir::Type::isSignlessIntOrFloat(), mlir::matchers::m_Val(), and mlir::Block::without_terminator().


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