[Mlir-commits] [mlir] [mlir][vector] Add convenience types for scalable vectors (PR #87986)
Andrzej WarzyĆski
llvmlistbot at llvm.org
Mon Apr 8 13:36:02 PDT 2024
================
@@ -0,0 +1,27 @@
+//===- VectorTypes.cpp - MLIR Vector Types --------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/IR/VectorTypes.h"
+#include "mlir/IR/BuiltinTypes.h"
+
+using namespace mlir;
+using namespace mlir::vector;
+
+bool ScalableVectorType::classof(Type type) {
+ auto vecTy = llvm::dyn_cast<VectorType>(type);
+ if (!vecTy)
+ return false;
+ return vecTy.isScalable();
+}
+
+bool FixedWidthVectorType::classof(Type type) {
+ auto vecTy = llvm::dyn_cast<VectorType>(type);
----------------
banach-space wrote:
_This_ namespace qualification is actually required :)
https://github.com/llvm/llvm-project/pull/87986
More information about the Mlir-commits
mailing list