MLIR 22.0.0git
BufferDeallocationSimplification.cpp File Reference

Go to the source code of this file.

Classes

class  mlir::bufferization::impl::BufferDeallocationSimplificationPassBase< DerivedT >

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::bufferization
namespace  mlir::bufferization::impl

Macros

#define GEN_PASS_DEF_BUFFERDEALLOCATIONSIMPLIFICATIONPASS

Functions

std::unique_ptr<::mlir::Passmlir::bufferization::impl::createBufferDeallocationSimplificationPass ()
std::unique_ptr<::mlir::Passmlir::bufferization::createBufferDeallocationSimplificationPass ()
static Value getViewBase (Value value)
 Given a memref value, return the "base" value by skipping over all ViewLikeOpInterface ops (if any) in the reverse use-def chain.
static LogicalResult updateDeallocIfChanged (DeallocOp deallocOp, ValueRange memrefs, ValueRange conditions, PatternRewriter &rewriter)
static bool distinctAllocAndBlockArgument (Value v1, Value v2)
 Return "true" if the given values are guaranteed to be different (and non-aliasing) allocations based on the fact that one value is the result of an allocation and the other value is a block argument of a parent block.
static bool potentiallyAliasesMemref (BufferOriginAnalysis &analysis, ValueRange otherList, Value memref)
 Checks if memref may potentially alias a MemRef in otherList.

Macro Definition Documentation

◆ GEN_PASS_DEF_BUFFERDEALLOCATIONSIMPLIFICATIONPASS

#define GEN_PASS_DEF_BUFFERDEALLOCATIONSIMPLIFICATIONPASS

Definition at line 25 of file BufferDeallocationSimplification.cpp.

Function Documentation

◆ distinctAllocAndBlockArgument()

bool distinctAllocAndBlockArgument ( Value v1,
Value v2 )
static

Return "true" if the given values are guaranteed to be different (and non-aliasing) allocations based on the fact that one value is the result of an allocation and the other value is a block argument of a parent block.

Note: This is a best-effort analysis that will eventually be replaced by a proper "is same allocation" analysis. This function may return "false" even though the two values are distinct allocations.

Definition at line 70 of file BufferDeallocationSimplification.cpp.

References getViewBase().

Referenced by potentiallyAliasesMemref().

◆ getViewBase()

Value getViewBase ( Value value)
static

Given a memref value, return the "base" value by skipping over all ViewLikeOpInterface ops (if any) in the reverse use-def chain.

Definition at line 39 of file BufferDeallocationSimplification.cpp.

Referenced by distinctAllocAndBlockArgument(), and mlir::BufferOriginAnalysis::isSameAllocation().

◆ potentiallyAliasesMemref()

bool potentiallyAliasesMemref ( BufferOriginAnalysis & analysis,
ValueRange otherList,
Value memref )
static

Checks if memref may potentially alias a MemRef in otherList.

It is often a requirement of optimization patterns that there cannot be any aliasing memref in order to perform the desired simplification.

Definition at line 87 of file BufferDeallocationSimplification.cpp.

References distinctAllocAndBlockArgument().

◆ updateDeallocIfChanged()

LogicalResult updateDeallocIfChanged ( DeallocOp deallocOp,
ValueRange memrefs,
ValueRange conditions,
PatternRewriter & rewriter )
static

Definition at line 49 of file BufferDeallocationSimplification.cpp.