Enzyme main
Loading...
Searching...
No Matches
CApi.cpp File Reference
#include "CApi.h"
#include "Utils.h"
#include "SCEV/ScalarEvolution.h"
#include "SCEV/ScalarEvolutionExpander.h"
#include "DiffeGradientUtils.h"
#include "DifferentialUseAnalysis.h"
#include "EnzymeLogic.h"
#include "GradientUtils.h"
#include "LibraryFuncs.h"
#include "SCEV/TargetLibraryInfo.h"
#include "TraceInterface.h"
#include "llvm/Analysis/CallGraph.h"
#include "llvm/Analysis/GlobalsModRef.h"
#include "llvm/IR/DIBuilder.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Transforms/IPO/Attributor.h"
Include dependency graph for CApi.cpp:

Go to the source code of this file.

Classes

struct  MyAttributorLegacyPass
 

Macros

#define addAttribute   addAttributeAtIndex
 
#define removeAttribute   removeAttributeAtIndex
 
#define getAttribute   getAttributeAtIndex
 
#define hasAttribute   hasAttributeAtIndex
 

Functions

TargetLibraryInfo eunwrap (LLVMTargetLibraryInfoRef P)
 
EnzymeLogiceunwrap (EnzymeLogicRef LR)
 
TraceInterfaceeunwrap (EnzymeTraceInterfaceRef Ref)
 
TypeAnalysiseunwrap (EnzymeTypeAnalysisRef TAR)
 
AugmentedReturneunwrap (EnzymeAugmentedReturnPtr ARP)
 
EnzymeAugmentedReturnPtr ewrap (const AugmentedReturn &AR)
 
ConcreteType eunwrap (CConcreteType CDT, llvm::LLVMContext &ctx)
 
std::vector< int > eunwrap (IntList IL)
 
std::set< int64_t > eunwrap64 (IntList IL)
 
TypeTree eunwrap (CTypeTreeRef CTT)
 
CConcreteType ewrap (const ConcreteType &CT)
 
IntList ewrap (const std::vector< int > &offsets)
 
CTypeTreeRef ewrap (const TypeTree &TT)
 
FnTypeInfo eunwrap (CFnTypeInfo CTI, llvm::Function *F)
 
void EnzymeSetCLBool (void *ptr, uint8_t val)
 
uint8_t EnzymeGetCLBool (void *ptr)
 
void EnzymeSetCLInteger (void *ptr, int64_t val)
 
int64_t EnzymeGetCLInteger (void *ptr)
 
void EnzymeSetCLString (void *ptr, const char *val)
 
EnzymeLogicRef CreateEnzymeLogic (uint8_t PostOpt)
 
void EnzymeLogicSetExternalContext (EnzymeLogicRef Ref, void *ExternalContext)
 
void * EnzymeLogicGetExternalContext (EnzymeLogicRef Ref)
 
EnzymeTraceInterfaceRef FindEnzymeStaticTraceInterface (LLVMModuleRef M)
 
EnzymeTraceInterfaceRef CreateEnzymeStaticTraceInterface (LLVMContextRef C, LLVMValueRef getTraceFunction, LLVMValueRef getChoiceFunction, LLVMValueRef insertCallFunction, LLVMValueRef insertChoiceFunction, LLVMValueRef insertArgumentFunction, LLVMValueRef insertReturnFunction, LLVMValueRef insertFunctionFunction, LLVMValueRef insertChoiceGradientFunction, LLVMValueRef insertArgumentGradientFunction, LLVMValueRef newTraceFunction, LLVMValueRef freeTraceFunction, LLVMValueRef hasCallFunction, LLVMValueRef hasChoiceFunction)
 
EnzymeTraceInterfaceRef CreateEnzymeDynamicTraceInterface (LLVMValueRef interface, LLVMValueRef F)
 
void ClearEnzymeLogic (EnzymeLogicRef Ref)
 
void EnzymeLogicErasePreprocessedFunctions (EnzymeLogicRef Ref)
 
void FreeEnzymeLogic (EnzymeLogicRef Ref)
 
void FreeTraceInterface (EnzymeTraceInterfaceRef Ref)
 
EnzymeTypeAnalysisRef CreateTypeAnalysis (EnzymeLogicRef Log, char **customRuleNames, CustomRuleType *customRules, size_t numRules)
 
void ClearTypeAnalysis (EnzymeTypeAnalysisRef TAR)
 
void FreeTypeAnalysis (EnzymeTypeAnalysisRef TAR)
 
EnzymeLogicRef EnzymeTypeAnalysisGetLogic (EnzymeTypeAnalysisRef TAR)
 
void * EnzymeAnalyzeTypes (EnzymeTypeAnalysisRef TAR, CFnTypeInfo CTI, LLVMValueRef F)
 
void * EnzymeGradientUtilsTypeAnalyzer (GradientUtils *G)
 
EnzymeTypeAnalysisRef EnzymeGetTypeAnalysisFromTypeAnalyzer (void *TAR)
 
void EnzymeGradientUtilsErase (GradientUtils *G, LLVMValueRef I)
 
void EnzymeGradientUtilsEraseWithPlaceholder (GradientUtils *G, LLVMValueRef I, LLVMValueRef orig, uint8_t erase)
 
void EnzymeGradientUtilsReplaceAWithB (GradientUtils *G, LLVMValueRef A, LLVMValueRef B)
 
void EnzymeRegisterAllocationHandler (char *Name, CustomShadowAlloc AHandle, CustomShadowFree FHandle)
 
void EnzymeRegisterCallHandler (const char *Name, CustomAugmentedFunctionForward FwdHandle, CustomFunctionReverse RevHandle)
 
void EnzymeRegisterFwdCallHandler (char *Name, CustomFunctionForward FwdHandle)
 
void EnzymeRegisterDiffUseCallHandler (char *Name, CustomFunctionDiffUse Handle)
 
uint8_t EnzymeGradientUtilsGetRuntimeActivity (GradientUtils *gutils)
 
void * EnzymeGradientUtilsGetExternalContext (GradientUtils *gutils)
 
uint8_t EnzymeGradientUtilsGetStrongZero (GradientUtils *gutils)
 
uint8_t EnzymeGradientUtilsGetAtomicAdd (GradientUtils *gutils)
 
uint64_t EnzymeGradientUtilsGetWidth (GradientUtils *gutils)
 
LLVMTypeRef EnzymeGradientUtilsGetShadowType (GradientUtils *gutils, LLVMTypeRef T)
 
LLVMTypeRef EnzymeGetShadowType (uint64_t width, LLVMTypeRef T)
 
LLVMValueRef EnzymeGradientUtilsNewFromOriginal (GradientUtils *gutils, LLVMValueRef val)
 
void EnzymeReplaceOriginalToNew (GradientUtils *gutils, LLVMValueRef origC, LLVMValueRef repC)
 
CDerivativeMode EnzymeGradientUtilsGetMode (GradientUtils *gutils)
 
CDIFFE_TYPE EnzymeGradientUtilsGetDiffeType (GradientUtils *G, LLVMValueRef oval, uint8_t foreignFunction)
 
CDIFFE_TYPE EnzymeGradientUtilsGetReturnDiffeType (GradientUtils *G, LLVMValueRef oval, uint8_t *needsPrimal, uint8_t *needsShadow, CDerivativeMode mode)
 
void EnzymeGradientUtilsSetDebugLocFromOriginal (GradientUtils *gutils, LLVMValueRef val, LLVMValueRef orig)
 
LLVMValueRef EnzymeInsertValue (LLVMBuilderRef B, LLVMValueRef val, LLVMValueRef val2, unsigned *sz, int64_t length, const char *name)
 
LLVMValueRef EnzymeGradientUtilsLookup (GradientUtils *gutils, LLVMValueRef val, LLVMBuilderRef B)
 
LLVMValueRef EnzymeGradientUtilsInvertPointer (GradientUtils *gutils, LLVMValueRef val, LLVMBuilderRef B)
 
LLVMValueRef EnzymeGradientUtilsDiffe (DiffeGradientUtils *gutils, LLVMValueRef val, LLVMBuilderRef B)
 
void EnzymeGradientUtilsAddToDiffe (DiffeGradientUtils *gutils, LLVMValueRef val, LLVMValueRef diffe, LLVMBuilderRef B, LLVMTypeRef T)
 
void EnzymeGradientUtilsAddToInvertedPointerDiffe (DiffeGradientUtils *gutils, LLVMValueRef orig, LLVMValueRef origVal, LLVMTypeRef addingType, unsigned start, unsigned size, LLVMValueRef origptr, LLVMValueRef dif, LLVMBuilderRef BuilderM, unsigned align, LLVMValueRef mask)
 
void EnzymeGradientUtilsAddToInvertedPointerDiffeTT (DiffeGradientUtils *gutils, LLVMValueRef orig, LLVMValueRef origVal, CTypeTreeRef vd, unsigned LoadSize, LLVMValueRef origptr, LLVMValueRef prediff, LLVMBuilderRef BuilderM, unsigned align, LLVMValueRef premask)
 
void EnzymeGradientUtilsSetDiffe (DiffeGradientUtils *gutils, LLVMValueRef val, LLVMValueRef diffe, LLVMBuilderRef B)
 
uint8_t EnzymeGradientUtilsIsConstantValue (GradientUtils *gutils, LLVMValueRef val)
 
uint8_t EnzymeGradientUtilsIsConstantInstruction (GradientUtils *gutils, LLVMValueRef val)
 
LLVMBasicBlockRef EnzymeGradientUtilsAllocationBlock (GradientUtils *gutils)
 
uint8_t EnzymeGradientUtilsGetUncacheableArgs (GradientUtils *gutils, LLVMValueRef orig, uint8_t *data, uint64_t size)
 
CTypeTreeRef EnzymeGradientUtilsAllocAndGetTypeTree (GradientUtils *gutils, LLVMValueRef val)
 
void EnzymeGradientUtilsDumpTypeResults (GradientUtils *gutils)
 
void EnzymeGradientUtilsSubTransferHelper (GradientUtils *gutils, CDerivativeMode mode, LLVMTypeRef secretty, uint64_t intrinsic, uint64_t dstAlign, uint64_t srcAlign, uint64_t offset, uint8_t dstConstant, LLVMValueRef shadow_dst, uint8_t srcConstant, LLVMValueRef shadow_src, LLVMValueRef length, LLVMValueRef isVolatile, LLVMValueRef MTI, uint8_t allowForward, uint8_t shadowsLookedUp)
 
LLVMBasicBlockRef EnzymeGradientUtilsAddReverseBlock (GradientUtils *gutils, LLVMBasicBlockRef block, const char *name, uint8_t forkCache, uint8_t push)
 
void EnzymeGradientUtilsSetReverseBlock (GradientUtils *gutils, LLVMBasicBlockRef block)
 
LLVMValueRef EnzymeCreateForwardDiff (EnzymeLogicRef Logic, LLVMValueRef request_req, LLVMBuilderRef request_ip, LLVMValueRef todiff, CDIFFE_TYPE retType, CDIFFE_TYPE *constant_args, size_t constant_args_size, EnzymeTypeAnalysisRef TA, uint8_t returnValue, CDerivativeMode mode, uint8_t freeMemory, uint8_t runtimeActivity, uint8_t strongZero, unsigned width, LLVMTypeRef additionalArg, CFnTypeInfo typeInfo, uint8_t subsequent_calls_may_write, uint8_t *_overwritten_args, size_t overwritten_args_size, EnzymeAugmentedReturnPtr augmented)
 
LLVMValueRef EnzymeCreatePrimalAndGradient (EnzymeLogicRef Logic, LLVMValueRef request_req, LLVMBuilderRef request_ip, LLVMValueRef todiff, CDIFFE_TYPE retType, CDIFFE_TYPE *constant_args, size_t constant_args_size, EnzymeTypeAnalysisRef TA, uint8_t returnValue, uint8_t dretUsed, CDerivativeMode mode, uint8_t runtimeActivity, uint8_t strongZero, unsigned width, uint8_t freeMemory, LLVMTypeRef additionalArg, uint8_t forceAnonymousTape, CFnTypeInfo typeInfo, uint8_t subsequent_calls_may_write, uint8_t *_overwritten_args, size_t overwritten_args_size, EnzymeAugmentedReturnPtr augmented, uint8_t AtomicAdd)
 
EnzymeAugmentedReturnPtr EnzymeCreateAugmentedPrimal (EnzymeLogicRef Logic, LLVMValueRef request_req, LLVMBuilderRef request_ip, LLVMValueRef todiff, CDIFFE_TYPE retType, CDIFFE_TYPE *constant_args, size_t constant_args_size, EnzymeTypeAnalysisRef TA, uint8_t returnUsed, uint8_t shadowReturnUsed, CFnTypeInfo typeInfo, uint8_t subsequent_calls_may_write, uint8_t *_overwritten_args, size_t overwritten_args_size, uint8_t forceAnonymousTape, uint8_t runtimeActivity, uint8_t strongZero, unsigned width, uint8_t AtomicAdd)
 
LLVMValueRef EnzymeCreateBatch (EnzymeLogicRef Logic, LLVMValueRef request_req, LLVMBuilderRef request_ip, LLVMValueRef tobatch, unsigned width, CBATCH_TYPE *arg_types, size_t arg_types_size, CBATCH_TYPE retType)
 
LLVMValueRef EnzymeCreateTrace (EnzymeLogicRef Logic, LLVMValueRef request_req, LLVMBuilderRef request_ip, LLVMValueRef totrace, LLVMValueRef *sample_functions, size_t sample_functions_size, LLVMValueRef *observe_functions, size_t observe_functions_size, const char *active_random_variables[], size_t active_random_variables_size, CProbProgMode mode, uint8_t autodiff, EnzymeTraceInterfaceRef interface)
 
LLVMValueRef EnzymeExtractFunctionFromAugmentation (EnzymeAugmentedReturnPtr ret)
 
LLVMTypeRef EnzymeExtractUnderlyingTapeTypeFromAugmentation (EnzymeAugmentedReturnPtr ret)
 
LLVMTypeRef EnzymeExtractTapeTypeFromAugmentation (EnzymeAugmentedReturnPtr ret)
 
void EnzymeExtractReturnInfo (EnzymeAugmentedReturnPtr ret, int64_t *data, uint8_t *existed, size_t len)
 
static MDNode * extractMDNode (MetadataAsValue *MAV)
 
CTypeTreeRef EnzymeTypeTreeFromMD (LLVMValueRef Val)
 
LLVMValueRef EnzymeTypeTreeToMD (CTypeTreeRef CTR, LLVMContextRef ctx)
 
CTypeTreeRef EnzymeNewTypeTree ()
 
CTypeTreeRef EnzymeNewTypeTreeCT (CConcreteType CT, LLVMContextRef ctx)
 
CTypeTreeRef EnzymeNewTypeTreeTR (CTypeTreeRef CTR)
 
void EnzymeFreeTypeTree (CTypeTreeRef CTT)
 
uint8_t EnzymeSetTypeTree (CTypeTreeRef dst, CTypeTreeRef src)
 
uint8_t EnzymeMergeTypeTree (CTypeTreeRef dst, CTypeTreeRef src)
 
uint8_t EnzymeCheckedMergeTypeTree (CTypeTreeRef dst, CTypeTreeRef src, uint8_t *legalP)
 
void EnzymeTypeTreeOnlyEq (CTypeTreeRef CTT, int64_t x)
 
void EnzymeTypeTreeData0Eq (CTypeTreeRef CTT)
 
void EnzymeTypeTreeLookupEq (CTypeTreeRef CTT, int64_t size, const char *dl)
 
void EnzymeTypeTreeCanonicalizeInPlace (CTypeTreeRef CTT, int64_t size, const char *dl)
 
CConcreteType EnzymeTypeTreeInner0 (CTypeTreeRef CTT)
 
void EnzymeTypeTreeShiftIndiciesEq (CTypeTreeRef CTT, const char *datalayout, int64_t offset, int64_t maxSize, uint64_t addOffset)
 
void EnzymeTypeTreeInsertEq (CTypeTreeRef CTT, const int64_t *indices, size_t len, CConcreteType ct, LLVMContextRef ctx)
 
const char * EnzymeTypeTreeToString (CTypeTreeRef src)
 
void EnzymeTypeTreeToStringFree (const char *cstr)
 
const char * EnzymeTypeAnalyzerToString (void *src)
 
const char * EnzymeGradientUtilsInvertedPointersToString (GradientUtils *gutils, void *src)
 
LLVMValueRef EnzymeGradientUtilsCallWithInvertedBundles (GradientUtils *gutils, LLVMValueRef func, LLVMTypeRef funcTy, LLVMValueRef *args_vr, uint64_t args_size, LLVMValueRef orig_vr, CValueType *valTys, uint64_t valTys_size, LLVMBuilderRef B, uint8_t lookup)
 
void EnzymeStringFree (const char *cstr)
 
void EnzymeMoveBefore (LLVMValueRef inst1, LLVMValueRef inst2, LLVMBuilderRef B)
 
void EnzymeSetStringMD (LLVMValueRef Inst, const char *Kind, LLVMValueRef Val)
 
LLVMValueRef EnzymeGetStringMD (LLVMValueRef Inst, const char *Kind)
 
void EnzymeSetMustCache (LLVMValueRef inst1)
 
uint8_t EnzymeHasFromStack (LLVMValueRef inst1)
 
void EnzymeCloneFunctionDISubprogramInto (LLVMValueRef NF, LLVMValueRef F)
 
void EnzymeReplaceFunctionImplementation (LLVMModuleRef M)
 
void EnzymeDetectReadonlyOrThrow (LLVMModuleRef M)
 
void EnzymeDumpModuleRef (LLVMModuleRef M)
 
void EnzymeDumpValueRef (LLVMValueRef M)
 
void EnzymeDumpTypeRef (LLVMTypeRef M)
 
static bool runAttributorOnFunctions (InformationCache &InfoCache, SetVector< Function * > &Functions, AnalysisGetter &AG, CallGraphUpdater &CGUpdater, bool DeleteFns, bool IsModulePass)
 
void RunAttributorOnModule (LLVMModuleRef M0)
 
void EnzymeAddAttributorLegacyPass (LLVMPassManagerRef PM)
 
LLVMMetadataRef EnzymeMakeNonConstTBAA (LLVMMetadataRef MD)
 
void EnzymeCopyMetadata (LLVMValueRef inst1, LLVMValueRef inst2)
 
void EnzymeCopyAlignment (LLVMValueRef inst1, LLVMValueRef inst2)
 
void EnzymeTakeName (LLVMValueRef inst1, LLVMValueRef inst2)
 
LLVMMetadataRef EnzymeAnonymousAliasScopeDomain (const char *str, LLVMContextRef ctx)
 
LLVMMetadataRef EnzymeAnonymousAliasScope (LLVMMetadataRef domain, const char *str)
 
uint8_t EnzymeLowerSparsification (LLVMValueRef F, uint8_t replaceAll)
 
void EnzymeAttributeKnownFunctions (LLVMValueRef FC)
 
void EnzymeSetCalledFunction (LLVMValueRef C_CI, LLVMValueRef C_F, uint64_t *argrem, uint64_t num_argrem)
 
LLVMValueRef EnzymeCloneFunctionWithoutReturnOrArgs (LLVMValueRef FC, uint8_t keepReturnU, uint64_t *argrem, uint64_t num_argrem)
 
LLVMTypeRef EnzymeAllocaType (LLVMValueRef V)
 
LLVMValueRef EnzymeComputeByteOffsetOfGEP (LLVMBuilderRef B_r, LLVMValueRef V_r, LLVMTypeRef T_r)
 
LLVMValueRef EnzymeBuildExtractValue (LLVMBuilderRef B, LLVMValueRef AggVal, unsigned *Index, unsigned Size, const char *Name)
 
LLVMValueRef EnzymeBuildInsertValue (LLVMBuilderRef B, LLVMValueRef AggVal, LLVMValueRef EltVal, unsigned *Index, unsigned Size, const char *Name)
 

Macro Definition Documentation

◆ addAttribute

#define addAttribute   addAttributeAtIndex

Definition at line 58 of file CApi.cpp.

◆ getAttribute

#define getAttribute   getAttributeAtIndex

Definition at line 60 of file CApi.cpp.

◆ hasAttribute

#define hasAttribute   hasAttributeAtIndex

Definition at line 61 of file CApi.cpp.

◆ removeAttribute

#define removeAttribute   removeAttributeAtIndex

Definition at line 59 of file CApi.cpp.

Function Documentation

◆ ClearEnzymeLogic()

void ClearEnzymeLogic ( EnzymeLogicRef Ref)

Definition at line 260 of file CApi.cpp.

References eunwrap().

◆ ClearTypeAnalysis()

void ClearTypeAnalysis ( EnzymeTypeAnalysisRef TAR)

Definition at line 312 of file CApi.cpp.

References TypeAnalysis::clear(), and eunwrap().

◆ CreateEnzymeDynamicTraceInterface()

EnzymeTraceInterfaceRef CreateEnzymeDynamicTraceInterface ( LLVMValueRef interface,
LLVMValueRef F )

Definition at line 255 of file CApi.cpp.

◆ CreateEnzymeLogic()

EnzymeLogicRef CreateEnzymeLogic ( uint8_t PostOpt)

Definition at line 213 of file CApi.cpp.

◆ CreateEnzymeStaticTraceInterface()

EnzymeTraceInterfaceRef CreateEnzymeStaticTraceInterface ( LLVMContextRef C,
LLVMValueRef getTraceFunction,
LLVMValueRef getChoiceFunction,
LLVMValueRef insertCallFunction,
LLVMValueRef insertChoiceFunction,
LLVMValueRef insertArgumentFunction,
LLVMValueRef insertReturnFunction,
LLVMValueRef insertFunctionFunction,
LLVMValueRef insertChoiceGradientFunction,
LLVMValueRef insertArgumentGradientFunction,
LLVMValueRef newTraceFunction,
LLVMValueRef freeTraceFunction,
LLVMValueRef hasCallFunction,
LLVMValueRef hasChoiceFunction )

Definition at line 229 of file CApi.cpp.

◆ CreateTypeAnalysis()

EnzymeTypeAnalysisRef CreateTypeAnalysis ( EnzymeLogicRef Log,
char ** customRuleNames,
CustomRuleType * customRules,
size_t numRules )

Definition at line 274 of file CApi.cpp.

References TypeAnalysis::CustomRules, IntList::data, eunwrap(), and IntList::size.

◆ EnzymeAddAttributorLegacyPass()

void EnzymeAddAttributorLegacyPass ( LLVMPassManagerRef PM)

Definition at line 1137 of file CApi.cpp.

◆ EnzymeAllocaType()

LLVMTypeRef EnzymeAllocaType ( LLVMValueRef V)

Definition at line 1384 of file CApi.cpp.

◆ EnzymeAnalyzeTypes()

void * EnzymeAnalyzeTypes ( EnzymeTypeAnalysisRef TAR,
CFnTypeInfo CTI,
LLVMValueRef F )

Definition at line 323 of file CApi.cpp.

References eunwrap().

◆ EnzymeAnonymousAliasScope()

LLVMMetadataRef EnzymeAnonymousAliasScope ( LLVMMetadataRef domain,
const char * str )

Definition at line 1175 of file CApi.cpp.

References str().

◆ EnzymeAnonymousAliasScopeDomain()

LLVMMetadataRef EnzymeAnonymousAliasScopeDomain ( const char * str,
LLVMContextRef ctx )

Definition at line 1169 of file CApi.cpp.

References str().

◆ EnzymeAttributeKnownFunctions()

void EnzymeAttributeKnownFunctions ( LLVMValueRef FC)

Definition at line 1186 of file CApi.cpp.

References attributeKnownFunctions().

◆ EnzymeBuildExtractValue()

LLVMValueRef EnzymeBuildExtractValue ( LLVMBuilderRef B,
LLVMValueRef AggVal,
unsigned * Index,
unsigned Size,
const char * Name )

Definition at line 1417 of file CApi.cpp.

◆ EnzymeBuildInsertValue()

LLVMValueRef EnzymeBuildInsertValue ( LLVMBuilderRef B,
LLVMValueRef AggVal,
LLVMValueRef EltVal,
unsigned * Index,
unsigned Size,
const char * Name )

Definition at line 1424 of file CApi.cpp.

◆ EnzymeCheckedMergeTypeTree()

uint8_t EnzymeCheckedMergeTypeTree ( CTypeTreeRef dst,
CTypeTreeRef src,
uint8_t * legalP )

Definition at line 879 of file CApi.cpp.

◆ EnzymeCloneFunctionDISubprogramInto()

void EnzymeCloneFunctionDISubprogramInto ( LLVMValueRef NF,
LLVMValueRef F )

Definition at line 1031 of file CApi.cpp.

◆ EnzymeCloneFunctionWithoutReturnOrArgs()

LLVMValueRef EnzymeCloneFunctionWithoutReturnOrArgs ( LLVMValueRef FC,
uint8_t keepReturnU,
uint64_t * argrem,
uint64_t num_argrem )

Definition at line 1242 of file CApi.cpp.

◆ EnzymeComputeByteOffsetOfGEP()

LLVMValueRef EnzymeComputeByteOffsetOfGEP ( LLVMBuilderRef B_r,
LLVMValueRef V_r,
LLVMTypeRef T_r )

Definition at line 1387 of file CApi.cpp.

References collectOffset().

◆ EnzymeCopyAlignment()

void EnzymeCopyAlignment ( LLVMValueRef inst1,
LLVMValueRef inst2 )

Definition at line 1161 of file CApi.cpp.

◆ EnzymeCopyMetadata()

void EnzymeCopyMetadata ( LLVMValueRef inst1,
LLVMValueRef inst2 )

Definition at line 1157 of file CApi.cpp.

◆ EnzymeCreateAugmentedPrimal()

EnzymeAugmentedReturnPtr EnzymeCreateAugmentedPrimal ( EnzymeLogicRef Logic,
LLVMValueRef request_req,
LLVMBuilderRef request_ip,
LLVMValueRef todiff,
CDIFFE_TYPE retType,
CDIFFE_TYPE * constant_args,
size_t constant_args_size,
EnzymeTypeAnalysisRef TA,
uint8_t returnUsed,
uint8_t shadowReturnUsed,
CFnTypeInfo typeInfo,
uint8_t subsequent_calls_may_write,
uint8_t * _overwritten_args,
size_t overwritten_args_size,
uint8_t forceAnonymousTape,
uint8_t runtimeActivity,
uint8_t strongZero,
unsigned width,
uint8_t AtomicAdd )

Definition at line 727 of file CApi.cpp.

References eunwrap(), and ewrap().

◆ EnzymeCreateBatch()

LLVMValueRef EnzymeCreateBatch ( EnzymeLogicRef Logic,
LLVMValueRef request_req,
LLVMBuilderRef request_ip,
LLVMValueRef tobatch,
unsigned width,
CBATCH_TYPE * arg_types,
size_t arg_types_size,
CBATCH_TYPE retType )

Definition at line 755 of file CApi.cpp.

References eunwrap().

◆ EnzymeCreateForwardDiff()

LLVMValueRef EnzymeCreateForwardDiff ( EnzymeLogicRef Logic,
LLVMValueRef request_req,
LLVMBuilderRef request_ip,
LLVMValueRef todiff,
CDIFFE_TYPE retType,
CDIFFE_TYPE * constant_args,
size_t constant_args_size,
EnzymeTypeAnalysisRef TA,
uint8_t returnValue,
CDerivativeMode mode,
uint8_t freeMemory,
uint8_t runtimeActivity,
uint8_t strongZero,
unsigned width,
LLVMTypeRef additionalArg,
CFnTypeInfo typeInfo,
uint8_t subsequent_calls_may_write,
uint8_t * _overwritten_args,
size_t overwritten_args_size,
EnzymeAugmentedReturnPtr augmented )

Definition at line 661 of file CApi.cpp.

References eunwrap().

◆ EnzymeCreatePrimalAndGradient()

LLVMValueRef EnzymeCreatePrimalAndGradient ( EnzymeLogicRef Logic,
LLVMValueRef request_req,
LLVMBuilderRef request_ip,
LLVMValueRef todiff,
CDIFFE_TYPE retType,
CDIFFE_TYPE * constant_args,
size_t constant_args_size,
EnzymeTypeAnalysisRef TA,
uint8_t returnValue,
uint8_t dretUsed,
CDerivativeMode mode,
uint8_t runtimeActivity,
uint8_t strongZero,
unsigned width,
uint8_t freeMemory,
LLVMTypeRef additionalArg,
uint8_t forceAnonymousTape,
CFnTypeInfo typeInfo,
uint8_t subsequent_calls_may_write,
uint8_t * _overwritten_args,
size_t overwritten_args_size,
EnzymeAugmentedReturnPtr augmented,
uint8_t AtomicAdd )

Definition at line 687 of file CApi.cpp.

References eunwrap().

◆ EnzymeCreateTrace()

LLVMValueRef EnzymeCreateTrace ( EnzymeLogicRef Logic,
LLVMValueRef request_req,
LLVMBuilderRef request_ip,
LLVMValueRef totrace,
LLVMValueRef * sample_functions,
size_t sample_functions_size,
LLVMValueRef * observe_functions,
size_t observe_functions_size,
const char * active_random_variables[],
size_t active_random_variables_size,
CProbProgMode mode,
uint8_t autodiff,
EnzymeTraceInterfaceRef interface )

Definition at line 769 of file CApi.cpp.

References eunwrap().

◆ EnzymeDetectReadonlyOrThrow()

void EnzymeDetectReadonlyOrThrow ( LLVMModuleRef M)

Definition at line 1055 of file CApi.cpp.

References DetectReadonlyOrThrow().

◆ EnzymeDumpModuleRef()

void EnzymeDumpModuleRef ( LLVMModuleRef M)

Definition at line 1059 of file CApi.cpp.

◆ EnzymeDumpTypeRef()

void EnzymeDumpTypeRef ( LLVMTypeRef M)

Definition at line 1065 of file CApi.cpp.

◆ EnzymeDumpValueRef()

void EnzymeDumpValueRef ( LLVMValueRef M)

Definition at line 1063 of file CApi.cpp.

◆ EnzymeExtractFunctionFromAugmentation()

LLVMValueRef EnzymeExtractFunctionFromAugmentation ( EnzymeAugmentedReturnPtr ret)

Definition at line 801 of file CApi.cpp.

◆ EnzymeExtractReturnInfo()

void EnzymeExtractReturnInfo ( EnzymeAugmentedReturnPtr ret,
int64_t * data,
uint8_t * existed,
size_t len )

Definition at line 825 of file CApi.cpp.

References DifferentialReturn, Return, and Tape.

◆ EnzymeExtractTapeTypeFromAugmentation()

LLVMTypeRef EnzymeExtractTapeTypeFromAugmentation ( EnzymeAugmentedReturnPtr ret)

Definition at line 813 of file CApi.cpp.

References Tape.

◆ EnzymeExtractUnderlyingTapeTypeFromAugmentation()

LLVMTypeRef EnzymeExtractUnderlyingTapeTypeFromAugmentation ( EnzymeAugmentedReturnPtr ret)

Definition at line 807 of file CApi.cpp.

◆ EnzymeFreeTypeTree()

void EnzymeFreeTypeTree ( CTypeTreeRef CTT)

Definition at line 872 of file CApi.cpp.

◆ EnzymeGetCLBool()

uint8_t EnzymeGetCLBool ( void * ptr)

Definition at line 193 of file CApi.cpp.

◆ EnzymeGetCLInteger()

int64_t EnzymeGetCLInteger ( void * ptr)

Definition at line 203 of file CApi.cpp.

◆ EnzymeGetShadowType()

LLVMTypeRef EnzymeGetShadowType ( uint64_t width,
LLVMTypeRef T )

Definition at line 444 of file CApi.cpp.

References GradientUtils::getShadowType().

◆ EnzymeGetStringMD()

LLVMValueRef EnzymeGetStringMD ( LLVMValueRef Inst,
const char * Kind )

Definition at line 1013 of file CApi.cpp.

◆ EnzymeGetTypeAnalysisFromTypeAnalyzer()

EnzymeTypeAnalysisRef EnzymeGetTypeAnalysisFromTypeAnalyzer ( void * TAR)

Definition at line 333 of file CApi.cpp.

References TypeAnalyzer::interprocedural.

◆ EnzymeGradientUtilsAddReverseBlock()

LLVMBasicBlockRef EnzymeGradientUtilsAddReverseBlock ( GradientUtils * gutils,
LLVMBasicBlockRef block,
const char * name,
uint8_t forkCache,
uint8_t push )

Definition at line 642 of file CApi.cpp.

References GradientUtils::addReverseBlock().

◆ EnzymeGradientUtilsAddToDiffe()

void EnzymeGradientUtilsAddToDiffe ( DiffeGradientUtils * gutils,
LLVMValueRef val,
LLVMValueRef diffe,
LLVMBuilderRef B,
LLVMTypeRef T )

Definition at line 522 of file CApi.cpp.

References DiffeGradientUtils::addToDiffe().

◆ EnzymeGradientUtilsAddToInvertedPointerDiffe()

void EnzymeGradientUtilsAddToInvertedPointerDiffe ( DiffeGradientUtils * gutils,
LLVMValueRef orig,
LLVMValueRef origVal,
LLVMTypeRef addingType,
unsigned start,
unsigned size,
LLVMValueRef origptr,
LLVMValueRef dif,
LLVMBuilderRef BuilderM,
unsigned align,
LLVMValueRef mask )

Definition at line 528 of file CApi.cpp.

References DiffeGradientUtils::addToInvertedPtrDiffe().

◆ EnzymeGradientUtilsAddToInvertedPointerDiffeTT()

void EnzymeGradientUtilsAddToInvertedPointerDiffeTT ( DiffeGradientUtils * gutils,
LLVMValueRef orig,
LLVMValueRef origVal,
CTypeTreeRef vd,
unsigned LoadSize,
LLVMValueRef origptr,
LLVMValueRef prediff,
LLVMBuilderRef BuilderM,
unsigned align,
LLVMValueRef premask )

Definition at line 542 of file CApi.cpp.

References DiffeGradientUtils::addToInvertedPtrDiffe().

◆ EnzymeGradientUtilsAllocAndGetTypeTree()

CTypeTreeRef EnzymeGradientUtilsAllocAndGetTypeTree ( GradientUtils * gutils,
LLVMValueRef val )

Definition at line 614 of file CApi.cpp.

References TypeResults::query(), and GradientUtils::TR.

◆ EnzymeGradientUtilsAllocationBlock()

LLVMBasicBlockRef EnzymeGradientUtilsAllocationBlock ( GradientUtils * gutils)

Definition at line 571 of file CApi.cpp.

References CacheUtility::inversionAllocs.

◆ EnzymeGradientUtilsCallWithInvertedBundles()

LLVMValueRef EnzymeGradientUtilsCallWithInvertedBundles ( GradientUtils * gutils,
LLVMValueRef func,
LLVMTypeRef funcTy,
LLVMValueRef * args_vr,
uint64_t args_size,
LLVMValueRef orig_vr,
CValueType * valTys,
uint64_t valTys_size,
LLVMBuilderRef B,
uint8_t lookup )

Definition at line 959 of file CApi.cpp.

References GradientUtils::getInvertedBundles().

◆ EnzymeGradientUtilsDiffe()

LLVMValueRef EnzymeGradientUtilsDiffe ( DiffeGradientUtils * gutils,
LLVMValueRef val,
LLVMBuilderRef B )

Definition at line 517 of file CApi.cpp.

References DiffeGradientUtils::diffe().

◆ EnzymeGradientUtilsDumpTypeResults()

void EnzymeGradientUtilsDumpTypeResults ( GradientUtils * gutils)

Definition at line 622 of file CApi.cpp.

References TypeResults::dump(), and GradientUtils::TR.

◆ EnzymeGradientUtilsErase()

void EnzymeGradientUtilsErase ( GradientUtils * G,
LLVMValueRef I )

Definition at line 337 of file CApi.cpp.

References GradientUtils::erase().

◆ EnzymeGradientUtilsEraseWithPlaceholder()

void EnzymeGradientUtilsEraseWithPlaceholder ( GradientUtils * G,
LLVMValueRef I,
LLVMValueRef orig,
uint8_t erase )

Definition at line 340 of file CApi.cpp.

References GradientUtils::eraseWithPlaceholder().

◆ EnzymeGradientUtilsGetAtomicAdd()

uint8_t EnzymeGradientUtilsGetAtomicAdd ( GradientUtils * gutils)

Definition at line 431 of file CApi.cpp.

References GradientUtils::AtomicAdd.

◆ EnzymeGradientUtilsGetDiffeType()

CDIFFE_TYPE EnzymeGradientUtilsGetDiffeType ( GradientUtils * G,
LLVMValueRef oval,
uint8_t foreignFunction )

Definition at line 470 of file CApi.cpp.

References GradientUtils::getDiffeType().

◆ EnzymeGradientUtilsGetExternalContext()

void * EnzymeGradientUtilsGetExternalContext ( GradientUtils * gutils)

Definition at line 423 of file CApi.cpp.

References EnzymeLogic::ExternalContext, and GradientUtils::Logic.

◆ EnzymeGradientUtilsGetMode()

CDerivativeMode EnzymeGradientUtilsGetMode ( GradientUtils * gutils)

Definition at line 465 of file CApi.cpp.

References GradientUtils::mode.

◆ EnzymeGradientUtilsGetReturnDiffeType()

CDIFFE_TYPE EnzymeGradientUtilsGetReturnDiffeType ( GradientUtils * G,
LLVMValueRef oval,
uint8_t * needsPrimal,
uint8_t * needsShadow,
CDerivativeMode mode )

Definition at line 476 of file CApi.cpp.

References GradientUtils::getReturnDiffeType().

◆ EnzymeGradientUtilsGetRuntimeActivity()

uint8_t EnzymeGradientUtilsGetRuntimeActivity ( GradientUtils * gutils)

Definition at line 419 of file CApi.cpp.

References GradientUtils::runtimeActivity.

◆ EnzymeGradientUtilsGetShadowType()

LLVMTypeRef EnzymeGradientUtilsGetShadowType ( GradientUtils * gutils,
LLVMTypeRef T )

Definition at line 439 of file CApi.cpp.

References GradientUtils::getShadowType().

◆ EnzymeGradientUtilsGetStrongZero()

uint8_t EnzymeGradientUtilsGetStrongZero ( GradientUtils * gutils)

Definition at line 427 of file CApi.cpp.

References GradientUtils::strongZero.

◆ EnzymeGradientUtilsGetUncacheableArgs()

uint8_t EnzymeGradientUtilsGetUncacheableArgs ( GradientUtils * gutils,
LLVMValueRef orig,
uint8_t * data,
uint64_t size )

◆ EnzymeGradientUtilsGetWidth()

uint64_t EnzymeGradientUtilsGetWidth ( GradientUtils * gutils)

Definition at line 435 of file CApi.cpp.

References GradientUtils::getWidth().

◆ EnzymeGradientUtilsInvertedPointersToString()

const char * EnzymeGradientUtilsInvertedPointersToString ( GradientUtils * gutils,
void * src )

Definition at line 946 of file CApi.cpp.

References GradientUtils::invertedPointers, and str().

◆ EnzymeGradientUtilsInvertPointer()

LLVMValueRef EnzymeGradientUtilsInvertPointer ( GradientUtils * gutils,
LLVMValueRef val,
LLVMBuilderRef B )

Definition at line 511 of file CApi.cpp.

References GradientUtils::invertPointerM().

◆ EnzymeGradientUtilsIsConstantInstruction()

uint8_t EnzymeGradientUtilsIsConstantInstruction ( GradientUtils * gutils,
LLVMValueRef val )

Definition at line 566 of file CApi.cpp.

References GradientUtils::isConstantInstruction().

◆ EnzymeGradientUtilsIsConstantValue()

uint8_t EnzymeGradientUtilsIsConstantValue ( GradientUtils * gutils,
LLVMValueRef val )

Definition at line 561 of file CApi.cpp.

References GradientUtils::isConstantValue().

◆ EnzymeGradientUtilsLookup()

LLVMValueRef EnzymeGradientUtilsLookup ( GradientUtils * gutils,
LLVMValueRef val,
LLVMBuilderRef B )

Definition at line 506 of file CApi.cpp.

References GradientUtils::lookupM().

◆ EnzymeGradientUtilsNewFromOriginal()

LLVMValueRef EnzymeGradientUtilsNewFromOriginal ( GradientUtils * gutils,
LLVMValueRef val )

Definition at line 448 of file CApi.cpp.

References GradientUtils::getNewFromOriginal().

◆ EnzymeGradientUtilsReplaceAWithB()

void EnzymeGradientUtilsReplaceAWithB ( GradientUtils * G,
LLVMValueRef A,
LLVMValueRef B )

Definition at line 347 of file CApi.cpp.

References GradientUtils::replaceAWithB().

◆ EnzymeGradientUtilsSetDebugLocFromOriginal()

void EnzymeGradientUtilsSetDebugLocFromOriginal ( GradientUtils * gutils,
LLVMValueRef val,
LLVMValueRef orig )

Definition at line 491 of file CApi.cpp.

References GradientUtils::getNewFromOriginal().

◆ EnzymeGradientUtilsSetDiffe()

void EnzymeGradientUtilsSetDiffe ( DiffeGradientUtils * gutils,
LLVMValueRef val,
LLVMValueRef diffe,
LLVMBuilderRef B )

Definition at line 556 of file CApi.cpp.

References DiffeGradientUtils::setDiffe().

◆ EnzymeGradientUtilsSetReverseBlock()

void EnzymeGradientUtilsSetReverseBlock ( GradientUtils * gutils,
LLVMBasicBlockRef block )

Definition at line 651 of file CApi.cpp.

References GradientUtils::reverseBlocks, and GradientUtils::reverseBlockToPrimal.

◆ EnzymeGradientUtilsSubTransferHelper()

void EnzymeGradientUtilsSubTransferHelper ( GradientUtils * gutils,
CDerivativeMode mode,
LLVMTypeRef secretty,
uint64_t intrinsic,
uint64_t dstAlign,
uint64_t srcAlign,
uint64_t offset,
uint8_t dstConstant,
LLVMValueRef shadow_dst,
uint8_t srcConstant,
LLVMValueRef shadow_src,
LLVMValueRef length,
LLVMValueRef isVolatile,
LLVMValueRef MTI,
uint8_t allowForward,
uint8_t shadowsLookedUp )

Definition at line 626 of file CApi.cpp.

References SubTransferHelper().

◆ EnzymeGradientUtilsTypeAnalyzer()

void * EnzymeGradientUtilsTypeAnalyzer ( GradientUtils * G)

Definition at line 329 of file CApi.cpp.

References TypeResults::analyzer, and GradientUtils::TR.

◆ EnzymeHasFromStack()

uint8_t EnzymeHasFromStack ( LLVMValueRef inst1)

Definition at line 1026 of file CApi.cpp.

References hasMetadata().

◆ EnzymeInsertValue()

LLVMValueRef EnzymeInsertValue ( LLVMBuilderRef B,
LLVMValueRef val,
LLVMValueRef val2,
unsigned * sz,
int64_t length,
const char * name )

Definition at line 499 of file CApi.cpp.

◆ EnzymeLogicErasePreprocessedFunctions()

void EnzymeLogicErasePreprocessedFunctions ( EnzymeLogicRef Ref)

Definition at line 262 of file CApi.cpp.

References eunwrap().

◆ EnzymeLogicGetExternalContext()

void * EnzymeLogicGetExternalContext ( EnzymeLogicRef Ref)

Definition at line 221 of file CApi.cpp.

References eunwrap().

◆ EnzymeLogicSetExternalContext()

void EnzymeLogicSetExternalContext ( EnzymeLogicRef Ref,
void * ExternalContext )

Definition at line 217 of file CApi.cpp.

References eunwrap().

◆ EnzymeLowerSparsification()

uint8_t EnzymeLowerSparsification ( LLVMValueRef F,
uint8_t replaceAll )

Definition at line 1182 of file CApi.cpp.

References LowerSparsification().

◆ EnzymeMakeNonConstTBAA()

LLVMMetadataRef EnzymeMakeNonConstTBAA ( LLVMMetadataRef MD)

Definition at line 1141 of file CApi.cpp.

◆ EnzymeMergeTypeTree()

uint8_t EnzymeMergeTypeTree ( CTypeTreeRef dst,
CTypeTreeRef src )

Definition at line 876 of file CApi.cpp.

◆ EnzymeMoveBefore()

void EnzymeMoveBefore ( LLVMValueRef inst1,
LLVMValueRef inst2,
LLVMBuilderRef B )

Definition at line 986 of file CApi.cpp.

◆ EnzymeNewTypeTree()

CTypeTreeRef EnzymeNewTypeTree ( )

Definition at line 865 of file CApi.cpp.

◆ EnzymeNewTypeTreeCT()

CTypeTreeRef EnzymeNewTypeTreeCT ( CConcreteType CT,
LLVMContextRef ctx )

Definition at line 866 of file CApi.cpp.

References eunwrap().

◆ EnzymeNewTypeTreeTR()

CTypeTreeRef EnzymeNewTypeTreeTR ( CTypeTreeRef CTR)

Definition at line 869 of file CApi.cpp.

◆ EnzymeRegisterAllocationHandler()

void EnzymeRegisterAllocationHandler ( char * Name,
CustomShadowAlloc AHandle,
CustomShadowFree FHandle )

Definition at line 352 of file CApi.cpp.

References Args, shadowErasers, and shadowHandlers.

◆ EnzymeRegisterCallHandler()

void EnzymeRegisterCallHandler ( const char * Name,
CustomAugmentedFunctionForward FwdHandle,
CustomFunctionReverse RevHandle )

Definition at line 370 of file CApi.cpp.

References customCallHandlers.

◆ EnzymeRegisterDiffUseCallHandler()

void EnzymeRegisterDiffUseCallHandler ( char * Name,
CustomFunctionDiffUse Handle )

Definition at line 406 of file CApi.cpp.

References customDiffUseHandlers.

◆ EnzymeRegisterFwdCallHandler()

void EnzymeRegisterFwdCallHandler ( char * Name,
CustomFunctionForward FwdHandle )

Definition at line 393 of file CApi.cpp.

References customFwdCallHandlers.

◆ EnzymeReplaceFunctionImplementation()

void EnzymeReplaceFunctionImplementation ( LLVMModuleRef M)

Definition at line 1051 of file CApi.cpp.

References ReplaceFunctionImplementation().

◆ EnzymeReplaceOriginalToNew()

void EnzymeReplaceOriginalToNew ( GradientUtils * gutils,
LLVMValueRef origC,
LLVMValueRef repC )

Definition at line 453 of file CApi.cpp.

References GradientUtils::newToOriginalFn, and GradientUtils::originalToNewFn.

◆ EnzymeSetCalledFunction()

void EnzymeSetCalledFunction ( LLVMValueRef C_CI,
LLVMValueRef C_F,
uint64_t * argrem,
uint64_t num_argrem )

Definition at line 1190 of file CApi.cpp.

◆ EnzymeSetCLBool()

void EnzymeSetCLBool ( void * ptr,
uint8_t val )

Definition at line 188 of file CApi.cpp.

◆ EnzymeSetCLInteger()

void EnzymeSetCLInteger ( void * ptr,
int64_t val )

Definition at line 198 of file CApi.cpp.

◆ EnzymeSetCLString()

void EnzymeSetCLString ( void * ptr,
const char * val )

Definition at line 208 of file CApi.cpp.

◆ EnzymeSetMustCache()

void EnzymeSetMustCache ( LLVMValueRef inst1)

Definition at line 1021 of file CApi.cpp.

◆ EnzymeSetStringMD()

void EnzymeSetStringMD ( LLVMValueRef Inst,
const char * Kind,
LLVMValueRef Val )

Definition at line 1004 of file CApi.cpp.

References extractMDNode().

◆ EnzymeSetTypeTree()

uint8_t EnzymeSetTypeTree ( CTypeTreeRef dst,
CTypeTreeRef src )

Definition at line 873 of file CApi.cpp.

◆ EnzymeStringFree()

void EnzymeStringFree ( const char * cstr)

Definition at line 984 of file CApi.cpp.

◆ EnzymeTakeName()

void EnzymeTakeName ( LLVMValueRef inst1,
LLVMValueRef inst2 )

Definition at line 1165 of file CApi.cpp.

◆ EnzymeTypeAnalysisGetLogic()

EnzymeLogicRef EnzymeTypeAnalysisGetLogic ( EnzymeTypeAnalysisRef TAR)

Definition at line 319 of file CApi.cpp.

References TypeAnalysis::Logic.

◆ EnzymeTypeAnalyzerToString()

const char * EnzymeTypeAnalyzerToString ( void * src)

Definition at line 935 of file CApi.cpp.

References str().

◆ EnzymeTypeTreeCanonicalizeInPlace()

void EnzymeTypeTreeCanonicalizeInPlace ( CTypeTreeRef CTT,
int64_t size,
const char * dl )

Definition at line 900 of file CApi.cpp.

◆ EnzymeTypeTreeData0Eq()

void EnzymeTypeTreeData0Eq ( CTypeTreeRef CTT)

Definition at line 893 of file CApi.cpp.

◆ EnzymeTypeTreeFromMD()

CTypeTreeRef EnzymeTypeTreeFromMD ( LLVMValueRef Val)

Definition at line 853 of file CApi.cpp.

References extractMDNode(), and TypeTree::insertFromMD().

◆ EnzymeTypeTreeInner0()

CConcreteType EnzymeTypeTreeInner0 ( CTypeTreeRef CTT)

Definition at line 905 of file CApi.cpp.

References ewrap().

◆ EnzymeTypeTreeInsertEq()

void EnzymeTypeTreeInsertEq ( CTypeTreeRef CTT,
const int64_t * indices,
size_t len,
CConcreteType ct,
LLVMContextRef ctx )

Definition at line 916 of file CApi.cpp.

References eunwrap().

◆ EnzymeTypeTreeLookupEq()

void EnzymeTypeTreeLookupEq ( CTypeTreeRef CTT,
int64_t size,
const char * dl )

Definition at line 897 of file CApi.cpp.

◆ EnzymeTypeTreeOnlyEq()

void EnzymeTypeTreeOnlyEq ( CTypeTreeRef CTT,
int64_t x )

Definition at line 889 of file CApi.cpp.

◆ EnzymeTypeTreeShiftIndiciesEq()

void EnzymeTypeTreeShiftIndiciesEq ( CTypeTreeRef CTT,
const char * datalayout,
int64_t offset,
int64_t maxSize,
uint64_t addOffset )

Definition at line 909 of file CApi.cpp.

◆ EnzymeTypeTreeToMD()

LLVMValueRef EnzymeTypeTreeToMD ( CTypeTreeRef CTR,
LLVMContextRef ctx )

Definition at line 860 of file CApi.cpp.

◆ EnzymeTypeTreeToString()

const char * EnzymeTypeTreeToString ( CTypeTreeRef src)

Definition at line 924 of file CApi.cpp.

◆ EnzymeTypeTreeToStringFree()

void EnzymeTypeTreeToStringFree ( const char * cstr)

Definition at line 933 of file CApi.cpp.

◆ eunwrap() [1/9]

ConcreteType eunwrap ( CConcreteType CDT,
llvm::LLVMContext & ctx )

◆ eunwrap() [2/9]

◆ eunwrap() [3/9]

TypeTree eunwrap ( CTypeTreeRef CTT)

Definition at line 125 of file CApi.cpp.

◆ eunwrap() [4/9]

Definition at line 78 of file CApi.cpp.

◆ eunwrap() [5/9]

EnzymeLogic & eunwrap ( EnzymeLogicRef LR)

Definition at line 69 of file CApi.cpp.

◆ eunwrap() [6/9]

Definition at line 71 of file CApi.cpp.

◆ eunwrap() [7/9]

Definition at line 75 of file CApi.cpp.

◆ eunwrap() [8/9]

std::vector< int > eunwrap ( IntList IL)

Definition at line 111 of file CApi.cpp.

References IntList::data, and IntList::size.

◆ eunwrap() [9/9]

◆ eunwrap64()

std::set< int64_t > eunwrap64 ( IntList IL)

Definition at line 118 of file CApi.cpp.

References IntList::data, and IntList::size.

Referenced by eunwrap().

◆ ewrap() [1/4]

Definition at line 81 of file CApi.cpp.

Referenced by EnzymeCreateAugmentedPrimal(), and EnzymeTypeTreeInner0().

◆ ewrap() [2/4]

◆ ewrap() [3/4]

IntList ewrap ( const std::vector< int > & offsets)

Definition at line 158 of file CApi.cpp.

References IntList::data, and IntList::size.

◆ ewrap() [4/4]

CTypeTreeRef ewrap ( const TypeTree & TT)

Definition at line 168 of file CApi.cpp.

◆ extractMDNode()

static MDNode * extractMDNode ( MetadataAsValue * MAV)
static

Definition at line 842 of file CApi.cpp.

Referenced by EnzymeSetStringMD(), and EnzymeTypeTreeFromMD().

◆ FindEnzymeStaticTraceInterface()

EnzymeTraceInterfaceRef FindEnzymeStaticTraceInterface ( LLVMModuleRef M)

Definition at line 225 of file CApi.cpp.

◆ FreeEnzymeLogic()

void FreeEnzymeLogic ( EnzymeLogicRef Ref)

Definition at line 268 of file CApi.cpp.

◆ FreeTraceInterface()

void FreeTraceInterface ( EnzymeTraceInterfaceRef Ref)

Definition at line 270 of file CApi.cpp.

◆ FreeTypeAnalysis()

void FreeTypeAnalysis ( EnzymeTypeAnalysisRef TAR)

Definition at line 314 of file CApi.cpp.

◆ runAttributorOnFunctions()

static bool runAttributorOnFunctions ( InformationCache & InfoCache,
SetVector< Function * > & Functions,
AnalysisGetter & AG,
CallGraphUpdater & CGUpdater,
bool DeleteFns,
bool IsModulePass )
static

Definition at line 1067 of file CApi.cpp.

Referenced by RunAttributorOnModule(), and MyAttributorLegacyPass::runOnModule().

◆ RunAttributorOnModule()

void RunAttributorOnModule ( LLVMModuleRef M0)

Definition at line 1094 of file CApi.cpp.

References runAttributorOnFunctions().