|
Enzyme main
|
Helper class to analyze the differential activity. More...
#include "MLIR/Analysis/ActivityAnalysis.h"

Public Types | |
| enum class | UseActivity { None = 0 , OnlyLoads = 1 , OnlyStores = 2 , OnlyNonPointerStores = 3 , AllStores = 4 } |
Public Member Functions | |
| ActivityAnalyzer (PreProcessCache &PPC, llvm::AAResults &AA_, const llvm::SmallPtrSetImpl< llvm::BasicBlock * > ¬ForAnalysis_, llvm::TargetLibraryInfo &TLI_, const llvm::SmallPtrSetImpl< llvm::Value * > &ConstantValues, const llvm::SmallPtrSetImpl< llvm::Value * > &ActiveValues, DIFFE_TYPE ActiveReturns) | |
| Construct the analyzer from the a previous set of constant and active values and whether returns are active. | |
| bool | isConstantInstruction (TypeResults const &TR, llvm::Instruction *inst) |
| Return whether this instruction is known not to propagate adjoints Note that instructions could return an active pointer, but do not propagate adjoints themselves. | |
| bool | isConstantValue (TypeResults const &TR, llvm::Value *val) |
| Return whether this values is known not to contain derivative. | |
| bool | isValueInactiveFromUsers (TypeResults const &TR, llvm::Value *val, UseActivity UA, llvm::Instruction **FoundInst=nullptr, llvm::Value **FoundValue=nullptr) |
| Is the value free of any active uses. | |
| bool | isValueActivelyStoredOrReturned (TypeResults const &TR, llvm::Value *val, bool outside=false) |
| Is the value potentially actively returned or stored. | |
Public Attributes | |
| const DIFFE_TYPE | ActiveReturns |
| Whether the returns of the function being analyzed are active. | |
Helper class to analyze the differential activity.
Definition at line 67 of file ActivityAnalysis.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| OnlyLoads | |
| OnlyStores | |
| OnlyNonPointerStores | |
| AllStores | |
Definition at line 233 of file ActivityAnalysis.h.
|
inline |
Construct the analyzer from the a previous set of constant and active values and whether returns are active.
The all arguments of the functions being analyzed must be in the set of constant and active values, lest an error occur during analysis
Definition at line 116 of file ActivityAnalysis.h.
| bool ActivityAnalyzer::isConstantInstruction | ( | TypeResults const & | TR, |
| llvm::Instruction * | inst ) |
Return whether this instruction is known not to propagate adjoints Note that instructions could return an active pointer, but do not propagate adjoints themselves.
Previously computed inactives remain inactive
Overwrite activity using metadata
A store into all integral memory is inactive
Definition at line 744 of file ActivityAnalysis.cpp.
References EnzymePrintActivity.
| bool ActivityAnalyzer::isConstantValue | ( | TypeResults const & | TR, |
| llvm::Value * | val ) |
Return whether this values is known not to contain derivative.
| bool ActivityAnalyzer::isValueActivelyStoredOrReturned | ( | TypeResults const & | TR, |
| llvm::Value * | val, | ||
| bool | outside = false ) |
Is the value potentially actively returned or stored.
Definition at line 3497 of file ActivityAnalysis.cpp.
| bool ActivityAnalyzer::isValueInactiveFromUsers | ( | TypeResults const & | TR, |
| llvm::Value * | val, | ||
| UseActivity | UA, | ||
| llvm::Instruction ** | FoundInst = nullptr, | ||
| llvm::Value ** | FoundValue = nullptr ) |
Is the value free of any active uses.
| const DIFFE_TYPE ActivityAnalyzer::ActiveReturns |
Whether the returns of the function being analyzed are active.
Definition at line 81 of file ActivityAnalysis.h.