From d9c7fc658d2befdca9cc147801abfe50cb364767 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 16 Apr 2020 14:28:18 +0200 Subject: [PATCH] Revert "[MLIR] Add IndexAttr to primitive attributes kinds in tablegen." This reverts commit 997f33cfeec9cd8c5bc913cf862794e986a4bd39. Breaks check-mlir ******************** TEST 'MLIR :: IR/attribute.mlir' FAILED ******************** Script: -- : 'RUN: at line 1'; mlir-opt llvm-project/mlir/test/IR/attribute.mlir -split-input-file -verify-diagnostics | /FileCheck llvm-project/mlir/test/IR/attribute.mlir -- Exit Code: 1 Command Output (stderr): -- llvm-project/mlir/test/IR/attribute.mlir split at line #1:19:3: error: unexpected error: 'test.int_attrs' op requires attribute 'index_attr' "test.int_attrs"() { ^ llvm-project/mlir/test/IR/attribute.mlir split at line #120:6:3: error: unexpected error: 'test.int_attrs' op requires attribute 'index_attr' "test.int_attrs"() { ^ llvm-project/mlir/test/IR/attribute.mlir split at line #120:5:6: error: expected error "'si32_attr' failed to satisfy constraint: 32-bit signed integer attribute" was not produced // expected-error @+1 {{'si32_attr' failed to satisfy constraint: 32-bit signed integer attribute}} ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/mlir/test/IR/attribute.mlir split at line #133:5:3: error: unexpected error: 'test.int_attrs' op requires attribute 'index_attr' "test.int_attrs"() { ^ llvm-project/mlir/test/IR/attribute.mlir split at line #133:4:6: error: expected error "'ui32_attr' failed to satisfy constraint: 32-bit unsigned integer attribute" was not produced // expected-error @+1 {{'ui32_attr' failed to satisfy constraint: 32-bit unsigned integer attribute}} ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ llvm-project/mlir/test/IR/attribute.mlir:9:12: error: CHECK: expected string not found in input // CHECK: any_i32_attr = 5 : ui32 ^ :3:1: note: scanning from here module { ^ :21:28: note: possible intended match here "test.non_negative_int_attr"() {i32attr = 5 : i32, i64attr = 10 : i64} : () -> () --- mlir/include/mlir/IR/OpBase.td | 10 ---------- mlir/test/IR/attribute.mlir | 2 -- mlir/test/lib/Dialect/Test/TestOps.td | 1 - 3 files changed, 13 deletions(-) diff --git a/mlir/include/mlir/IR/OpBase.td b/mlir/include/mlir/IR/OpBase.td index 14ef45ed4c7f..e552279e8a8e 100644 --- a/mlir/include/mlir/IR/OpBase.td +++ b/mlir/include/mlir/IR/OpBase.td @@ -845,16 +845,6 @@ def BoolAttr : Attr()">, "bool attribute"> { let constBuilderCall = "$_builder.getBoolAttr($0)"; } -// Index attribute. -def IndexAttr : - TypedAttrBase< - Index, "IntegerAttr", - And<[CPred<"$_self.isa()">, - CPred<"$_self.cast().getType().isa()">]>, - "index attribute"> { - let returnType = [{ APInt }]; -} - // Base class for any integer (regardless of signedness semantics) attributes // of fixed width. class AnyIntegerAttrBase : diff --git a/mlir/test/IR/attribute.mlir b/mlir/test/IR/attribute.mlir index 32b8f8c25180..31804b274a55 100644 --- a/mlir/test/IR/attribute.mlir +++ b/mlir/test/IR/attribute.mlir @@ -8,8 +8,6 @@ func @int_attrs_pass() { "test.int_attrs"() { // CHECK: any_i32_attr = 5 : ui32 any_i32_attr = 5 : ui32, - // CHECK-SAME: index_attr = 8 : index - index_attr = 8 : index, // CHECK-SAME: si32_attr = 7 : si32 si32_attr = 7 : si32, // CHECK-SAME: ui32_attr = 6 : ui32 diff --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td index 524780b89552..6f1ef4a50f67 100644 --- a/mlir/test/lib/Dialect/Test/TestOps.td +++ b/mlir/test/lib/Dialect/Test/TestOps.td @@ -199,7 +199,6 @@ def I64EnumAttrOp : TEST_Op<"i64_enum_attr"> { def IntAttrOp : TEST_Op<"int_attrs"> { let arguments = (ins AnyI32Attr:$any_i32_attr, - IndexAttr:$index_attr, UI32Attr:$ui32_attr, SI32Attr:$si32_attr );