|
Enzyme main
|
#include "FunctionUtils.h"

Public Member Functions | |
| PreProcessCache () | |
| PreProcessCache (PreProcessCache &)=delete | |
| PreProcessCache (PreProcessCache &&prev) | |
| llvm::Function * | preprocessForClone (llvm::Function *F, DerivativeMode mode) |
| llvm::AAResults & | getAAResultsFromFunction (llvm::Function *NewF) |
| llvm::Function * | CloneFunctionWithReturns (DerivativeMode mode, unsigned width, llvm::Function *&F, llvm::ValueToValueMapTy &ptrInputs, llvm::ArrayRef< DIFFE_TYPE > constant_args, llvm::SmallPtrSetImpl< llvm::Value * > &constants, llvm::SmallPtrSetImpl< llvm::Value * > &nonconstant, llvm::SmallPtrSetImpl< llvm::Value * > &returnvals, bool returnTape, bool returnPrimal, bool returnShadow, const llvm::Twine &name, llvm::ValueMap< const llvm::Value *, AssertingReplacingVH > *VMapO, bool diffeReturnArg, llvm::Type *additionalArg=nullptr) |
| void | ReplaceReallocs (llvm::Function *NewF, bool mem2reg=false) |
| Calls to realloc with an appropriate implementation. | |
| void | LowerAllocAddr (llvm::Function *NewF) |
| void | AlwaysInline (llvm::Function *NewF) |
| void | optimizeIntermediate (llvm::Function *F) |
| void | clear () |
Public Attributes | |
| llvm::LoopAnalysisManager | LAM |
| llvm::FunctionAnalysisManager | FAM |
| llvm::ModuleAnalysisManager | MAM |
| std::map< std::pair< llvm::Function *, DerivativeMode >, llvm::Function * > | cache |
| std::map< llvm::Function *, llvm::Function * > | CloneOrigin |
Definition at line 78 of file FunctionUtils.h.
| PreProcessCache::PreProcessCache | ( | ) |
Definition at line 1526 of file FunctionUtils.cpp.
References EnzymeAggressiveAA(), FAM, LAM, and MAM.
|
delete |
|
inline |
Definition at line 86 of file FunctionUtils.h.
References cache, and CloneOrigin.
| void PreProcessCache::AlwaysInline | ( | llvm::Function * | NewF | ) |
Definition at line 964 of file FunctionUtils.cpp.
References FAM, getBaseObject(), and hasMetadata().
| void PreProcessCache::clear | ( | ) |
| Function * PreProcessCache::CloneFunctionWithReturns | ( | DerivativeMode | mode, |
| unsigned | width, | ||
| llvm::Function *& | F, | ||
| llvm::ValueToValueMapTy & | ptrInputs, | ||
| llvm::ArrayRef< DIFFE_TYPE > | constant_args, | ||
| llvm::SmallPtrSetImpl< llvm::Value * > & | constants, | ||
| llvm::SmallPtrSetImpl< llvm::Value * > & | nonconstant, | ||
| llvm::SmallPtrSetImpl< llvm::Value * > & | returnvals, | ||
| bool | returnTape, | ||
| bool | returnPrimal, | ||
| bool | returnShadow, | ||
| const llvm::Twine & | name, | ||
| llvm::ValueMap< const llvm::Value *, AssertingReplacingVH > * | VMapO, | ||
| bool | diffeReturnArg, | ||
| llvm::Type * | additionalArg = nullptr ) |
Definition at line 2995 of file FunctionUtils.cpp.
References CloneOrigin, CONSTANT, convertSRetTypeToString(), DUP_ARG, DUP_NONEED, EnzymeAlwaysInlineDiff, EnzymePrintActivity, getFunctionTypeForClone(), preprocessForClone(), PrimalParamAttrsToPreserve, ReverseModeCombined, ReverseModeGradient, and ShadowParamAttrsToPreserve.
Referenced by DiffeGradientUtils::CreateFromClone().
| llvm::AAResults & PreProcessCache::getAAResultsFromFunction | ( | llvm::Function * | NewF | ) |
Definition at line 1577 of file FunctionUtils.cpp.
References FAM.
| void PreProcessCache::LowerAllocAddr | ( | llvm::Function * | NewF | ) |
Definition at line 1051 of file FunctionUtils.cpp.
References hasMetadata(), RecursivelyReplaceAddressSpace(), and simplifyExtractions().
| void PreProcessCache::optimizeIntermediate | ( | llvm::Function * | F | ) |
Definition at line 3395 of file FunctionUtils.cpp.
References CoaleseTrivialMallocs(), EnzymeCoalese(), EnzymePostOptLevel(), EnzymeSelectOpt(), FAM, ReplaceFunctionImplementation(), and SelectOptimization().
| Function * PreProcessCache::preprocessForClone | ( | llvm::Function * | F, |
| DerivativeMode | mode ) |
Definition at line 2247 of file FunctionUtils.cpp.
References cache, Call, CanonicalizeLoops(), CloneOrigin, Constant, couldFunctionArgumentCapture(), DetectReadonlyOrThrowFn(), EnzymeInline(), EnzymeInlineCount(), EnzymeLowerGlobals(), EnzymeNameInstructions(), EnzymeNoAlias(), EnzymePHIRestructure(), EnzymePostInlineOpt(), EnzymePreopt(), EnzymePrint, FAM, ForceRecursiveInlining(), ForwardMode, ForwardModeSplit, getGuaranteedUnreachable(), getInt8PtrTy(), getIntrinsicDeclaration(), isAllocationCall(), isIntelSubscriptIntrinsic(), isMemFreeLibMFunction(), RemoveRedundantPHI(), ReplaceReallocs(), ReverseModeCombined, ReverseModeGradient, ReverseModePrimal, setFullWillReturn(), SimplifyMPIQueries(), SplitPHIs(), startsWith(), and UpgradeAllocasToMallocs().
Referenced by CloneFunctionWithReturns().
| void PreProcessCache::ReplaceReallocs | ( | llvm::Function * | NewF, |
| bool | mem2reg = false ) |
Calls to realloc with an appropriate implementation.
Definition at line 1122 of file FunctionUtils.cpp.
References FAM, getInt8PtrTy(), getIntrinsicDeclaration(), nextPowerOfTwo(), and OldAllocationSize().
Referenced by preprocessForClone().
| std::map<std::pair<llvm::Function *, DerivativeMode>, llvm::Function *> PreProcessCache::cache |
Definition at line 95 of file FunctionUtils.h.
Referenced by clear(), PreProcessCache(), and preprocessForClone().
| std::map<llvm::Function *, llvm::Function *> PreProcessCache::CloneOrigin |
Definition at line 96 of file FunctionUtils.h.
Referenced by CloneFunctionWithReturns(), PreProcessCache(), and preprocessForClone().
| llvm::FunctionAnalysisManager PreProcessCache::FAM |
Definition at line 92 of file FunctionUtils.h.
Referenced by AlwaysInline(), clear(), getAAResultsFromFunction(), optimizeIntermediate(), PreProcessCache(), preprocessForClone(), and ReplaceReallocs().
| llvm::LoopAnalysisManager PreProcessCache::LAM |
Definition at line 91 of file FunctionUtils.h.
Referenced by clear(), and PreProcessCache().
| llvm::ModuleAnalysisManager PreProcessCache::MAM |
Definition at line 93 of file FunctionUtils.h.
Referenced by clear(), and PreProcessCache().