|
Enzyme main
|
A holder class representing the results of running TypeAnalysis on a given function. More...
#include "TypeAnalysis/TypeAnalysis.h"

Public Member Functions | |
| TypeResults (std::nullptr_t) | |
| TypeResults (TypeAnalyzer &analyzer) | |
| ConcreteType | intType (size_t num, llvm::Value *val, bool errIfNotFound=true, bool pointerIntSame=false) const |
| llvm::Type * | addingType (size_t num, llvm::Value *val, size_t start=0) const |
| ConcreteType | firstPointer (size_t num, llvm::Value *val, llvm::Instruction *I, bool errIfNotFound=true, bool pointerIntSame=false) const |
| Returns whether in the first num bytes there is pointer, int, float, or none If pointerIntSame is set to true, then consider either as the same (and thus mergable) | |
| TypeTree | query (llvm::Value *val) const |
| The TypeTree of a particular Value. | |
| bool | anyFloat (llvm::Value *val, bool anythingIsFloat=true) const |
| Whether any part of the top level register can contain a float e.g. | |
| bool | allFloat (llvm::Value *val) const |
| Whether all of the top level register is known to contain float data. | |
| bool | anyPointer (llvm::Value *val) const |
| Whether any part of the top level register can contain a pointer e.g. | |
| FnTypeInfo | getAnalyzedTypeInfo () const |
| The TypeInfo calling convention. | |
| TypeTree | getReturnAnalysis () const |
| The Type of the return. | |
| void | dump (llvm::raw_ostream &ss=llvm::errs()) const |
| Prints all known information. | |
| std::set< int64_t > | knownIntegralValues (llvm::Value *val) const |
| The set of values val will take on during this program. | |
| FnTypeInfo | getCallInfo (llvm::CallBase &CI, llvm::Function &fn) const |
| llvm::Function * | getFunction () const |
Public Attributes | |
| TypeAnalyzer * | analyzer |
A holder class representing the results of running TypeAnalysis on a given function.
Definition at line 181 of file TypeAnalysis.h.
| TypeResults::TypeResults | ( | std::nullptr_t | ) |
Definition at line 6081 of file TypeAnalysis.cpp.
| TypeResults::TypeResults | ( | TypeAnalyzer & | analyzer | ) |
Definition at line 6080 of file TypeAnalysis.cpp.
| Type * TypeResults::addingType | ( | size_t | num, |
| llvm::Value * | val, | ||
| size_t | start = 0 ) const |
Definition at line 6264 of file TypeAnalysis.cpp.
References query().
Referenced by AdjointGenerator::createBinaryOperatorAdjoint(), AdjointGenerator::createBinaryOperatorDual(), AdjointGenerator::createSelectInstAdjoint(), AdjointGenerator::recursivelyHandleSubfunction(), AdjointGenerator::visitCastInst(), AdjointGenerator::visitExtractElementInst(), AdjointGenerator::visitInsertElementInst(), AdjointGenerator::visitOMPCall(), and AdjointGenerator::visitShuffleVectorInst().
| bool TypeResults::allFloat | ( | llvm::Value * | val | ) | const |
Whether all of the top level register is known to contain float data.
Definition at line 6129 of file TypeAnalysis.cpp.
References analyzer, Anything, TypeAnalyzer::fntypeinfo, FnTypeInfo::Function, query(), skippedBytes(), and Unknown.
Referenced by DifferentialUseAnalysis::is_value_needed_in_reverse().
| bool TypeResults::anyFloat | ( | llvm::Value * | val, |
| bool | anythingIsFloat = true ) const |
Whether any part of the top level register can contain a float e.g.
{ i64, float } can contain a float, but { i64, i8* } would not.
Definition at line 6158 of file TypeAnalysis.cpp.
References analyzer, Anything, TypeAnalyzer::fntypeinfo, FnTypeInfo::Function, Integer, Pointer, query(), skippedBytes(), and Unknown.
| bool TypeResults::anyPointer | ( | llvm::Value * | val | ) | const |
Whether any part of the top level register can contain a pointer e.g.
{ i64, i8* } can contain a pointer, but { i64, float } would not.
Definition at line 6197 of file TypeAnalysis.cpp.
References analyzer, Anything, TypeAnalyzer::fntypeinfo, FnTypeInfo::Function, Integer, Pointer, query(), skippedBytes(), and Unknown.
Referenced by DifferentialUseAnalysis::is_value_needed_in_reverse(), and AdjointGenerator::recursivelyHandleSubfunction().
| void TypeResults::dump | ( | llvm::raw_ostream & | ss = llvm::errs() | ) | const |
Prints all known information.
Definition at line 6230 of file TypeAnalysis.cpp.
References analyzer, and TypeAnalyzer::dump().
Referenced by AdjointGenerator::DifferentiableMemCopyFloats(), dumpTypeResults(), EmitNoDerivativeError(), EmitNoTypeError(), EnzymeGradientUtilsDumpTypeResults(), firstPointer(), AdjointGenerator::visitMemSetCommon(), and AdjointGenerator::visitMemTransferCommon().
| ConcreteType TypeResults::firstPointer | ( | size_t | num, |
| llvm::Value * | val, | ||
| llvm::Instruction * | I, | ||
| bool | errIfNotFound = true, | ||
| bool | pointerIntSame = false ) const |
Returns whether in the first num bytes there is pointer, int, float, or none If pointerIntSame is set to true, then consider either as the same (and thus mergable)
Definition at line 6281 of file TypeAnalysis.cpp.
References analyzer, Anything, CustomErrorHandler, TypeTree::Data0(), dump(), EmitFailure(), TypeAnalyzer::fntypeinfo, FnTypeInfo::Function, IllegalFirstPointer, Pointer, query(), str(), and to_string().
Referenced by AdjointGenerator::handleMPI(), and AdjointGenerator::visitAtomicRMWInst().
| FnTypeInfo TypeResults::getAnalyzedTypeInfo | ( | ) | const |
The TypeInfo calling convention.
Definition at line 6083 of file TypeAnalysis.cpp.
References analyzer, FnTypeInfo::Arguments, TypeAnalyzer::fntypeinfo, FnTypeInfo::Function, getReturnAnalysis(), FnTypeInfo::KnownValues, query(), and FnTypeInfo::Return.
| FnTypeInfo TypeResults::getCallInfo | ( | llvm::CallBase & | CI, |
| llvm::Function & | fn ) const |
Definition at line 6093 of file TypeAnalysis.cpp.
References analyzer, and TypeAnalyzer::getCallInfo().
Referenced by AdjointGenerator::recursivelyHandleSubfunction().
| Function * TypeResults::getFunction | ( | ) | const |
Definition at line 6488 of file TypeAnalysis.cpp.
References analyzer, TypeAnalyzer::fntypeinfo, and FnTypeInfo::Function.
Referenced by AdjointGenerator::AdjointGenerator(), and DiffeGradientUtils::CreateFromClone().
| TypeTree TypeResults::getReturnAnalysis | ( | ) | const |
The Type of the return.
Definition at line 6492 of file TypeAnalysis.cpp.
References analyzer, and TypeAnalyzer::getReturnAnalysis().
Referenced by getAnalyzedTypeInfo(), and TypeAnalyzer::visitIPOCall().
| ConcreteType TypeResults::intType | ( | size_t | num, |
| llvm::Value * | val, | ||
| bool | errIfNotFound = true, | ||
| bool | pointerIntSame = false ) const |
Definition at line 6232 of file TypeAnalysis.cpp.
References TypeAnalyzer::analysis, analyzer, Anything, and query().
Referenced by AdjointGenerator::visitInsertValueInst().
| std::set< int64_t > TypeResults::knownIntegralValues | ( | llvm::Value * | val | ) | const |
The set of values val will take on during this program.
Definition at line 6496 of file TypeAnalysis.cpp.
References analyzer, and TypeAnalyzer::knownIntegralValues().
Referenced by AdjointGenerator::createBinaryOperatorAdjoint(), AdjointGenerator::createBinaryOperatorDual(), and AdjointGenerator::visitOMPCall().
| TypeTree TypeResults::query | ( | llvm::Value * | val | ) | const |
The TypeTree of a particular Value.
Definition at line 6097 of file TypeAnalysis.cpp.
References analyzer, TypeAnalyzer::fntypeinfo, FnTypeInfo::Function, and TypeAnalyzer::getAnalysis().
Referenced by addingType(), allFloat(), anyFloat(), anyPointer(), AdjointGenerator::createBinaryOperatorAdjoint(), AdjointGenerator::createBinaryOperatorDual(), AdjointGenerator::DifferentiableMemCopyFloats(), EnzymeGradientUtilsAllocAndGetTypeTree(), firstPointer(), getAnalyzedTypeInfo(), intType(), AdjointGenerator::recursivelyHandleSubfunction(), TypeAnalyzer::visitCallBase(), AdjointGenerator::visitCallInst(), AdjointGenerator::visitCastInst(), AdjointGenerator::visitCommonStore(), AdjointGenerator::visitExtractValueInst(), AdjointGenerator::visitInsertValueInst(), TypeAnalyzer::visitIPOCall(), AdjointGenerator::visitLoadLike(), AdjointGenerator::visitMemSetCommon(), AdjointGenerator::visitMemTransferCommon(), AdjointGenerator::visitOMPCall(), and writesToMemoryReadBy().
| TypeAnalyzer* TypeResults::analyzer |
Definition at line 183 of file TypeAnalysis.h.
Referenced by AdjointGenerator::AdjointGenerator(), allFloat(), anyFloat(), anyPointer(), dump(), EmitNoTypeError(), EnzymeGradientUtilsTypeAnalyzer(), firstPointer(), getAnalyzedTypeInfo(), getCallInfo(), getFunction(), getReturnAnalysis(), intType(), knownIntegralValues(), query(), AdjointGenerator::recursivelyHandleSubfunction(), and AdjointGenerator::visitOMPCall().