Skip to content

Commit 1517334

Browse files
authored
[mlir] EnumAttr.td: Fix the width of I64Enum (#156133)
Follow-up to #132148
1 parent 74230ff commit 1517334

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

mlir/include/mlir/IR/EnumAttr.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ class IntEnum<string name, string summary, list<EnumCase> cases, int width>
289289
class I32Enum<string name, string summary, list<EnumCase> cases>
290290
: IntEnum<name, summary, cases, 32>;
291291
class I64Enum<string name, string summary, list<EnumCase> cases>
292-
: IntEnum<name, summary, cases, 32>;
292+
: IntEnum<name, summary, cases, 64>;
293293

294294
// An enum attribute backed by IntegerAttr.
295295
//

mlir/test/lib/Dialect/Test/TestEnumDefs.td

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ def SomeI32Enum : I32EnumAttr<"SomeI32Enum", "",
2727

2828
def I64Case5: I64EnumAttrCase<"case5", 5>;
2929
def I64Case10: I64EnumAttrCase<"case10", 10>;
30+
def I64Case1p32 : I64EnumAttrCase<"caseLarse", 4294967296>;
3031

3132
def SomeI64Enum: I64EnumAttr<
32-
"SomeI64Enum", "", [I64Case5, I64Case10]>;
33+
"SomeI64Enum", "", [I64Case5, I64Case10, I64Case1p32]>;
3334

3435
//===----------------------------------------------------------------------===//
3536
// Test Enum
@@ -53,6 +54,13 @@ def TestSimpleEnum : I32Enum<"SimpleEnum", "", [
5354
let cppNamespace = "::test";
5455
}
5556

57+
def TestSimpleEnum64 : I64Enum<"SimpleEnum64", "", [
58+
I64EnumCase<"a", 4294967296>,
59+
I64EnumCase<"b", 4294967297>
60+
]> {
61+
let cppNamespace = "::test";
62+
}
63+
5664
//===----------------------------------------------------------------------===//
5765
// Test Bit Enum
5866
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)