[Mlir-commits] [mlir] [TableGen] Use getValue instead of getInt for enum attributes (PR #144030)

Mihir Patil llvmlistbot at llvm.org
Fri Jun 20 03:43:56 PDT 2025


================
@@ -39,8 +39,9 @@ class EnumCase<string sym, int intVal, string strVal, int widthVal> {
 class IntEnumAttrCaseBase<I intType, string sym, string strVal, int intVal> :
     EnumCase<sym, intVal, strVal, intType.bitwidth>,
     SignlessIntegerAttrBase<intType, "case " # strVal> {
-  let predicate =
-    CPred<"::llvm::cast<::mlir::IntegerAttr>($_self).getInt() == " # intVal>;
+  let predicate = CPred<
+      "::llvm::cast<::mlir::IntegerAttr>($_self).getValue().eq(::llvm::APInt("#intType
----------------
0xMihir wrote:

getValue returns the underlying APInt. These are not supported by standard enums.

https://github.com/llvm/llvm-project/pull/144030


More information about the Mlir-commits mailing list