MLIR 24.0.0git
ArmSME.cpp
Go to the documentation of this file.
1//===- ArmSMEDialect.cpp - MLIR ArmSME dialect implementation -------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file implements the ArmSME dialect and its operations.
10//
11//===----------------------------------------------------------------------===//
12
16#include "llvm/ADT/TypeSwitch.h"
17
18using namespace mlir;
19using namespace mlir::arm_sme;
20
21namespace mlir::arm_sme::detail {
25} // namespace mlir::arm_sme::detail
26
27//===----------------------------------------------------------------------===//
28// Tablegen Definitions
29//===----------------------------------------------------------------------===//
30
31#include "mlir/Dialect/ArmSME/IR/ArmSMEDialect.cpp.inc"
32
33#include "mlir/Dialect/ArmSME/IR/ArmSMEEnums.cpp.inc"
34
35#include "mlir/Dialect/ArmSME/IR/ArmSMEOpInterfaces.cpp.inc"
36
37#define GET_OP_CLASSES
38#include "mlir/Dialect/ArmSME/IR/ArmSMEOps.cpp.inc"
39
40#define GET_OP_CLASSES
41#include "mlir/Dialect/ArmSME/IR/ArmSMEIntrinsicOps.cpp.inc"
42
43#define GET_TYPEDEF_CLASSES
44#include "mlir/Dialect/ArmSME/IR/ArmSMETypes.cpp.inc"
45
46#define GET_ATTRDEF_CLASSES
47#include "mlir/Dialect/ArmSME/IR/ArmSMEAttrDefs.cpp.inc"
48
49//===----------------------------------------------------------------------===//
50// TileLoadOp / TileStoreOp
51//===----------------------------------------------------------------------===//
52
53// The slice of memory loaded/stored by tile_load/tile_store is read/written
54// one contiguous row (tile slice) at a time, along the memref's most minor
55// dimension, so that dimension must have unit stride.
56LogicalResult TileLoadOp::verify() {
57 if (!getMemRefType().isLastDimUnitStride())
58 return emitOpError("most minor dimension of memref must have unit stride");
59 return success();
60}
61
62LogicalResult TileStoreOp::verify() {
63 if (!getMemRefType().isLastDimUnitStride())
64 return emitOpError("most minor dimension of memref must have unit stride");
65 return success();
66}
67
68void ArmSMEDialect::initialize() {
69 addAttributes<
70#define GET_ATTRDEF_LIST
71#include "mlir/Dialect/ArmSME/IR/ArmSMEAttrDefs.cpp.inc"
72 >();
73
74 addOperations<
75#define GET_OP_LIST
76#include "mlir/Dialect/ArmSME/IR/ArmSMEOps.cpp.inc"
77 ,
78#define GET_OP_LIST
79#include "mlir/Dialect/ArmSME/IR/ArmSMEIntrinsicOps.cpp.inc"
80 >();
81}
return success()
p<< " : "<< getMemRefType()<< ", "<< getType();}static LogicalResult verifyVectorMemoryOp(Operation *op, MemRefType memrefType, VectorType vectorType) { if(memrefType.getElementType() !=vectorType.getElementType()) return op-> emitOpError("requires memref and vector types of the same elemental type")
Given a list of lists of parsed operands, populates uniqueOperands with unique operands.
Operation is the basic unit of execution within MLIR.
Definition Operation.h:87
LogicalResult verifyArmSMETileOpInterface(Operation *)
Definition ArmSME.cpp:22
LogicalResult verifyOperationHasValidTileId(Operation *)
Verifies the tile ID (if set) on this tile operation is valid.
Definition Utils.cpp:74
MemRefType getMemRefType(T &&t)
Convenience method to abbreviate casting getType().
Include the generated interface declarations.