|
Enzyme main
|
#include <deque>#include <set>#include <llvm/Config/llvm-config.h>#include "SCEV/ScalarEvolution.h"#include "SCEV/ScalarEvolutionExpander.h"#include "Utils.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/LoopAnalysisManager.h"#include "llvm/Analysis/TargetLibraryInfo.h"#include "llvm/IR/Function.h"#include "llvm/IR/Module.h"#include "llvm/IR/Type.h"#include "llvm/IR/Instructions.h"#include "llvm/Transforms/Utils/ValueMapper.h"#include "llvm/ADT/STLExtras.h"

Go to the source code of this file.
Classes | |
| class | PreProcessCache |
Enumerations | |
| enum class | UseReq { Need , Recur , Cached } |
Functions | |
| bool | DetectReadonlyOrThrow (llvm::Module &M) |
| static void | getExitBlocks (const llvm::Loop *L, llvm::SmallPtrSetImpl< llvm::BasicBlock * > &ExitBlocks) |
| static llvm::SmallVector< llvm::BasicBlock *, 3 > | getLatches (const llvm::Loop *L, const llvm::SmallPtrSetImpl< llvm::BasicBlock * > &ExitBlocks) |
| static llvm::SmallPtrSet< llvm::BasicBlock *, 4 > | getGuaranteedUnreachable (llvm::Function *F) |
| static void | calculateUnusedValues (const llvm::Function &oldFunc, llvm::SmallPtrSetImpl< const llvm::Value * > &unnecessaryValues, llvm::SmallPtrSetImpl< const llvm::Instruction * > &unnecessaryInstructions, bool returnValue, llvm::function_ref< bool(const llvm::Value *)> valneeded, llvm::function_ref< UseReq(const llvm::Instruction *)> instneeded, llvm::function_ref< bool(const llvm::Instruction *, const llvm::Value *)> useneeded) |
| static void | calculateUnusedStores (const llvm::Function &oldFunc, llvm::SmallPtrSetImpl< const llvm::Instruction * > &unnecessaryStores, llvm::function_ref< bool(const llvm::Instruction *)> needStore) |
| void | RecursivelyReplaceAddressSpace (llvm::Value *AI, llvm::Value *rep, bool legal) |
| void | ReplaceFunctionImplementation (llvm::Module &M) |
| bool | couldFunctionArgumentCapture (llvm::CallInst *CI, llvm::Value *val) |
| Is the use of value val as an argument of call CI potentially captured. | |
| llvm::FunctionType * | getFunctionTypeForClone (llvm::FunctionType *FTy, DerivativeMode mode, unsigned width, llvm::Type *additionalArg, llvm::ArrayRef< DIFFE_TYPE > constant_args, bool diffeReturnArg, bool returnTape, bool returnPrimal, bool returnShadow) |
| bool | LowerSparsification (llvm::Function *F, bool replaceAll=true) |
| Lower __enzyme_todense, returning if changed. | |
Variables | |
| llvm::cl::opt< bool > | EnzymeAlwaysInlineDiff |
|
strong |
| Enumerator | |
|---|---|
| Need | |
| Recur | |
| Cached | |
Definition at line 251 of file FunctionUtils.h.
|
inlinestatic |
Definition at line 374 of file FunctionUtils.h.
References GradientUtils::oldFunc.
|
inlinestatic |
Definition at line 256 of file FunctionUtils.h.
References Cached, endsWith(), Need, GradientUtils::oldFunc, and Recur.
| bool couldFunctionArgumentCapture | ( | llvm::CallInst * | CI, |
| llvm::Value * | val ) |
Is the use of value val as an argument of call CI potentially captured.
Definition at line 182 of file FunctionUtils.cpp.
Referenced by PreProcessCache::preprocessForClone().
| bool DetectReadonlyOrThrow | ( | llvm::Module & | M | ) |
|
inlinestatic |
Definition at line 124 of file FunctionUtils.h.
Referenced by CacheUtility::getContext().
| llvm::FunctionType * getFunctionTypeForClone | ( | llvm::FunctionType * | FTy, |
| DerivativeMode | mode, | ||
| unsigned | width, | ||
| llvm::Type * | additionalArg, | ||
| llvm::ArrayRef< DIFFE_TYPE > | constant_args, | ||
| bool | diffeReturnArg, | ||
| bool | returnTape, | ||
| bool | returnPrimal, | ||
| bool | returnShadow ) |
Definition at line 2936 of file FunctionUtils.cpp.
References DUP_ARG, DUP_NONEED, getDefaultAnonymousTapeType(), GradientUtils::getShadowType(), OUT_DIFF, and ReverseModeCombined.
Referenced by PreProcessCache::CloneFunctionWithReturns(), and AdjointGenerator::recursivelyHandleSubfunction().
|
inlinestatic |
Definition at line 194 of file FunctionUtils.h.
Referenced by DetectReadonlyOrThrowFn(), and PreProcessCache::preprocessForClone().
|
inlinestatic |
Definition at line 166 of file FunctionUtils.h.
Referenced by CacheUtility::getContext().
| bool LowerSparsification | ( | llvm::Function * | F, |
| bool | replaceAll = true ) |
Lower __enzyme_todense, returning if changed.
Definition at line 8936 of file FunctionUtils.cpp.
References contains(), EnzymeAutoSparsity(), fixSparseIndices(), getFuncNameFromCall(), and replaceToDense().
Referenced by EnzymeLowerSparsification().
| void RecursivelyReplaceAddressSpace | ( | llvm::Value * | AI, |
| llvm::Value * | rep, | ||
| bool | legal ) |
Referenced by PreProcessCache::LowerAllocAddr().
| void ReplaceFunctionImplementation | ( | llvm::Module & | M | ) |
Referenced by PreProcessCache::optimizeIntermediate().
|
extern |
Referenced by PreProcessCache::CloneFunctionWithReturns().