MLIR  15.0.0git
Classes | Public Member Functions | List of all members
mlir::bufferization::BufferizationAliasInfo Class Reference

The BufferizationAliasInfo class maintains a list of buffer aliases and equivalence classes to support bufferization. More...

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

Public Member Functions

 BufferizationAliasInfo (Operation *rootOp)
 
 BufferizationAliasInfo (const BufferizationAliasInfo &)=delete
 
void createAliasInfoEntry (Value v)
 Add a new entry for v in the aliasInfo and equivalentInfo. More...
 
void insertNewBufferAlias (Value newValue, Value alias)
 Insert an info entry for newValue and merge its alias set with that of alias. More...
 
void insertNewBufferEquivalence (Value newValue, Value alias)
 Insert an info entry for newValue and merge its alias set with that of alias. More...
 
void bufferizeInPlace (OpOperand &operand, AnalysisState &state)
 Set the inPlace bufferization spec to true. More...
 
void bufferizeOutOfPlace (OpOperand &operand)
 Set the inPlace bufferization spec to false. More...
 
bool areAliasingBufferizedValues (Value v1, Value v2) const
 Return true if v1 and v2 may bufferize to aliasing buffers. More...
 
bool areEquivalentBufferizedValues (Value v1, Value v2) const
 Return true if v1 and v2 bufferize to equivalent buffers. More...
 
void unionAliasSets (Value v1, Value v2)
 Union the alias sets of v1 and v2. More...
 
void unionEquivalenceClasses (Value v1, Value v2)
 Union the equivalence classes of v1 and v2. More...
 
void applyOnEquivalenceClass (Value v, function_ref< void(Value)> fun) const
 Apply fun to all the members of the equivalence class of v. More...
 
void applyOnAliases (Value v, function_ref< void(Value)> fun) const
 Apply fun to all aliases of v. More...
 
void markInPlace (OpOperand &o)
 Mark a value as in-place bufferized. More...
 
bool isInPlace (OpOperand &opOperand) const
 Return true if a value was marked as in-place bufferized. More...
 

Detailed Description

The BufferizationAliasInfo class maintains a list of buffer aliases and equivalence classes to support bufferization.

Definition at line 58 of file OneShotAnalysis.h.

Constructor & Destructor Documentation

◆ BufferizationAliasInfo() [1/2]

BufferizationAliasInfo::BufferizationAliasInfo ( Operation rootOp)
explicit

◆ BufferizationAliasInfo() [2/2]

mlir::bufferization::BufferizationAliasInfo::BufferizationAliasInfo ( const BufferizationAliasInfo )
delete

Member Function Documentation

◆ applyOnAliases()

void BufferizationAliasInfo::applyOnAliases ( Value  v,
function_ref< void(Value)>  fun 
) const

◆ applyOnEquivalenceClass()

void BufferizationAliasInfo::applyOnEquivalenceClass ( Value  v,
function_ref< void(Value)>  fun 
) const

Apply fun to all the members of the equivalence class of v.

Definition at line 155 of file OneShotAnalysis.cpp.

Referenced by assertDestinationPassingStyle().

◆ areAliasingBufferizedValues()

bool mlir::bufferization::BufferizationAliasInfo::areAliasingBufferizedValues ( Value  v1,
Value  v2 
) const
inline

Return true if v1 and v2 may bufferize to aliasing buffers.

Definition at line 85 of file OneShotAnalysis.h.

Referenced by getAssumedUniqueReturnOp().

◆ areEquivalentBufferizedValues()

bool mlir::bufferization::BufferizationAliasInfo::areEquivalentBufferizedValues ( Value  v1,
Value  v2 
) const
inline

Return true if v1 and v2 bufferize to equivalent buffers.

Definition at line 90 of file OneShotAnalysis.h.

Referenced by mlir::bufferization::OneShotAnalysisState::areEquivalentBufferizedValues(), and getAssumedUniqueReturnOp().

◆ bufferizeInPlace()

void BufferizationAliasInfo::bufferizeInPlace ( OpOperand operand,
AnalysisState state 
)

Set the inPlace bufferization spec to true.

Merge result's and operand's aliasing sets and iterate to a fixed point.

Definition at line 141 of file OneShotAnalysis.cpp.

References mlir::IROperand< DerivedT, IRValueT >::get(), mlir::bufferization::AnalysisState::getAliasingOpResult(), and markInPlace().

Referenced by bufferizableInPlaceAnalysisImpl().

◆ bufferizeOutOfPlace()

void BufferizationAliasInfo::bufferizeOutOfPlace ( OpOperand operand)

Set the inPlace bufferization spec to false.

Definition at line 149 of file OneShotAnalysis.cpp.

Referenced by bufferizableInPlaceAnalysisImpl().

◆ createAliasInfoEntry()

void BufferizationAliasInfo::createAliasInfoEntry ( Value  v)

Add a new entry for v in the aliasInfo and equivalentInfo.

In the beginning the alias and equivalence sets only contain v itself.

Definition at line 115 of file OneShotAnalysis.cpp.

Referenced by BufferizationAliasInfo(), and insertNewBufferAlias().

◆ insertNewBufferAlias()

void BufferizationAliasInfo::insertNewBufferAlias ( Value  newValue,
Value  alias 
)

Insert an info entry for newValue and merge its alias set with that of alias.

Definition at line 122 of file OneShotAnalysis.cpp.

References createAliasInfoEntry().

Referenced by insertNewBufferEquivalence().

◆ insertNewBufferEquivalence()

void BufferizationAliasInfo::insertNewBufferEquivalence ( Value  newValue,
Value  alias 
)

Insert an info entry for newValue and merge its alias set with that of alias.

Additionally, merge their equivalence classes.

Definition at line 129 of file OneShotAnalysis.cpp.

References insertNewBufferAlias().

◆ isInPlace()

bool BufferizationAliasInfo::isInPlace ( OpOperand opOperand) const

Return true if a value was marked as in-place bufferized.

Definition at line 136 of file OneShotAnalysis.cpp.

Referenced by annotateOpsWithBufferizationMarkers(), mlir::bufferization::OneShotAnalysisState::isInPlace(), and isInplaceMemoryWrite().

◆ markInPlace()

void mlir::bufferization::BufferizationAliasInfo::markInPlace ( OpOperand o)
inline

Mark a value as in-place bufferized.

Definition at line 109 of file OneShotAnalysis.h.

References isInPlace().

Referenced by bufferizeInPlace(), and mlir::bufferization::OneShotAnalysisState::OneShotAnalysisState().

◆ unionAliasSets()

void mlir::bufferization::BufferizationAliasInfo::unionAliasSets ( Value  v1,
Value  v2 
)
inline

Union the alias sets of v1 and v2.

Definition at line 95 of file OneShotAnalysis.h.

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

◆ unionEquivalenceClasses()

void mlir::bufferization::BufferizationAliasInfo::unionEquivalenceClasses ( Value  v1,
Value  v2 
)
inline

Union the equivalence classes of v1 and v2.

Definition at line 98 of file OneShotAnalysis.h.

Referenced by equivalenceAnalysis().


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