15#include "llvm/ADT/STLExtras.h"
16#include "llvm/ADT/SmallVectorExtras.h"
17#include "llvm/ADT/StringSwitch.h"
26 <<
"expected inner_tile_alignments entries to be one of 0 "
27 "(Unknown), 1 (Multiple) or 2 (Equal), but got "
34 return llvm::map_to_vector(alignments, [](
int64_t v) {
36 "invalid InnerTileAlignment; should be rejected by the verifier");
50 llvm_unreachable(
"unknown InnerTileAlignment");
53std::optional<InnerTileAlignment>
59 .Default(std::nullopt);
70 std::optional<InnerTileAlignment> alignment =
74 <<
"expected one of 'Unknown', 'Multiple' or 'Equal', but got '"
76 values.push_back(
static_cast<int64_t>(*alignment));
89 printer << stringifyInnerTileAlignment(
90 static_cast<InnerTileAlignment>(value));
95#include "mlir/Interfaces/TilingInterface.cpp.inc"
static LogicalResult parseEntry(EncodingReader &reader, RangeT &entries, T &entry, StringRef entryStr)
Parse and resolve an index into the given entry list.
@ Square
Square brackets surrounding zero or more operands.
virtual ParseResult parseCommaSeparatedList(Delimiter delimiter, function_ref< ParseResult()> parseElementFn, StringRef contextMessage=StringRef())=0
Parse a list of comma-separated items with an optional delimiter.
MLIRContext * getContext() const
virtual InFlightDiagnostic emitError(SMLoc loc, const Twine &message={})=0
Emit a diagnostic at the specified location and return failure.
virtual SMLoc getCurrentLocation()=0
Get the location of the next token and store it into the argument.
ParseResult parseKeyword(StringRef keyword)
Parse a given keyword.
The OpAsmParser has methods for interacting with the asm parser: parsing things from it,...
This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom p...
Operation is the basic unit of execution within MLIR.
InFlightDiagnostic emitOpError(const Twine &message={})
Emit an error with the op name prefixed, like "'dim' op " which is convenient for verifiers.
static DenseArrayAttrImpl get(MLIRContext *context, ArrayRef< int64_t > content)
ArrayRef< T > asArrayRef() const
Include the generated interface declarations.
bool isValidInnerTileAlignment(int64_t value)
Returns true iff value is a valid InnerTileAlignment enumerator.
detail::DenseArrayAttrImpl< int64_t > DenseI64ArrayAttr
void printInnerTileAlignmentArray(OpAsmPrinter &printer, Operation *op, DenseI64ArrayAttr alignments)
ParseResult parseInnerTileAlignmentArray(OpAsmParser &parser, DenseI64ArrayAttr &alignments)
Custom directive parser/printer for an inner_tile_alignments attribute, rendering the DenseI64ArrayAt...
std::optional< InnerTileAlignment > symbolizeInnerTileAlignment(StringRef keyword)
Returns the InnerTileAlignment for a keyword spelling, or std::nullopt if keyword is not one of Unkno...
StringRef stringifyInnerTileAlignment(InnerTileAlignment alignment)
Returns the keyword spelling of an InnerTileAlignment (Unknown, Multiple or Equal) used by the inner_...
SmallVector< InnerTileAlignment > convertInnerTileAlignments(ArrayRef< int64_t > alignments)
Maps a validated inner_tile_alignments integer array onto the per-dimension InnerTileAlignment hints ...
LogicalResult verifyInnerTileAlignments(Operation *op, ArrayRef< int64_t > alignments)
Verifies that every entry of a raw inner_tile_alignments integer array is a valid InnerTileAlignment,...
InnerTileAlignment
Per-dimension alignment of a loop tile size to a linalg.pack / linalg.unpack inner tile size,...