[Mlir-commits] [mlir] [mlir][IR] Add `ScalarTypeInterface` and use as `VectorType` element type (PR #132400)

Matthias Springer llvmlistbot at llvm.org
Fri Mar 21 07:34:54 PDT 2025


================
@@ -364,21 +364,22 @@ bool mlirTypeIsAVector(MlirType type) {
 MlirType mlirVectorTypeGet(intptr_t rank, const int64_t *shape,
                            MlirType elementType) {
   return wrap(VectorType::get(llvm::ArrayRef(shape, static_cast<size_t>(rank)),
-                              unwrap(elementType)));
+                              cast<ScalarTypeInterface>(unwrap(elementType))));
----------------
matthias-springer wrote:

No, this PR does not have it yet. I wanted to avoid the cast in the builder so that we can have better static type checking in some places. But now the diff became to large, so maybe it's better to add it.

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


More information about the Mlir-commits mailing list