[Mlir-commits] [mlir] [mlir][IR] Add `ScalarTypeInterface` and use as `VectorType` element type (PR #132400)
Mehdi Amini
llvmlistbot at llvm.org
Fri Mar 21 06:56:45 PDT 2025
================
@@ -16,7 +16,40 @@
include "mlir/IR/OpBase.td"
-def FloatTypeInterface : TypeInterface<"FloatType"> {
+//===----------------------------------------------------------------------===//
+// ScalarTypeInterface
+//===----------------------------------------------------------------------===//
+
+def ScalarTypeInterface : TypeInterface<"ScalarTypeInterface"> {
+ let cppNamespace = "::mlir";
+ let description = [{
+ Indication that this type is a scalar type.
+
+ The bitwidth of a scalar type is a fixed constant but may be unknown in the
+ absence of data layout information.
+
+ Scalar types are POD (plain-old-data) entities that have an in-memory
+ representation: scalar values can be loaded/store from/to memory, so
+ abstract types like function types or async tokens cannot be scalar types.
+
+ Scalar types should be limited to types that can lower to something that
+ egress dialects would consider a valid vector element type.
----------------
joker-eph wrote:
I'm not sure I agree wit this last paragraph: it seems "out of the blue" with respect to the rest of this description, and is not very precise (what are the egress dialect one has in mind here? If we think of LLVM we should just call this out).
https://github.com/llvm/llvm-project/pull/132400
More information about the Mlir-commits
mailing list