|
Enzyme main
|
#include <llvm/ADT/StringMap.h>#include <llvm/Analysis/AliasAnalysis.h>#include <llvm/Analysis/TargetLibraryInfo.h>#include <llvm/IR/IRBuilder.h>#include <llvm/IR/InlineAsm.h>#include <llvm/IR/Instructions.h>#include "Utils.h"

Go to the source code of this file.
Functions | |
| static bool | isAllocationFunction (const llvm::StringRef name, const llvm::TargetLibraryInfo &TLI) |
| Return whether a given function is a known C/C++ memory allocation function For updating below one should read MemoryBuiltins.cpp, TargetLibraryInfo.cpp. | |
| static bool | isDeallocationFunction (const llvm::StringRef name, const llvm::TargetLibraryInfo &TLI) |
| Return whether a given function is a known C/C++ memory deallocation function For updating below one should read MemoryBuiltins.cpp, TargetLibraryInfo.cpp. | |
| static void | zeroKnownAllocation (llvm::IRBuilder<> &bb, llvm::Value *toZero, llvm::ArrayRef< llvm::Value * > argValues, const llvm::StringRef funcName, const llvm::TargetLibraryInfo &TLI, llvm::CallInst *orig) |
| llvm::CallInst * | freeKnownAllocation (llvm::IRBuilder<> &builder, llvm::Value *tofree, llvm::StringRef allocationfn, const llvm::DebugLoc &debuglocation, const llvm::TargetLibraryInfo &TLI, llvm::CallInst *orig, GradientUtils *gutils) |
| Perform the corresponding deallocation of tofree, given it was allocated by allocationfn. | |
| static bool | isAllocationCall (const llvm::Value *TmpOrig, llvm::TargetLibraryInfo &TLI) |
| static bool | isDeallocationCall (const llvm::Value *TmpOrig, llvm::TargetLibraryInfo &TLI) |
Variables | |
| llvm::StringMap< std::function< llvm::Value *(llvm::IRBuilder<> &, llvm::CallInst *, llvm::ArrayRef< llvm::Value * >, GradientUtils *)> > | shadowHandlers |
| llvm::StringMap< std::function< llvm::CallInst *(llvm::IRBuilder<> &, llvm::Value *)> > | shadowErasers |
| llvm::CallInst * freeKnownAllocation | ( | llvm::IRBuilder<> & | builder, |
| llvm::Value * | tofree, | ||
| llvm::StringRef | allocationfn, | ||
| const llvm::DebugLoc & | debuglocation, | ||
| const llvm::TargetLibraryInfo & | TLI, | ||
| llvm::CallInst * | orig, | ||
| GradientUtils * | gutils ) |
Perform the corresponding deallocation of tofree, given it was allocated by allocationfn.
Definition at line 9697 of file GradientUtils.cpp.
Referenced by AdjointGenerator::handleKnownCallDerivatives().
|
inlinestatic |
Definition at line 267 of file LibraryFuncs.h.
References getFuncNameFromCall(), getFunctionFromCall(), isAllocationFunction(), and CacheUtility::TLI.
Referenced by arePointersGuaranteedNoAlias(), DetectReadonlyOrThrowFn(), PreProcessCache::preprocessForClone(), AdjointGenerator::visitCallInst(), AdjointGenerator::visitCommonStore(), and AdjointGenerator::visitMemSetCommon().
|
inlinestatic |
Return whether a given function is a known C/C++ memory allocation function For updating below one should read MemoryBuiltins.cpp, TargetLibraryInfo.cpp.
Definition at line 46 of file LibraryFuncs.h.
References shadowHandlers, and CacheUtility::TLI.
Referenced by AdjointGenerator::handleKnownCallDerivatives(), isAllocationCall(), TypeAnalyzer::visitCallBase(), writesToMemoryReadBy(), and zeroKnownAllocation().
|
inlinestatic |
Definition at line 282 of file LibraryFuncs.h.
References getFuncNameFromCall(), isDeallocationFunction(), and CacheUtility::TLI.
|
inlinestatic |
Return whether a given function is a known C/C++ memory deallocation function For updating below one should read MemoryBuiltins.cpp, TargetLibraryInfo.cpp.
Definition at line 123 of file LibraryFuncs.h.
References CacheUtility::TLI.
Referenced by isDeallocationCall(), TypeAnalyzer::visitCallBase(), and writesToMemoryReadBy().
|
inlinestatic |
Definition at line 200 of file LibraryFuncs.h.
References getAllocationIndexFromCall(), getInt8PtrTy(), isAllocationFunction(), and CacheUtility::TLI.
Referenced by AdjointGenerator::handleKnownCallDerivatives().
|
extern |
Definition at line 71 of file GradientUtils.cpp.
Referenced by EnzymeRegisterAllocationHandler().
|
extern |
Definition at line 70 of file GradientUtils.cpp.
Referenced by isAllocationFunction().