MLIR  16.0.0git
Functions
BufferOptimizations.cpp File Reference
#include "PassDetail.h"
#include "mlir/Dialect/Bufferization/Transforms/BufferUtils.h"
#include "mlir/Dialect/Bufferization/Transforms/Passes.h"
#include "mlir/Dialect/MemRef/IR/MemRef.h"
#include "mlir/IR/Operation.h"
#include "mlir/Interfaces/LoopLikeInterface.h"
#include "mlir/Pass/Pass.h"
+ Include dependency graph for BufferOptimizations.cpp:

Go to the source code of this file.

Functions

static bool isKnownControlFlowInterface (Operation *op)
 Returns true if the given operation implements a known high-level region- based control-flow interface. More...
 
static bool defaultIsSmallAlloc (Value alloc, unsigned maximumSizeInBytes, unsigned maxRankOfAllocatedMemRef)
 Check if the size of the allocation is less than the given size. More...
 
static bool leavesAllocationScope (Region *parentRegion, const BufferViewFlowAnalysis::ValueSetT &aliases)
 Checks whether the given aliases leave the allocation scope. More...
 
static bool hasAllocationScope (Value alloc, const BufferViewFlowAnalysis &aliasAnalysis)
 Checks, if an automated allocation scope for a given alloc value exists. More...
 

Function Documentation

◆ defaultIsSmallAlloc()

static bool defaultIsSmallAlloc ( Value  alloc,
unsigned  maximumSizeInBytes,
unsigned  maxRankOfAllocatedMemRef 
)
static

Check if the size of the allocation is less than the given size.

The transformation is only applied to small buffers since large buffers could exceed the stack space.

Definition at line 34 of file BufferOptimizations.cpp.

References mlir::DataLayout::closest(), mlir::Type::dyn_cast(), mlir::Value::getDefiningOp(), mlir::Operation::getOperands(), and mlir::Value::getType().

Referenced by hasAllocationScope().

◆ hasAllocationScope()

static bool hasAllocationScope ( Value  alloc,
const BufferViewFlowAnalysis aliasAnalysis 
)
static

◆ isKnownControlFlowInterface()

static bool isKnownControlFlowInterface ( Operation op)
static

Returns true if the given operation implements a known high-level region- based control-flow interface.

Definition at line 27 of file BufferOptimizations.cpp.

Referenced by hasAllocationScope().

◆ leavesAllocationScope()

static bool leavesAllocationScope ( Region parentRegion,
const BufferViewFlowAnalysis::ValueSetT aliases 
)
static

Checks whether the given aliases leave the allocation scope.

Definition at line 60 of file BufferOptimizations.cpp.

References mlir::isRegionReturnLike().

Referenced by hasAllocationScope().