MLIR  16.0.0git
Functions | Variables
LocalAliasAnalysis.cpp File Reference
#include "mlir/Analysis/AliasAnalysis/LocalAliasAnalysis.h"
#include "mlir/IR/FunctionInterfaces.h"
#include "mlir/IR/Matchers.h"
#include "mlir/Interfaces/ControlFlowInterfaces.h"
#include "mlir/Interfaces/SideEffectInterfaces.h"
#include "mlir/Interfaces/ViewLikeInterface.h"
+ Include dependency graph for LocalAliasAnalysis.cpp:

Go to the source code of this file.

Functions

static void collectUnderlyingAddressValues (Value value, unsigned maxDepth, DenseSet< Value > &visited, SmallVectorImpl< Value > &output)
 Given a value, collect all of the underlying values being addressed. More...
 
static void collectUnderlyingAddressValues (RegionBranchOpInterface branch, Region *region, Value inputValue, unsigned inputIndex, unsigned maxDepth, DenseSet< Value > &visited, SmallVectorImpl< Value > &output)
 Given a successor (region) of a RegionBranchOpInterface, collect all of the underlying values being addressed by one of the successor inputs. More...
 
static void collectUnderlyingAddressValues (OpResult result, unsigned maxDepth, DenseSet< Value > &visited, SmallVectorImpl< Value > &output)
 Given a result, collect all of the underlying values being addressed. More...
 
static void collectUnderlyingAddressValues (BlockArgument arg, unsigned maxDepth, DenseSet< Value > &visited, SmallVectorImpl< Value > &output)
 Given a block argument, collect all of the underlying values being addressed. More...
 
static void collectUnderlyingAddressValues (Value value, SmallVectorImpl< Value > &output)
 Given a value, collect all of the underlying values being addressed. More...
 
static LogicalResult getAllocEffectFor (Value value, Optional< MemoryEffects::EffectInstance > &effect, Operation *&allocScopeOp)
 Given a value, try to get an allocation effect attached to it. More...
 
static AliasResult aliasImpl (Value lhs, Value rhs)
 Given the two values, return their aliasing behavior. More...
 

Variables

static constexpr unsigned maxUnderlyingValueSearchDepth = 10
 The maximum depth that will be searched when trying to find an underlying value. More...
 

Function Documentation

◆ aliasImpl()

static AliasResult aliasImpl ( Value  lhs,
Value  rhs 
)
static

Given the two values, return their aliasing behavior.

Definition at line 247 of file LocalAliasAnalysis.cpp.

Referenced by mlir::AliasAnalysis::getModRef().

◆ collectUnderlyingAddressValues() [1/5]

static void collectUnderlyingAddressValues ( Value  value,
unsigned  maxDepth,
DenseSet< Value > &  visited,
SmallVectorImpl< Value > &  output 
)
static

Given a value, collect all of the underlying values being addressed.

Definition at line 176 of file LocalAliasAnalysis.cpp.

References mlir::Value::cast(), and mlir::Value::dyn_cast().

Referenced by collectUnderlyingAddressValues().

◆ collectUnderlyingAddressValues() [2/5]

static void collectUnderlyingAddressValues ( RegionBranchOpInterface  branch,
Region region,
Value  inputValue,
unsigned  inputIndex,
unsigned  maxDepth,
DenseSet< Value > &  visited,
SmallVectorImpl< Value > &  output 
)
static

Given a successor (region) of a RegionBranchOpInterface, collect all of the underlying values being addressed by one of the successor inputs.

If the provided region is null, as per RegionBranchOpInterface this represents the parent operation.

Definition at line 36 of file LocalAliasAnalysis.cpp.

References collectUnderlyingAddressValues(), mlir::Operation::getNumSuccessors(), mlir::getRegionBranchSuccessorOperands(), and mlir::Region::getRegionNumber().

◆ collectUnderlyingAddressValues() [3/5]

static void collectUnderlyingAddressValues ( OpResult  result,
unsigned  maxDepth,
DenseSet< Value > &  visited,
SmallVectorImpl< Value > &  output 
)
static

Given a result, collect all of the underlying values being addressed.

Definition at line 113 of file LocalAliasAnalysis.cpp.

References collectUnderlyingAddressValues(), mlir::OpResult::getOwner(), and mlir::OpResult::getResultNumber().

◆ collectUnderlyingAddressValues() [4/5]

static void collectUnderlyingAddressValues ( BlockArgument  arg,
unsigned  maxDepth,
DenseSet< Value > &  visited,
SmallVectorImpl< Value > &  output 
)
static

◆ collectUnderlyingAddressValues() [5/5]

static void collectUnderlyingAddressValues ( Value  value,
SmallVectorImpl< Value > &  output 
)
static

Given a value, collect all of the underlying values being addressed.

Definition at line 195 of file LocalAliasAnalysis.cpp.

References collectUnderlyingAddressValues(), and maxUnderlyingValueSearchDepth.

◆ getAllocEffectFor()

static LogicalResult getAllocEffectFor ( Value  value,
Optional< MemoryEffects::EffectInstance > &  effect,
Operation *&  allocScopeOp 
)
static

Given a value, try to get an allocation effect attached to it.

If successful, allocEffect is populated with the effect. If an effect was found, allocScopeOp is also specified if a parent operation of value could be identified that bounds the scope of the allocated value; i.e. if non-null it specifies the parent operation that the allocation does not escape. If no scope is found, allocScopeOp is set to nullptr.

Definition at line 213 of file LocalAliasAnalysis.cpp.

References mlir::Value::cast(), mlir::Value::dyn_cast(), mlir::failure(), mlir::Operation::getParentOfType(), mlir::Operation::getParentOp(), mlir::Operation::getParentWithTrait(), and mlir::success().

Variable Documentation

◆ maxUnderlyingValueSearchDepth

constexpr unsigned maxUnderlyingValueSearchDepth = 10
static

The maximum depth that will be searched when trying to find an underlying value.

Definition at line 25 of file LocalAliasAnalysis.cpp.

Referenced by collectUnderlyingAddressValues().