MLIR  16.0.0git
Functions
BufferDeallocation.cpp File Reference
#include "PassDetail.h"
#include "mlir/Dialect/Bufferization/IR/AllocationOpInterface.h"
#include "mlir/Dialect/Bufferization/IR/Bufferization.h"
#include "mlir/Dialect/Bufferization/Transforms/BufferUtils.h"
#include "mlir/Dialect/Bufferization/Transforms/Passes.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "llvm/ADT/SetOperations.h"
+ Include dependency graph for BufferDeallocation.cpp:

Go to the source code of this file.

Functions

static LogicalResult walkReturnOperations (Region *region, llvm::function_ref< LogicalResult(Operation *)> func)
 Walks over all immediate return-like terminators in the given region. More...
 
static bool validateSupportedControlFlow (Operation *op)
 Checks if all operations that have at least one attached region implement the RegionBranchOpInterface. More...
 

Function Documentation

◆ validateSupportedControlFlow()

static bool validateSupportedControlFlow ( Operation op)
static

Checks if all operations that have at least one attached region implement the RegionBranchOpInterface.

This is not required in edge cases, where we have a single attached region and the parent operation has no results.

Definition at line 83 of file BufferDeallocation.cpp.

References mlir::WalkResult::advance(), mlir::OpBuilder::create(), mlir::bufferization::deallocateBuffers(), mlir::Operation::emitError(), mlir::Region::empty(), mlir::failed(), mlir::failure(), mlir::Region::front(), mlir::BlockArgument::getArgNumber(), mlir::Operation::getBlock(), mlir::Value::getDefiningOp(), mlir::LivenessBlockInfo::getEndOperation(), mlir::Value::getLoc(), mlir::getMutableRegionBranchSuccessorOperands(), mlir::Operation::getOperand(), mlir::Block::getOperations(), mlir::BlockArgument::getOwner(), mlir::Block::getParent(), mlir::Value::getParentBlock(), mlir::Operation::getParentOfType(), mlir::Region::getParentOp(), mlir::Region::getRegionNumber(), mlir::Operation::getRegions(), mlir::Operation::getResults(), mlir::RegionSuccessor::getSuccessor(), mlir::Operation::getSuccessor(), mlir::RegionSuccessor::getSuccessorInputs(), mlir::Block::getSuccessors(), mlir::DialectRegistry::insert(), mlir::Value::isa(), mlir::Operation::isBeforeInBlock(), mlir::Operation::moveAfter(), mlir::bufferization::None, mlir::Block::pred_begin(), mlir::Block::pred_end(), mlir::bufferization::registerAllocationOpInterfaceExternalModels(), mlir::Operation::setOperand(), mlir::succeeded(), mlir::success(), value, mlir::Operation::walk(), walkReturnOperations(), and mlir::WalkResult::wasSkipped().

Referenced by mlir::bufferization::deallocateBuffers().

◆ walkReturnOperations()

static LogicalResult walkReturnOperations ( Region region,
llvm::function_ref< LogicalResult(Operation *)>  func 
)
static

Walks over all immediate return-like terminators in the given region.

Definition at line 67 of file BufferDeallocation.cpp.

References mlir::failed(), mlir::failure(), mlir::isRegionReturnLike(), and mlir::success().

Referenced by validateSupportedControlFlow().