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:
6a5641e
)
[MLIR][Standard] Fix use of `dyn_cast_or_null`
author
Frederik Gossen
<frgossen@google.com>
Tue, 16 Jun 2020 21:04:57 +0000
(21:04 +0000)
committer
Frederik Gossen
<frgossen@google.com>
Tue, 16 Jun 2020 21:06:15 +0000
(21:06 +0000)
The value may be a function argument in which case `getDefiningOp` will return a
`nullptr`.
Differential Revision: https://reviews.llvm.org/D81965
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
patch
|
blob
|
history
diff --git
a/mlir/lib/Dialect/StandardOps/IR/Ops.cpp
b/mlir/lib/Dialect/StandardOps/IR/Ops.cpp
index
dd67f2d
..
ca4fe83
100644
(file)
--- a/
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
+++ b/
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
@@
-1703,8
+1703,8
@@
struct ExtractElementFromTensorFromElements
if (extract.indices().size() != 1)
return failure();
- auto tensor_from_elements =
-
dyn_cast<TensorFromElementsOp>(
extract.aggregate().getDefiningOp());
+ auto tensor_from_elements =
dyn_cast_or_null<TensorFromElementsOp>(
+ extract.aggregate().getDefiningOp());
if (tensor_from_elements == nullptr)
return failure();