forked from OSchip/llvm-project
[MLIR][Standard] Fix use of `dyn_cast_or_null`
The value may be a function argument in which case `getDefiningOp` will return a `nullptr`. Differential Revision: https://reviews.llvm.org/D81965
This commit is contained in:
parent
6a5641eff6
commit
6f2943fb19
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue