Skip to content

Commit 3cf83b1

Browse files
committed
fixup! [mlir][vector] Add convenience types for scalable vectors
Inline implementation, add comment.
1 parent 3c51d92 commit 3cf83b1

File tree

3 files changed

+14
-30
lines changed

3 files changed

+14
-30
lines changed

mlir/include/mlir/IR/VectorTypes.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,29 @@
1616
namespace mlir {
1717
namespace vector {
1818

19+
/// A vector type containing at least one scalable dimension
1920
class ScalableVectorType : public VectorType {
2021
public:
2122
using VectorType::VectorType;
2223

23-
static bool classof(Type type);
24+
static bool classof(Type type) {
25+
auto vecTy = llvm::dyn_cast<VectorType>(type);
26+
if (!vecTy)
27+
return false;
28+
return vecTy.isScalable();
29+
}
2430
};
2531

32+
/// A vector type with no scalable dimensions
2633
class FixedWidthVectorType : public VectorType {
2734
public:
2835
using VectorType::VectorType;
29-
static bool classof(Type type);
36+
static bool classof(Type type) {
37+
auto vecTy = llvm::dyn_cast<VectorType>(type);
38+
if (!vecTy)
39+
return false;
40+
return !vecTy.isScalable();
41+
}
3042
};
3143

3244
} // namespace vector

mlir/lib/IR/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ add_mlir_library(MLIRIR
4040
Unit.cpp
4141
Value.cpp
4242
ValueRange.cpp
43-
VectorTypes.cpp
4443
Verifier.cpp
4544
Visitors.cpp
4645
${pdl_src}

mlir/lib/IR/VectorTypes.cpp

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)