From f33f8a2b30325d89c4b7daef1b7d11d6da38fd56 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 30 Sep 2020 13:26:25 +0200 Subject: [PATCH] Move AffineMapAttr into BaseOps.td AffineMapAttr is already part of base, it's just impossible to refer to it from ODS without pulling in the definition from Affine dialect. Differential Revision: https://reviews.llvm.org/D88555 --- mlir/include/mlir/Dialect/Affine/IR/AffineOps.td | 1 - .../mlir/Dialect/Affine/IR/AffineOpsBase.td | 32 ---------------------- .../mlir/Dialect/GPU/ParallelLoopMapperAttr.td | 1 - mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td | 1 - .../mlir/Dialect/Linalg/IR/LinalgStructuredOps.td | 1 - mlir/include/mlir/Dialect/Vector/VectorOps.td | 1 - mlir/include/mlir/IR/OpBase.td | 14 ++++++++++ mlir/test/lib/Dialect/Test/TestOps.td | 1 - 8 files changed, 14 insertions(+), 38 deletions(-) delete mode 100644 mlir/include/mlir/Dialect/Affine/IR/AffineOpsBase.td diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td index c47dcd3..7e065cc 100644 --- a/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td +++ b/mlir/include/mlir/Dialect/Affine/IR/AffineOps.td @@ -13,7 +13,6 @@ #ifndef AFFINE_OPS #define AFFINE_OPS -include "mlir/Dialect/Affine/IR/AffineOpsBase.td" include "mlir/Dialect/StandardOps/IR/StandardOpsBase.td" include "mlir/Dialect/Affine/IR/AffineMemoryOpInterfaces.td" include "mlir/Interfaces/ControlFlowInterfaces.td" diff --git a/mlir/include/mlir/Dialect/Affine/IR/AffineOpsBase.td b/mlir/include/mlir/Dialect/Affine/IR/AffineOpsBase.td deleted file mode 100644 index 2883072..0000000 --- a/mlir/include/mlir/Dialect/Affine/IR/AffineOpsBase.td +++ /dev/null @@ -1,32 +0,0 @@ -//===- AffineOpsBase.td - Affine operation definitions -----*- tablegen -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// -// -// Defines base support for MLIR affine operations. -// -//===----------------------------------------------------------------------===// - -#ifndef AFFINE_OPS_BASE -#define AFFINE_OPS_BASE - -include "mlir/IR/OpBase.td" - -// Attributes containing affine maps. -def AffineMapAttr : Attr< - CPred<"$_self.isa()">, "AffineMap attribute"> { - let storageType = [{ AffineMapAttr }]; - let returnType = [{ AffineMap }]; - let valueType = Index; - let constBuilderCall = "AffineMapAttr::get($0)"; -} - -def AffineMapArrayAttr : TypedArrayAttrBase { - let constBuilderCall = "$_builder.getAffineMapArrayAttr($0)"; -} - -#endif // AFFINE_OPS_BASE diff --git a/mlir/include/mlir/Dialect/GPU/ParallelLoopMapperAttr.td b/mlir/include/mlir/Dialect/GPU/ParallelLoopMapperAttr.td index c038073..daf2d6c 100644 --- a/mlir/include/mlir/Dialect/GPU/ParallelLoopMapperAttr.td +++ b/mlir/include/mlir/Dialect/GPU/ParallelLoopMapperAttr.td @@ -14,7 +14,6 @@ #ifndef PARALLEL_LOOP_MAPPER_ATTR #define PARALLEL_LOOP_MAPPER_ATTR -include "mlir/Dialect/Affine/IR/AffineOpsBase.td" include "mlir/Dialect/GPU/GPUBase.td" def BlockX : I64EnumAttrCase<"BlockX", 0>; diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td index a7855e6..d74e591 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td @@ -13,7 +13,6 @@ #ifndef LINALG_OPS #define LINALG_OPS -include "mlir/Dialect/Affine/IR/AffineOpsBase.td" include "mlir/Dialect/Linalg/IR/LinalgBase.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/ViewLikeInterface.td" diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td index d123229..9c8197c 100644 --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td @@ -14,7 +14,6 @@ #ifndef LINALG_STRUCTURED_OPS #define LINALG_STRUCTURED_OPS -include "mlir/Dialect/Affine/IR/AffineOpsBase.td" include "mlir/Dialect/Linalg/IR/LinalgBase.td" include "mlir/Dialect/Linalg/IR/LinalgStructuredOpsInterface.td" include "mlir/Interfaces/CopyOpInterface.td" diff --git a/mlir/include/mlir/Dialect/Vector/VectorOps.td b/mlir/include/mlir/Dialect/Vector/VectorOps.td index ecac0a3..f74c868 100644 --- a/mlir/include/mlir/Dialect/Vector/VectorOps.td +++ b/mlir/include/mlir/Dialect/Vector/VectorOps.td @@ -13,7 +13,6 @@ #ifndef VECTOR_OPS #define VECTOR_OPS -include "mlir/Dialect/Affine/IR/AffineOpsBase.td" include "mlir/Interfaces/SideEffectInterfaces.td" include "mlir/Interfaces/VectorInterfaces.td" diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td index f1befa4..eaaf5b7 100644 --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -1381,6 +1381,15 @@ def StringElementsAttr : ElementsAttrBase< let convertFromStorage = "$_self"; } +// Attributes containing affine maps. +def AffineMapAttr : Attr< +CPred<"$_self.isa<::mlir::AffineMapAttr>()">, "AffineMap attribute"> { + let storageType = [{::mlir::AffineMapAttr }]; + let returnType = [{ ::mlir::AffineMap }]; + let valueType = Index; + let constBuilderCall = "::mlir::AffineMapAttr::get($0)"; +} + // Base class for array attributes. class ArrayAttrBase : Attr { @@ -1410,6 +1419,11 @@ class TypedArrayAttrBase: ArrayAttrBase< Attr elementAttr = element; } +def AffineMapArrayAttr : TypedArrayAttrBase { + let constBuilderCall = "$_builder.getAffineMapArrayAttr($0)"; +} + def BoolArrayAttr : TypedArrayAttrBase { let constBuilderCall = "$_builder.getBoolArrayAttr($0)"; diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td index 6f3c8f5..7361045 100644 --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -9,7 +9,6 @@ #ifndef TEST_OPS #define TEST_OPS -include "mlir/Dialect/Affine/IR/AffineOpsBase.td" include "mlir/IR/OpBase.td" include "mlir/IR/OpAsmInterface.td" include "mlir/IR/RegionKindInterface.td" -- 2.7.4