MLIR  19.0.0git
Public Member Functions | List of all members
mlir::BufferOriginAnalysis Class Reference

An is-same-buffer analysis that checks if two SSA values belong to the same buffer allocation or not. More...

#include "mlir/Dialect/Bufferization/Transforms/BufferViewFlowAnalysis.h"

Public Member Functions

 BufferOriginAnalysis (Operation *op)
 
std::optional< bool > isSameAllocation (Value v1, Value v2)
 Return "true" if v1 and v2 originate from the same buffer allocation. More...
 

Detailed Description

An is-same-buffer analysis that checks if two SSA values belong to the same buffer allocation or not.

Definition at line 85 of file BufferViewFlowAnalysis.h.

Constructor & Destructor Documentation

◆ BufferOriginAnalysis()

BufferOriginAnalysis::BufferOriginAnalysis ( Operation op)

Definition at line 240 of file BufferViewFlowAnalysis.cpp.

Member Function Documentation

◆ isSameAllocation()

std::optional< bool > BufferOriginAnalysis::isSameAllocation ( Value  v1,
Value  v2 
)

Return "true" if v1 and v2 originate from the same buffer allocation.

Return "false" if v1 and v2 originate from different allocations. Return "nullopt" if we do not know for sure.

Example 1: isSameAllocation(%0, %1) == true

%0 = memref.alloc()
%1 = memref.subview %0

Example 2: isSameAllocation(%0, %1) == false

%0 = memref.alloc()
%1 = memref.alloc()

Example 3: isSameAllocation(%0, %2) == nullopt

%0 = memref.alloc()
%1 = memref.alloc()
%2 = arith.select %c, %0, %1

Definition at line 242 of file BufferViewFlowAnalysis.cpp.

References mlir::Value::getType(), getViewBase(), hasAllocateSideEffect(), isFunctionArgument(), mlir::BufferViewFlowAnalysis::mayBeTerminalBuffer(), and mlir::BufferViewFlowAnalysis::resolveReverse().

Referenced by potentiallyAliasesMemref().


The documentation for this class was generated from the following files: