-
Notifications
You must be signed in to change notification settings - Fork 15k
[mlir] EnumAttr.td: Fix the width of I64Enum #156133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mlir] EnumAttr.td: Fix the width of I64Enum #156133
Conversation
Created using spr 1.3.5-bogner
@llvm/pr-subscribers-mlir Author: Fangrui Song (MaskRay) ChangesFollow-up to #132148 Full diff: https://github.com/llvm/llvm-project/pull/156133.diff 2 Files Affected:
diff --git a/mlir/include/mlir/IR/EnumAttr.td b/mlir/include/mlir/IR/EnumAttr.td
index ff6cec6d41161..7eba68f05f4c3 100644
--- a/mlir/include/mlir/IR/EnumAttr.td
+++ b/mlir/include/mlir/IR/EnumAttr.td
@@ -289,7 +289,7 @@ class IntEnum<string name, string summary, list<EnumCase> cases, int width>
class I32Enum<string name, string summary, list<EnumCase> cases>
: IntEnum<name, summary, cases, 32>;
class I64Enum<string name, string summary, list<EnumCase> cases>
- : IntEnum<name, summary, cases, 32>;
+ : IntEnum<name, summary, cases, 64>;
// An enum attribute backed by IntegerAttr.
//
diff --git a/mlir/test/lib/Dialect/Test/TestEnumDefs.td b/mlir/test/lib/Dialect/Test/TestEnumDefs.td
index 10e424a0f2523..51938d4dc68bb 100644
--- a/mlir/test/lib/Dialect/Test/TestEnumDefs.td
+++ b/mlir/test/lib/Dialect/Test/TestEnumDefs.td
@@ -27,9 +27,10 @@ def SomeI32Enum : I32EnumAttr<"SomeI32Enum", "",
def I64Case5: I64EnumAttrCase<"case5", 5>;
def I64Case10: I64EnumAttrCase<"case10", 10>;
+def I64Case1p32 : I64EnumAttrCase<"caseLarse", 4294967296>;
def SomeI64Enum: I64EnumAttr<
- "SomeI64Enum", "", [I64Case5, I64Case10]>;
+ "SomeI64Enum", "", [I64Case5, I64Case10, I64Case1p32]>;
//===----------------------------------------------------------------------===//
// Test Enum
@@ -53,6 +54,13 @@ def TestSimpleEnum : I32Enum<"SimpleEnum", "", [
let cppNamespace = "::test";
}
+def TestSimpleEnum64 : I64Enum<"SimpleEnum64", "", [
+ I64EnumCase<"a", 4294967296>,
+ I64EnumCase<"b", 4294967297>
+ ]> {
+ let cppNamespace = "::test";
+}
+
//===----------------------------------------------------------------------===//
// Test Bit Enum
//===----------------------------------------------------------------------===//
|
@llvm/pr-subscribers-mlir-core Author: Fangrui Song (MaskRay) ChangesFollow-up to #132148 Full diff: https://github.com/llvm/llvm-project/pull/156133.diff 2 Files Affected:
diff --git a/mlir/include/mlir/IR/EnumAttr.td b/mlir/include/mlir/IR/EnumAttr.td
index ff6cec6d41161..7eba68f05f4c3 100644
--- a/mlir/include/mlir/IR/EnumAttr.td
+++ b/mlir/include/mlir/IR/EnumAttr.td
@@ -289,7 +289,7 @@ class IntEnum<string name, string summary, list<EnumCase> cases, int width>
class I32Enum<string name, string summary, list<EnumCase> cases>
: IntEnum<name, summary, cases, 32>;
class I64Enum<string name, string summary, list<EnumCase> cases>
- : IntEnum<name, summary, cases, 32>;
+ : IntEnum<name, summary, cases, 64>;
// An enum attribute backed by IntegerAttr.
//
diff --git a/mlir/test/lib/Dialect/Test/TestEnumDefs.td b/mlir/test/lib/Dialect/Test/TestEnumDefs.td
index 10e424a0f2523..51938d4dc68bb 100644
--- a/mlir/test/lib/Dialect/Test/TestEnumDefs.td
+++ b/mlir/test/lib/Dialect/Test/TestEnumDefs.td
@@ -27,9 +27,10 @@ def SomeI32Enum : I32EnumAttr<"SomeI32Enum", "",
def I64Case5: I64EnumAttrCase<"case5", 5>;
def I64Case10: I64EnumAttrCase<"case10", 10>;
+def I64Case1p32 : I64EnumAttrCase<"caseLarse", 4294967296>;
def SomeI64Enum: I64EnumAttr<
- "SomeI64Enum", "", [I64Case5, I64Case10]>;
+ "SomeI64Enum", "", [I64Case5, I64Case10, I64Case1p32]>;
//===----------------------------------------------------------------------===//
// Test Enum
@@ -53,6 +54,13 @@ def TestSimpleEnum : I32Enum<"SimpleEnum", "", [
let cppNamespace = "::test";
}
+def TestSimpleEnum64 : I64Enum<"SimpleEnum64", "", [
+ I64EnumCase<"a", 4294967296>,
+ I64EnumCase<"b", 4294967297>
+ ]> {
+ let cppNamespace = "::test";
+}
+
//===----------------------------------------------------------------------===//
// Test Bit Enum
//===----------------------------------------------------------------------===//
|
@llvm/pr-subscribers-mlir-ods Author: Fangrui Song (MaskRay) ChangesFollow-up to #132148 Full diff: https://github.com/llvm/llvm-project/pull/156133.diff 2 Files Affected:
diff --git a/mlir/include/mlir/IR/EnumAttr.td b/mlir/include/mlir/IR/EnumAttr.td
index ff6cec6d41161..7eba68f05f4c3 100644
--- a/mlir/include/mlir/IR/EnumAttr.td
+++ b/mlir/include/mlir/IR/EnumAttr.td
@@ -289,7 +289,7 @@ class IntEnum<string name, string summary, list<EnumCase> cases, int width>
class I32Enum<string name, string summary, list<EnumCase> cases>
: IntEnum<name, summary, cases, 32>;
class I64Enum<string name, string summary, list<EnumCase> cases>
- : IntEnum<name, summary, cases, 32>;
+ : IntEnum<name, summary, cases, 64>;
// An enum attribute backed by IntegerAttr.
//
diff --git a/mlir/test/lib/Dialect/Test/TestEnumDefs.td b/mlir/test/lib/Dialect/Test/TestEnumDefs.td
index 10e424a0f2523..51938d4dc68bb 100644
--- a/mlir/test/lib/Dialect/Test/TestEnumDefs.td
+++ b/mlir/test/lib/Dialect/Test/TestEnumDefs.td
@@ -27,9 +27,10 @@ def SomeI32Enum : I32EnumAttr<"SomeI32Enum", "",
def I64Case5: I64EnumAttrCase<"case5", 5>;
def I64Case10: I64EnumAttrCase<"case10", 10>;
+def I64Case1p32 : I64EnumAttrCase<"caseLarse", 4294967296>;
def SomeI64Enum: I64EnumAttr<
- "SomeI64Enum", "", [I64Case5, I64Case10]>;
+ "SomeI64Enum", "", [I64Case5, I64Case10, I64Case1p32]>;
//===----------------------------------------------------------------------===//
// Test Enum
@@ -53,6 +54,13 @@ def TestSimpleEnum : I32Enum<"SimpleEnum", "", [
let cppNamespace = "::test";
}
+def TestSimpleEnum64 : I64Enum<"SimpleEnum64", "", [
+ I64EnumCase<"a", 4294967296>,
+ I64EnumCase<"b", 4294967297>
+ ]> {
+ let cppNamespace = "::test";
+}
+
//===----------------------------------------------------------------------===//
// Test Bit Enum
//===----------------------------------------------------------------------===//
|
Follow-up to #132148