Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions mlir/include/mlir/IR/BuiltinTypeInterfaces.td
Original file line number Diff line number Diff line change
Expand Up @@ -227,4 +227,24 @@ def ShapedTypeInterface : TypeInterface<"ShapedType"> {
}];
}

def IntegerLikeTypeInterface : TypeInterface<"IntegerLike"> {
let cppNamespace = "::mlir";
let description = [{
This type interface is for types that behave like integers. It provides
the API that allows MLIR utilities to treat them the same was as MLIR
treats integer types in settings like parsing and printing.
}];

let methods = [
InterfaceMethod<
/*desc=*/[{
Returns the storage bit width for this type.
}],
/*retTy=*/"int64_t",
/*methodName=*/"getStorageBitWidth",
/*args=*/(ins)
>,
];
}

#endif // MLIR_IR_BUILTINTYPEINTERFACES_TD_