projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fd9b099
)
[mlir][vector] Use dyn_cast instead of cast in patterns
author
Lei Zhang
<antiagainst@google.com>
Mon, 8 Nov 2021 17:33:55 +0000
(12:33 -0500)
committer
Lei Zhang
<antiagainst@google.com>
Mon, 8 Nov 2021 17:34:14 +0000
(12:34 -0500)
This avoids crashes when the pattern is applied to ops with
tensor semantics.
Reviewed By: ThomasRaoux
Differential Revision: https://reviews.llvm.org/D113415
mlir/lib/Dialect/Vector/VectorTransforms.cpp
patch
|
blob
|
history
diff --git
a/mlir/lib/Dialect/Vector/VectorTransforms.cpp
b/mlir/lib/Dialect/Vector/VectorTransforms.cpp
index
9120310
..
6528789
100644
(file)
--- a/
mlir/lib/Dialect/Vector/VectorTransforms.cpp
+++ b/
mlir/lib/Dialect/Vector/VectorTransforms.cpp
@@
-3579,7
+3579,7
@@
class DropInnerMostUnitDims : public OpRewritePattern<vector::TransferReadOp> {
LogicalResult matchAndRewrite(vector::TransferReadOp readOp,
PatternRewriter &rewriter) const override {
- auto srcType = readOp.source().getType().cast<MemRefType>();
+ auto srcType = readOp.source().getType().
dyn_
cast<MemRefType>();
if (!srcType || !srcType.hasStaticShape())
return failure();