MLIR 22.0.0git
MLProgramOps.cpp File Reference
#include "mlir/Dialect/MLProgram/IR/MLProgram.h"
#include "mlir/IR/Builders.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "mlir/Dialect/MLProgram/IR/MLProgramOps.cpp.inc"

Go to the source code of this file.

Macros

#define GET_OP_CLASSES

Functions

static ParseResult parseTokenOrdering (OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &consumeTokens, Type &produceTokenType)
 Parse and print an ordering clause for a variadic of consuming tokens and an producing token.
static void printTokenOrdering (OpAsmPrinter &p, Operation *op, OperandRange consumeTokens, Type produceTokenType)
static ParseResult parseTypedInitialValue (OpAsmParser &parser, TypeAttr &typeAttr, Attribute &attr)
 some.op custom<TypeOrAttr>($type, $attr)
static void printTypedInitialValue (OpAsmPrinter &p, Operation *op, TypeAttr type, Attribute attr)
static ParseResult parseSymbolVisibility (OpAsmParser &parser, StringAttr &symVisibilityAttr)
 some.op custom<SymbolVisibility>($sym_visibility) $sym_name -> some.op public @foo some.op private @foo
static void printSymbolVisibility (OpAsmPrinter &p, Operation *op, StringAttr symVisibilityAttr)

Macro Definition Documentation

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 141 of file MLProgramOps.cpp.

Function Documentation

◆ parseSymbolVisibility()

ParseResult parseSymbolVisibility ( OpAsmParser & parser,
StringAttr & symVisibilityAttr )
static

some.op custom<SymbolVisibility>($sym_visibility) $sym_name -> some.op public @foo some.op private @foo

Definition at line 116 of file MLProgramOps.cpp.

References mlir::AsmParser::emitError(), mlir::AsmParser::getBuilder(), mlir::AsmParser::getCurrentLocation(), mlir::Builder::getStringAttr(), mlir::AsmParser::parseOptionalKeyword(), and success().

◆ parseTokenOrdering()

ParseResult parseTokenOrdering ( OpAsmParser & parser,
SmallVectorImpl< OpAsmParser::UnresolvedOperand > & consumeTokens,
Type & produceTokenType )
static

Parse and print an ordering clause for a variadic of consuming tokens and an producing token.

Syntax: ordering(%0, %1 -> !ml_program.token) ordering(() -> !ml_program.token)

If both the consuming and producing token are not present on the op, then the clause prints nothing.

Definition at line 29 of file MLProgramOps.cpp.

References mlir::AsmParser::parseArrow(), mlir::AsmParser::parseLParen(), mlir::OpAsmParser::parseOperandList(), mlir::AsmParser::parseOptionalKeyword(), mlir::AsmParser::parseOptionalLParen(), mlir::AsmParser::parseRParen(), mlir::AsmParser::parseType(), and success().

◆ parseTypedInitialValue()

ParseResult parseTypedInitialValue ( OpAsmParser & parser,
TypeAttr & typeAttr,
Attribute & attr )
static

some.op custom<TypeOrAttr>($type, $attr)

Uninitialized: some.op : tensor<3xi32> Initialized to narrower type than op: some.op (dense<0> : tensor<3xi32>) : tensor<?xi32>

Definition at line 84 of file MLProgramOps.cpp.

References mlir::AsmParser::parseAttribute(), mlir::AsmParser::parseColonType(), mlir::AsmParser::parseOptionalLParen(), mlir::AsmParser::parseRParen(), and success().

◆ printSymbolVisibility()

void printSymbolVisibility ( OpAsmPrinter & p,
Operation * op,
StringAttr symVisibilityAttr )
static

Definition at line 129 of file MLProgramOps.cpp.

◆ printTokenOrdering()

void printTokenOrdering ( OpAsmPrinter & p,
Operation * op,
OperandRange consumeTokens,
Type produceTokenType )
static

◆ printTypedInitialValue()

void printTypedInitialValue ( OpAsmPrinter & p,
Operation * op,
TypeAttr type,
Attribute attr )
static

Definition at line 100 of file MLProgramOps.cpp.

References mlir::AsmPrinter::printAttribute().