|
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, llvm::Instruction *I, GradientUtils *gutils=nullptr, llvm::IRBuilder<> *BuilderIfShouldErr=nullptr, 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, GradientUtils *gutils=nullptr, llvm::IRBuilder<> *BuilderIfShouldErr=nullptr, 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) | |
| const 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 191 of file TypeAnalysis.h.
| TypeResults::TypeResults | ( | std::nullptr_t | ) |
Definition at line 6544 of file TypeAnalysis.cpp.
| TypeResults::TypeResults | ( | TypeAnalyzer & | analyzer | ) |
Definition at line 6543 of file TypeAnalysis.cpp.
| Type * TypeResults::addingType | ( | size_t | num, |
| llvm::Value * | val, | ||
| size_t | start = 0 ) const |
Definition at line 6725 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 6592 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 6621 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 6660 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 6693 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, | ||
| GradientUtils * | gutils = nullptr, | ||
| llvm::IRBuilder<> * | BuilderIfShouldErr = nullptr, | ||
| 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 6742 of file TypeAnalysis.cpp.
References analyzer, Anything, CustomErrorHandler, TypeTree::Data0(), dump(), EmitNoTypeError(), TypeAnalyzer::fntypeinfo, FnTypeInfo::Function, IllegalFirstPointer, Pointer, query(), and str().
Referenced by AdjointGenerator::handleKnownCallDerivatives(), AdjointGenerator::handleMPI(), and AdjointGenerator::visitAtomicRMWInst().
| FnTypeInfo TypeResults::getAnalyzedTypeInfo | ( | ) | const |
The TypeInfo calling convention.
Definition at line 6546 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 6556 of file TypeAnalysis.cpp.
References analyzer, and TypeAnalyzer::getCallInfo().
Referenced by AdjointGenerator::recursivelyHandleSubfunction().
| Function * TypeResults::getFunction | ( | ) | const |
Definition at line 6850 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 6854 of file TypeAnalysis.cpp.
References analyzer, and TypeAnalyzer::getReturnAnalysis().
Referenced by getAnalyzedTypeInfo(), TypeAnalyzer::visitCallBase(), and TypeAnalyzer::visitIPOCall().
| ConcreteType TypeResults::intType | ( | size_t | num, |
| llvm::Value * | val, | ||
| llvm::Instruction * | I, | ||
| GradientUtils * | gutils = nullptr, | ||
| llvm::IRBuilder<> * | BuilderIfShouldErr = nullptr, | ||
| bool | pointerIntSame = false ) const |
Definition at line 6695 of file TypeAnalysis.cpp.
References Anything, EmitNoTypeError(), query(), and str().
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 6858 of file TypeAnalysis.cpp.
References analyzer, and TypeAnalyzer::knownIntegralValues().
Referenced by AdjointGenerator::createBinaryOperatorAdjoint(), AdjointGenerator::createBinaryOperatorDual(), and AdjointGenerator::visitOMPCall().
| const TypeTree & TypeResults::query | ( | llvm::Value * | val | ) | const |
The TypeTree of a particular Value.
Definition at line 6560 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(), AdjointGenerator::visitAtomicRMWInst(), 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 193 of file TypeAnalysis.h.
Referenced by AdjointGenerator::AdjointGenerator(), allFloat(), anyFloat(), anyPointer(), dump(), EmitNoTypeError(), EnzymeGradientUtilsTypeAnalyzer(), firstPointer(), getAnalyzedTypeInfo(), getCallInfo(), getFunction(), getReturnAnalysis(), knownIntegralValues(), query(), AdjointGenerator::recursivelyHandleSubfunction(), and AdjointGenerator::visitOMPCall().