Enzyme main
Loading...
Searching...
No Matches
GradientUtils.h File Reference
#include <functional>
#include <map>
#include <string>
#include <llvm/Config/llvm-config.h>
#include "SCEV/ScalarEvolution.h"
#include "SCEV/ScalarEvolutionExpander.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/DebugInfoMetadata.h"
#include "llvm/IR/Dominators.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/PostDominators.h"
#include "llvm/Analysis/ValueTracking.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "ActivityAnalysis.h"
#include "CacheUtility.h"
#include "EnzymeLogic.h"
#include "Utils.h"
#include "llvm-c/Core.h"
#include "Interfaces/CloneFunction.h"
#include "Interfaces/EnzymeLogic.h"
#include "Analysis/ActivityAnalysis.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/Interfaces/FunctionInterfaces.h"
Include dependency graph for GradientUtils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  InvertedPointerConfig
 
class  InvertedPointerVH
 
class  GradientUtils
 
struct  GradientUtils::LoadLikeCall
 
struct  GradientUtils::Rematerializer
 
struct  GradientUtils::ShadowRematerializer
 
class  mlir::enzyme::MGradientUtils
 
class  mlir::enzyme::MDiffeGradientUtils
 

Namespaces

namespace  mlir
 
namespace  mlir::enzyme
 

Functions

void SubTransferHelper (GradientUtils *gutils, DerivativeMode Mode, llvm::Type *secretty, llvm::Intrinsic::ID intrinsic, unsigned dstalign, unsigned srcalign, unsigned offset, bool dstConstant, llvm::Value *shadow_dst, bool srcConstant, llvm::Value *shadow_src, llvm::Value *length, llvm::Value *isVolatile, llvm::CallInst *MTI, bool allowForward=true, bool shadowsLookedUp=false, bool backwardsShadow=false)
 

Variables

llvm::StringMap< std::function< llvm::Value *(llvm::IRBuilder<> &, llvm::CallInst *, llvm::ArrayRef< llvm::Value * >, GradientUtils *)> > shadowHandlers
 
llvm::StringMap< std::pair< std::function< bool(llvm::IRBuilder<> &, llvm::CallInst *, GradientUtils &, llvm::Value *&, llvm::Value *&, llvm::Value *&)>, std::function< void(llvm::IRBuilder<> &, llvm::CallInst *, DiffeGradientUtils &, llvm::Value *)> > > customCallHandlers
 
llvm::StringMap< std::function< bool(llvm::IRBuilder<> &, llvm::CallInst *, GradientUtils &, llvm::Value *&, llvm::Value *&)> > customFwdCallHandlers
 
constexpr int IndexMappingError = 0x0000fffd
 
llvm::cl::opt< bool > EnzymeInactiveDynamic
 
llvm::cl::opt< bool > EnzymeFreeInternalAllocations
 
llvm::cl::opt< bool > EnzymeRematerialize
 
llvm::SmallVector< unsigned int, 9 > MD_ToCopy
 

Function Documentation

◆ SubTransferHelper()

void SubTransferHelper ( GradientUtils * gutils,
DerivativeMode Mode,
llvm::Type * secretty,
llvm::Intrinsic::ID intrinsic,
unsigned dstalign,
unsigned srcalign,
unsigned offset,
bool dstConstant,
llvm::Value * shadow_dst,
bool srcConstant,
llvm::Value * shadow_src,
llvm::Value * length,
llvm::Value * isVolatile,
llvm::CallInst * MTI,
bool allowForward = true,
bool shadowsLookedUp = false,
bool backwardsShadow = false )

Variable Documentation

◆ customCallHandlers

llvm::StringMap<std::pair< std::function<bool(llvm::IRBuilder<> &, llvm::CallInst *, GradientUtils &, llvm::Value *&, llvm::Value *&, llvm::Value *&)>, std::function<void(llvm::IRBuilder<> &, llvm::CallInst *, DiffeGradientUtils &, llvm::Value *)> > > customCallHandlers
extern

Definition at line 78 of file GradientUtils.cpp.

Referenced by EnzymeRegisterCallHandler(), and AdjointGenerator::visitCallInst().

◆ customFwdCallHandlers

llvm::StringMap< std::function<bool(llvm::IRBuilder<> &, llvm::CallInst *, GradientUtils &, llvm::Value *&, llvm::Value *&)> > customFwdCallHandlers
extern

◆ EnzymeFreeInternalAllocations

llvm::cl::opt<bool> EnzymeFreeInternalAllocations
extern

◆ EnzymeInactiveDynamic

llvm::cl::opt<bool> EnzymeInactiveDynamic
extern

◆ EnzymeRematerialize

llvm::cl::opt<bool> EnzymeRematerialize
extern

◆ IndexMappingError

int IndexMappingError = 0x0000fffd
constexpr

◆ MD_ToCopy

llvm::SmallVector<unsigned int, 9> MD_ToCopy
extern

Definition at line 130 of file GradientUtils.cpp.

Referenced by AdjointGenerator::visitMemSetCommon().

◆ shadowHandlers

llvm::StringMap<std::function<llvm::Value *( llvm::IRBuilder<> &, llvm::CallInst *, llvm::ArrayRef<llvm::Value *>, GradientUtils *)> > shadowHandlers
extern

Definition at line 70 of file GradientUtils.cpp.