Enzyme main
Loading...
Searching...
No Matches
TypeResults Class Reference

A holder class representing the results of running TypeAnalysis on a given function. More...

#include "TypeAnalysis/TypeAnalysis.h"

Collaboration diagram for TypeResults:

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
 

Detailed Description

A holder class representing the results of running TypeAnalysis on a given function.

Definition at line 191 of file TypeAnalysis.h.

Constructor & Destructor Documentation

◆ TypeResults() [1/2]

TypeResults::TypeResults ( std::nullptr_t )

Definition at line 6544 of file TypeAnalysis.cpp.

◆ TypeResults() [2/2]

TypeResults::TypeResults ( TypeAnalyzer & analyzer)

Definition at line 6543 of file TypeAnalysis.cpp.

Member Function Documentation

◆ addingType()

◆ allFloat()

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().

◆ anyFloat()

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.

◆ anyPointer()

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().

◆ dump()

◆ firstPointer()

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().

◆ getAnalyzedTypeInfo()

FnTypeInfo TypeResults::getAnalyzedTypeInfo ( ) const

◆ getCallInfo()

FnTypeInfo TypeResults::getCallInfo ( llvm::CallBase & CI,
llvm::Function & fn ) const

◆ getFunction()

Function * TypeResults::getFunction ( ) const

◆ getReturnAnalysis()

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().

◆ intType()

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().

◆ knownIntegralValues()

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().

◆ query()

Member Data Documentation

◆ analyzer


The documentation for this class was generated from the following files: