Enzyme main
Loading...
Searching...
No Matches
CacheAnalysis Struct Reference
Collaboration diagram for CacheAnalysis:

Public Member Functions

 CacheAnalysis (const ValueMap< const CallInst *, SmallPtrSet< const CallInst *, 1 > > &allocationsWithGuaranteedFree, const ValueMap< Value *, GradientUtils::Rematerializer > &rematerializableAllocations, TypeResults &TR, AAResults &AA, Function *oldFunc, ScalarEvolution &SE, LoopInfo &OrigLI, DominatorTree &OrigDT, TargetLibraryInfo &TLI, const SmallPtrSetImpl< BasicBlock * > &unnecessaryBlocks, bool subsequent_calls_may_write, const std::vector< bool > &overwritten_args, DerivativeMode mode, bool omp)
 
bool is_origin_overwritten (Value *obj)
 Whether the memory at obj may be overwritten after this function returns.
 
bool is_overwritten_argument (Value *obj)
 
bool is_value_mustcache_from_origin (Value *obj)
 
bool is_load_uncacheable (Instruction &li)
 
std::map< Instruction *, bool > compute_uncacheable_load_map ()
 
std::pair< bool, std::vector< bool > > compute_overwritten_args_for_one_callsite (CallInst *callsite_op)
 
std::map< CallInst *, std::pair< bool, const std::vector< bool > > > compute_overwritten_args_for_callsites ()
 

Static Public Member Functions

static bool mayModify (AAResults &AA, Instruction *I, const MemoryLocation &loc)
 Whether I may modify the memory at loc.
 

Public Attributes

const ValueMap< const CallInst *, SmallPtrSet< const CallInst *, 1 > > & allocationsWithGuaranteedFree
 
const ValueMap< Value *, GradientUtils::Rematerializer > & rematerializableAllocations
 
TypeResults & TR
 
AAResults & AA
 
Function * oldFunc
 
ScalarEvolution & SE
 
LoopInfo & OrigLI
 
DominatorTree & OrigDT
 
TargetLibraryInfo & TLI
 
const SmallPtrSetImpl< BasicBlock * > & unnecessaryBlocks
 
const bool subsequent_calls_may_write
 
const std::vector< bool > & overwritten_args
 
DerivativeMode mode
 
std::map< Value *, bool > seen
 
bool omp
 
std::map< Value *, bool > seen_argument
 

Detailed Description

Definition at line 189 of file EnzymeLogic.cpp.

Constructor & Destructor Documentation

◆ CacheAnalysis()

CacheAnalysis::CacheAnalysis ( const ValueMap< const CallInst *, SmallPtrSet< const CallInst *, 1 > > & allocationsWithGuaranteedFree,
const ValueMap< Value *, GradientUtils::Rematerializer > & rematerializableAllocations,
TypeResults & TR,
AAResults & AA,
Function * oldFunc,
ScalarEvolution & SE,
LoopInfo & OrigLI,
DominatorTree & OrigDT,
TargetLibraryInfo & TLI,
const SmallPtrSetImpl< BasicBlock * > & unnecessaryBlocks,
bool subsequent_calls_may_write,
const std::vector< bool > & overwritten_args,
DerivativeMode mode,
bool omp )
inline

Definition at line 226 of file EnzymeLogic.cpp.

Member Function Documentation

◆ compute_overwritten_args_for_callsites()

std::map< CallInst *, std::pair< bool, const std::vector< bool > > > CacheAnalysis::compute_overwritten_args_for_callsites ( )
inline

Definition at line 778 of file EnzymeLogic.cpp.

◆ compute_overwritten_args_for_one_callsite()

std::pair< bool, std::vector< bool > > CacheAnalysis::compute_overwritten_args_for_one_callsite ( CallInst * callsite_op)
inline

Definition at line 568 of file EnzymeLogic.cpp.

◆ compute_uncacheable_load_map()

std::map< Instruction *, bool > CacheAnalysis::compute_uncacheable_load_map ( )
inline

Definition at line 542 of file EnzymeLogic.cpp.

◆ is_load_uncacheable()

bool CacheAnalysis::is_load_uncacheable ( Instruction & li)
inline

Definition at line 380 of file EnzymeLogic.cpp.

◆ is_origin_overwritten()

bool CacheAnalysis::is_origin_overwritten ( Value * obj)
inline

Whether the memory at obj may be overwritten after this function returns.

Unknown writes (subsequent_calls_may_write) may overwrite any memory not local to this function. Otherwise the caller only wrote to its own uncaptured memory, which this function can only reach through an argument, so only an argument marked overwritten can be.

Definition at line 248 of file EnzymeLogic.cpp.

◆ is_overwritten_argument()

bool CacheAnalysis::is_overwritten_argument ( Value * obj)
inline

Definition at line 255 of file EnzymeLogic.cpp.

◆ is_value_mustcache_from_origin()

bool CacheAnalysis::is_value_mustcache_from_origin ( Value * obj)
inline

Definition at line 278 of file EnzymeLogic.cpp.

◆ mayModify()

static bool CacheAnalysis::mayModify ( AAResults & AA,
Instruction * I,
const MemoryLocation & loc )
inlinestatic

Whether I may modify the memory at loc.

Unless it throws, a LocalReadOnlyOrThrow call writes only memory it allocated, which cannot be loc, and its sret-like arguments.

Definition at line 194 of file EnzymeLogic.cpp.

Member Data Documentation

◆ AA

AAResults& CacheAnalysis::AA

Definition at line 214 of file EnzymeLogic.cpp.

◆ allocationsWithGuaranteedFree

const ValueMap<const CallInst *, SmallPtrSet<const CallInst *, 1> >& CacheAnalysis::allocationsWithGuaranteedFree

Definition at line 210 of file EnzymeLogic.cpp.

◆ mode

DerivativeMode CacheAnalysis::mode

Definition at line 223 of file EnzymeLogic.cpp.

◆ oldFunc

Function* CacheAnalysis::oldFunc

Definition at line 215 of file EnzymeLogic.cpp.

◆ omp

bool CacheAnalysis::omp

Definition at line 225 of file EnzymeLogic.cpp.

◆ OrigDT

DominatorTree& CacheAnalysis::OrigDT

Definition at line 218 of file EnzymeLogic.cpp.

◆ OrigLI

LoopInfo& CacheAnalysis::OrigLI

Definition at line 217 of file EnzymeLogic.cpp.

◆ overwritten_args

const std::vector<bool>& CacheAnalysis::overwritten_args

Definition at line 222 of file EnzymeLogic.cpp.

◆ rematerializableAllocations

const ValueMap<Value *, GradientUtils::Rematerializer>& CacheAnalysis::rematerializableAllocations

Definition at line 212 of file EnzymeLogic.cpp.

◆ SE

ScalarEvolution& CacheAnalysis::SE

Definition at line 216 of file EnzymeLogic.cpp.

◆ seen

std::map<Value *, bool> CacheAnalysis::seen

Definition at line 224 of file EnzymeLogic.cpp.

◆ seen_argument

std::map<Value *, bool> CacheAnalysis::seen_argument

Definition at line 254 of file EnzymeLogic.cpp.

◆ subsequent_calls_may_write

const bool CacheAnalysis::subsequent_calls_may_write

Definition at line 221 of file EnzymeLogic.cpp.

◆ TLI

TargetLibraryInfo& CacheAnalysis::TLI

Definition at line 219 of file EnzymeLogic.cpp.

◆ TR

TypeResults& CacheAnalysis::TR

Definition at line 213 of file EnzymeLogic.cpp.

◆ unnecessaryBlocks

const SmallPtrSetImpl<BasicBlock *>& CacheAnalysis::unnecessaryBlocks

Definition at line 220 of file EnzymeLogic.cpp.


The documentation for this struct was generated from the following file: