Skip to content

Commit be6a119

Browse files
committed
add
1 parent b99b920 commit be6a119

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5001,9 +5001,12 @@ static bool isLikePadUnPad(PackOrUnpackOp packOp, ShapedType packedTensorType) {
50015001
}
50025002

50035003
bool PackOp::isLikePad() {
5004-
auto packedTensorType =
5005-
llvm::cast<RankedTensorType>((*this)->getResultTypes().front());
5006-
return isLikePadUnPad(*this, packedTensorType);
5004+
if (auto packedTensorType =
5005+
llvm::dyn_cast<RankedTensorType>((*this)->getResultTypes().front()))
5006+
return isLikePadUnPad(*this, packedTensorType);
5007+
if (auto packedTensorType =
5008+
llvm::dyn_cast<MemRefType>((*this)->getResultTypes().front()))
5009+
return isLikePadUnPad(*this, packedTensorType);
50075010
}
50085011

50095012
OpFoldResult PackOp::fold(FoldAdaptor adaptor) {

0 commit comments

Comments
 (0)