MLIR 22.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
16#include "mlir/IR/Builders.h"
18
19using namespace mlir;
20using namespace mlir::arm_sve;
21
22//===----------------------------------------------------------------------===//
23// ScalableVector versions of general helpers for comparison ops
24//===----------------------------------------------------------------------===//
25
26/// Return the scalable vector of the same shape and containing i1.
27static Type getI1SameShape(Type type) {
28 auto i1Type = IntegerType::get(type.getContext(), 1);
29 if (auto sVectorType = llvm::dyn_cast<VectorType>(type))
30 return VectorType::get(sVectorType.getShape(), i1Type,
31 sVectorType.getScalableDims());
32 return nullptr;
33}
34
35//===----------------------------------------------------------------------===//
36// Tablegen Definitions
37//===----------------------------------------------------------------------===//
38
39#include "mlir/Dialect/ArmSVE/IR/ArmSVEDialect.cpp.inc"
40
41#define GET_OP_CLASSES
42#include "mlir/Dialect/ArmSVE/IR/ArmSVE.cpp.inc"
43
44#define GET_TYPEDEF_CLASSES
45#include "mlir/Dialect/ArmSVE/IR/ArmSVETypes.cpp.inc"
46
47void ArmSVEDialect::initialize() {
48 addOperations<
49#define GET_OP_LIST
50#include "mlir/Dialect/ArmSVE/IR/ArmSVE.cpp.inc"
51 >();
52}
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.