diff options
Diffstat (limited to 'mlir/lib/Dialect/Vector/IR/VectorOps.cpp')
-rw-r--r-- | mlir/lib/Dialect/Vector/IR/VectorOps.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp index 2d3b27f1af58..5c139b5897d7 100644 --- a/mlir/lib/Dialect/Vector/IR/VectorOps.cpp +++ b/mlir/lib/Dialect/Vector/IR/VectorOps.cpp @@ -1153,8 +1153,9 @@ ExtractOp::inferReturnTypes(MLIRContext *, std::optional<Location>, ValueRange operands, DictionaryAttr attributes, OpaqueProperties properties, RegionRange, SmallVectorImpl<Type> &inferredReturnTypes) { - ExtractOp::Adaptor op(operands, attributes); - auto vectorType = llvm::cast<VectorType>(op.getVector().getType()); + ExtractOp::Adaptor op(operands, attributes + *properties.as<ExtractOp::Properties *>()); + auto vectorType = op.getVector().getType().cast<VectorType>(); if (static_cast<int64_t>(op.getPosition().size()) == vectorType.getRank()) { inferredReturnTypes.push_back(vectorType.getElementType()); } else { @@ -2089,8 +2090,9 @@ ShuffleOp::inferReturnTypes(MLIRContext *, std::optional<Location>, ValueRange operands, DictionaryAttr attributes, OpaqueProperties properties, RegionRange, SmallVectorImpl<Type> &inferredReturnTypes) { - ShuffleOp::Adaptor op(operands, attributes); - auto v1Type = llvm::cast<VectorType>(op.getV1().getType()); + ShuffleOp::Adaptor op(operands, attributes + *properties.as<ShuffleOp::Properties *>()); + auto v1Type = op.getV1().getType().cast<VectorType>(); auto v1Rank = v1Type.getRank(); // Construct resulting type: leading dimension matches mask // length, all trailing dimensions match the operands. |