MLIR 24.0.0git
ArmSVEDialect.cpp
Go to the documentation of this file.
1//===- ArmSVEDialect.cpp - MLIR ArmSVE 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 ArmSVE dialect and its operations.
10//
11//===----------------------------------------------------------------------===//
12
17
18using namespace mlir;
19using namespace mlir::arm_sve;
20
21//===----------------------------------------------------------------------===//
22// ScalableVector versions of general helpers for comparison ops
23//===----------------------------------------------------------------------===//
24
25/// Return the scalable vector of the same shape and containing i1.
26static Type getI1SameShape(Type type) {
27 auto i1Type = IntegerType::get(type.getContext(), 1);
28 if (auto sVectorType = llvm::dyn_cast<VectorType>(type))
29 return VectorType::get(sVectorType.getShape(), i1Type,
30 sVectorType.getScalableDims());
31 return nullptr;
32}
33
34//===----------------------------------------------------------------------===//
35// Tablegen Definitions
36//===----------------------------------------------------------------------===//
37
38#include "mlir/Dialect/ArmSVE/IR/ArmSVEDialect.cpp.inc"
39
40#define GET_OP_CLASSES
41#include "mlir/Dialect/ArmSVE/IR/ArmSVE.cpp.inc"
42
43#define GET_TYPEDEF_CLASSES
44#include "mlir/Dialect/ArmSVE/IR/ArmSVETypes.cpp.inc"
45
46void ArmSVEDialect::initialize() {
47 addOperations<
48#define GET_OP_LIST
49#include "mlir/Dialect/ArmSVE/IR/ArmSVE.cpp.inc"
50 >();
51}
static Type getI1SameShape(Type type)
Return the scalable vector of the same shape and containing i1.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
Definition Types.h:74
MLIRContext * getContext() const
Return the MLIRContext in which this type was uniqued.
Definition Types.cpp:35
Include the generated interface declarations.