Enzyme main
Loading...
Searching...
No Matches
PreProcessCache Class Reference

#include "FunctionUtils.h"

Collaboration diagram for PreProcessCache:

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
 

Detailed Description

Definition at line 78 of file FunctionUtils.h.

Constructor & Destructor Documentation

◆ PreProcessCache() [1/3]

PreProcessCache::PreProcessCache ( )

Definition at line 1526 of file FunctionUtils.cpp.

References EnzymeAggressiveAA(), FAM, LAM, and MAM.

◆ PreProcessCache() [2/3]

PreProcessCache::PreProcessCache ( PreProcessCache & )
delete

◆ PreProcessCache() [3/3]

PreProcessCache::PreProcessCache ( PreProcessCache && prev)
inline

Definition at line 86 of file FunctionUtils.h.

References cache, and CloneOrigin.

Member Function Documentation

◆ AlwaysInline()

void PreProcessCache::AlwaysInline ( llvm::Function * NewF)

Definition at line 964 of file FunctionUtils.cpp.

References FAM, getBaseObject(), and hasMetadata().

◆ clear()

void PreProcessCache::clear ( )

Definition at line 3462 of file FunctionUtils.cpp.

References cache, FAM, LAM, and MAM.

◆ CloneFunctionWithReturns()

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 )

◆ getAAResultsFromFunction()

llvm::AAResults & PreProcessCache::getAAResultsFromFunction ( llvm::Function * NewF)

Definition at line 1577 of file FunctionUtils.cpp.

References FAM.

◆ LowerAllocAddr()

void PreProcessCache::LowerAllocAddr ( llvm::Function * NewF)

◆ optimizeIntermediate()

void PreProcessCache::optimizeIntermediate ( llvm::Function * F)

◆ preprocessForClone()

◆ ReplaceReallocs()

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().

Member Data Documentation

◆ cache

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().

◆ CloneOrigin

std::map<llvm::Function *, llvm::Function *> PreProcessCache::CloneOrigin

Definition at line 96 of file FunctionUtils.h.

Referenced by CloneFunctionWithReturns(), PreProcessCache(), and preprocessForClone().

◆ FAM

llvm::FunctionAnalysisManager PreProcessCache::FAM

◆ LAM

llvm::LoopAnalysisManager PreProcessCache::LAM

Definition at line 91 of file FunctionUtils.h.

Referenced by clear(), and PreProcessCache().

◆ MAM

llvm::ModuleAnalysisManager PreProcessCache::MAM

Definition at line 93 of file FunctionUtils.h.

Referenced by clear(), and PreProcessCache().


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