Enzyme main
Loading...
Searching...
No Matches
mlir::enzyme::oputils Namespace Reference

Functions

const std::set< std::string > & getNonCapturingFunctions ()
 
static bool isCaptured (Value v, Operation *potentialUser=nullptr, bool *seenuse=nullptr)
 
static Value getBase (Value v)
 
static bool isStackAlloca (Value v)
 
bool mayAlias (Value v1, Value v2)
 
bool mayAlias (MemoryEffects::EffectInstance a, Value v2)
 
bool mayAlias (MemoryEffects::EffectInstance &a, MemoryEffects::EffectInstance &b)
 
bool isReadOnly (Operation *op)
 
bool isReadNone (Operation *op)
 
bool collectOpEffects (Operation *rootOp, SmallVector< MemoryEffects::EffectInstance > &effects)
 Returns the side effects of an operation(similar to mlir::getEffectsRecursively).
 
SmallVector< MemoryEffects::EffectInstance > collectFnEffects (FunctionOpInterface fnOp)
 
MemoryEffects::EffectInstance getEffectOfVal (Value val, MemoryEffects::Effect *effect, SideEffects::Resource *resource)
 
bool mayAlias (mlir::MemoryEffects::EffectInstance a, mlir::Value v2)
 

Function Documentation

◆ collectFnEffects()

SmallVector< MemoryEffects::EffectInstance > mlir::enzyme::oputils::collectFnEffects ( FunctionOpInterface fnOp)

Definition at line 409 of file Utils.cpp.

References collectOpEffects().

Referenced by mlir::enzyme::batchutils::pruneMemoryEffects().

◆ collectOpEffects()

bool mlir::enzyme::oputils::collectOpEffects ( Operation * rootOp,
SmallVector< MemoryEffects::EffectInstance > & effects )

Returns the side effects of an operation(similar to mlir::getEffectsRecursively).

If the operation has RecursiveMemoryEffects, include all side effects of child operations.

Also accounts for LLVM and autodiff-specific memory effects which are not captured by the default mlir::getEffectsRecursively

Definition at line 297 of file Utils.cpp.

Referenced by collectFnEffects(), and mlir::enzyme::batchutils::pruneMemoryEffects().

◆ getBase()

static Value mlir::enzyme::oputils::getBase ( Value v)
static

Definition at line 107 of file Utils.cpp.

Referenced by mayAlias().

◆ getEffectOfVal()

MemoryEffects::EffectInstance mlir::enzyme::oputils::getEffectOfVal ( Value val,
MemoryEffects::Effect * effect,
SideEffects::Resource * resource )

Definition at line 422 of file Utils.cpp.

Referenced by mlir::enzyme::batchutils::findCallerEffects().

◆ getNonCapturingFunctions()

const std::set< std::string > & mlir::enzyme::oputils::getNonCapturingFunctions ( )

Definition at line 27 of file Utils.cpp.

Referenced by isCaptured().

◆ isCaptured()

static bool mlir::enzyme::oputils::isCaptured ( Value v,
Operation * potentialUser = nullptr,
bool * seenuse = nullptr )
static

Definition at line 38 of file Utils.cpp.

References getNonCapturingFunctions().

Referenced by mayAlias().

◆ isReadNone()

bool mlir::enzyme::oputils::isReadNone ( Operation * op)

Definition at line 266 of file Utils.cpp.

References isReadNone().

Referenced by isReadNone().

◆ isReadOnly()

bool mlir::enzyme::oputils::isReadOnly ( Operation * op)

Definition at line 237 of file Utils.cpp.

References isReadOnly().

Referenced by isReadOnly().

◆ isStackAlloca()

static bool mlir::enzyme::oputils::isStackAlloca ( Value v)
static

Definition at line 130 of file Utils.cpp.

Referenced by mayAlias().

◆ mayAlias() [1/4]

bool mlir::enzyme::oputils::mayAlias ( MemoryEffects::EffectInstance & a,
MemoryEffects::EffectInstance & b )

Definition at line 221 of file Utils.cpp.

References mayAlias().

◆ mayAlias() [2/4]

bool mlir::enzyme::oputils::mayAlias ( MemoryEffects::EffectInstance a,
Value v2 )

Definition at line 214 of file Utils.cpp.

References mayAlias().

◆ mayAlias() [3/4]

bool mlir::enzyme::oputils::mayAlias ( mlir::MemoryEffects::EffectInstance a,
mlir::Value v2 )

◆ mayAlias() [4/4]

bool mlir::enzyme::oputils::mayAlias ( Value v1,
Value v2 )

Definition at line 136 of file Utils.cpp.

References getBase(), isCaptured(), and isStackAlloca().

Referenced by mayAlias(), mayAlias(), and mlir::enzyme::batchutils::pruneMemoryEffects().