Move AffineMapAttr into BaseOps.td
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 30 Sep 2020 11:26:25 +0000 (13:26 +0200)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 30 Sep 2020 14:22:53 +0000 (16:22 +0200)
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
mlir/include/mlir/Dialect/Affine/IR/AffineOpsBase.td [deleted file]
mlir/include/mlir/Dialect/GPU/ParallelLoopMapperAttr.td
mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
mlir/include/mlir/Dialect/Linalg/IR/LinalgStructuredOps.td
mlir/include/mlir/Dialect/Vector/VectorOps.td
mlir/include/mlir/IR/OpBase.td
mlir/test/lib/Dialect/Test/TestOps.td

index c47dcd3..7e065cc 100644 (file)
@@ -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 (file)
index 2883072..0000000
+++ /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<AffineMapAttr>()">, "AffineMap attribute"> {
-  let storageType = [{ AffineMapAttr }];
-  let returnType = [{ AffineMap }];
-  let valueType = Index;
-  let constBuilderCall = "AffineMapAttr::get($0)";
-}
-
-def AffineMapArrayAttr : TypedArrayAttrBase<AffineMapAttr,
-                                      "AffineMap array attribute"> {
-  let constBuilderCall = "$_builder.getAffineMapArrayAttr($0)";
-}
-
-#endif // AFFINE_OPS_BASE
index c038073..daf2d6c 100644 (file)
@@ -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>;
index a7855e6..d74e591 100644 (file)
@@ -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"
index d123229..9c8197c 100644 (file)
@@ -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"
index ecac0a3..f74c868 100644 (file)
@@ -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"
 
index f1befa4..eaaf5b7 100644 (file)
@@ -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<Pred condition, string description> :
     Attr<condition, description> {
@@ -1410,6 +1419,11 @@ class TypedArrayAttrBase<Attr element, string description>: ArrayAttrBase<
   Attr elementAttr = element;
 }
 
+def AffineMapArrayAttr : TypedArrayAttrBase<AffineMapAttr,
+                                      "AffineMap array attribute"> {
+  let constBuilderCall = "$_builder.getAffineMapArrayAttr($0)";
+}
+
 def BoolArrayAttr : TypedArrayAttrBase<BoolAttr,
                                       "1-bit boolean array attribute"> {
   let constBuilderCall = "$_builder.getBoolArrayAttr($0)";
index 6f3c8f5..7361045 100644 (file)
@@ -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"