diff --git a/mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp b/mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp index 32a77430fa3a..73decbac7382 100644 --- a/mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp +++ b/mlir/lib/Dialect/Bufferization/Transforms/BufferDeallocation.cpp @@ -349,7 +349,7 @@ private: Region *argRegion = block->getParent(); Operation *parentOp = argRegion->getParentOp(); RegionBranchOpInterface regionInterface; - if (!argRegion || &argRegion->front() != block || + if (&argRegion->front() != block || !(regionInterface = dyn_cast(parentOp))) return success();