|
Enzyme main
|
Concrete SubType of a given value. More...
#include "TypeAnalysis/ConcreteType.h"

Public Member Functions | |
| ConcreteType (llvm::Type *SubType) | |
| Construct a ConcreteType from an existing FloatingPoint Type. | |
| ConcreteType (BaseType SubTypeEnum) | |
| Construct a non-floating Concrete type from a BaseType. | |
| ConcreteType (llvm::StringRef Str, llvm::LLVMContext &C) | |
| Construct a ConcreteType from a string A Concrete Type's string representation is given by the string of the enum If it is a floating point it is given by Float<specific_type> | |
| std::string | str () const |
| Convert the ConcreteType to a string. | |
| bool | isKnown () const |
| Whether this ConcreteType has information (is not unknown) | |
| bool | isIntegral () const |
| Whether this ConcreteType must an integer. | |
| bool | isPossiblePointer () const |
| Whether this ConcreteType could be a pointer (SubTypeEnum is unknown or a pointer) | |
| bool | isPossibleFloat () const |
| Whether this ConcreteType could be a float (SubTypeEnum is unknown or a float) | |
| llvm::Type * | isFloat () const |
| Return the floating point type, if this is a float. | |
| bool | operator== (const BaseType BT) const |
| Return if this is known to be the BaseType BT This cannot be called with BaseType::Float as it lacks information. | |
| bool | operator!= (const BaseType BT) const |
| Return if this is known not to be the BaseType BT This cannot be called with BaseType::Float as it lacks information. | |
| bool | operator== (const ConcreteType CT) const |
| Return if this is known to be the ConcreteType CT. | |
| bool | operator!= (const ConcreteType CT) const |
| Return if this is known not to be the ConcreteType CT. | |
| bool | operator= (const ConcreteType CT) |
| Set this to the given ConcreteType, returning true if this ConcreteType has changed. | |
| bool | operator= (const BaseType BT) |
| Set this to the given BaseType, returning true if this ConcreteType has changed. | |
| bool | checkedOrIn (const ConcreteType CT, bool PointerIntSame, bool &LegalOr) |
Set this to the logical or of itself and CT, returning whether this value changed Setting PointerIntSame considers pointers and integers as equivalent If this is an illegal operation, LegalOr will be set to false. | |
| bool | orIn (const ConcreteType CT, bool PointerIntSame) |
Set this to the logical or of itself and CT, returning whether this value changed Setting PointerIntSame considers pointers and integers as equivalent This function will error if doing an illegal Operation. | |
| bool | operator|= (const ConcreteType CT) |
| Set this to the logical or of itself and CT, returning whether this value changed This assumes that pointers and integers are distinct This function will error if doing an illegal Operation. | |
| bool | andIn (const ConcreteType CT) |
| Set this to the logical and of itself and CT, returning whether this value changed If this and CT are incompatible, the result will be BaseType::Unknown. | |
| bool | operator&= (const ConcreteType CT) |
| Set this to the logical and of itself and CT, returning whether this value changed If this and CT are incompatible, the result will be BaseType::Unknown. | |
| ConcreteType | PurgeAnything () const |
Keep only mappings where the type is not an Anything | |
| bool | binopIn (bool &Legal, const ConcreteType RHS, llvm::BinaryOperator::BinaryOps Op) |
Set this to the logical binop of itself and RHS, using the Binop Op, returning true if this was changed. | |
| bool | operator< (const ConcreteType dt) const |
| Compare concrete types for use in map's. | |
Public Attributes | |
| BaseType | SubTypeEnum |
| Category of underlying type. | |
| llvm::Type * | SubType |
| Floating point type, if relevant, otherwise nullptr. | |
Concrete SubType of a given value.
Consists of a category BaseType and the particular floating point value, if relevant.
Definition at line 41 of file ConcreteType.h.
|
inline |
Construct a ConcreteType from an existing FloatingPoint Type.
Definition at line 49 of file ConcreteType.h.
References SubType.
Referenced by operator=().
|
inline |
Construct a non-floating Concrete type from a BaseType.
Definition at line 60 of file ConcreteType.h.
References Float, and SubTypeEnum.
|
inline |
Construct a ConcreteType from a string A Concrete Type's string representation is given by the string of the enum If it is a floating point it is given by Float<specific_type>
Definition at line 68 of file ConcreteType.h.
References Float, parseBaseType(), SubType, and SubTypeEnum.
|
inline |
Set this to the logical and of itself and CT, returning whether this value changed If this and CT are incompatible, the result will be BaseType::Unknown.
Definition at line 261 of file ConcreteType.h.
References Anything, SubType, SubTypeEnum, and Unknown.
Referenced by operator&=().
|
inline |
Set this to the logical binop of itself and RHS, using the Binop Op, returning true if this was changed.
This function will error on an invalid type combination
Definition at line 299 of file ConcreteType.h.
References Anything, Integer, isFloat(), Pointer, SubType, SubTypeEnum, and Unknown.
Referenced by TypeTree::binopIn().
|
inline |
Set this to the logical or of itself and CT, returning whether this value changed Setting PointerIntSame considers pointers and integers as equivalent If this is an illegal operation, LegalOr will be set to false.
Definition at line 202 of file ConcreteType.h.
References Anything, Integer, Pointer, SubType, SubTypeEnum, and Unknown.
Referenced by TypeTree::checkedOrIn(), and orIn().
|
inline |
Return the floating point type, if this is a float.
Definition at line 145 of file ConcreteType.h.
References SubType.
Referenced by binopIn(), ewrap(), and getOrInsertOpFloatSum().
|
inline |
Whether this ConcreteType must an integer.
Definition at line 126 of file ConcreteType.h.
References Integer, and SubTypeEnum.
Referenced by mlir::enzyme::ActivityAnalyzer::isConstantValue().
|
inline |
Whether this ConcreteType has information (is not unknown)
Definition at line 123 of file ConcreteType.h.
References SubTypeEnum, and Unknown.
Referenced by writesToMemoryReadBy().
|
inline |
Whether this ConcreteType could be a float (SubTypeEnum is unknown or a float)
Definition at line 138 of file ConcreteType.h.
References Anything, Float, SubTypeEnum, and Unknown.
|
inline |
Whether this ConcreteType could be a pointer (SubTypeEnum is unknown or a pointer)
Definition at line 130 of file ConcreteType.h.
References Anything, Pointer, SubTypeEnum, and Unknown.
|
inline |
Return if this is known not to be the BaseType BT This cannot be called with BaseType::Float as it lacks information.
Definition at line 161 of file ConcreteType.h.
References Float, and SubTypeEnum.
|
inline |
Return if this is known not to be the ConcreteType CT.
Definition at line 177 of file ConcreteType.h.
|
inline |
Set this to the logical and of itself and CT, returning whether this value changed If this and CT are incompatible, the result will be BaseType::Unknown.
Definition at line 287 of file ConcreteType.h.
References andIn().
|
inline |
Compare concrete types for use in map's.
Definition at line 506 of file ConcreteType.h.
References SubType, and SubTypeEnum.
|
inline |
Set this to the given BaseType, returning true if this ConcreteType has changed.
Definition at line 194 of file ConcreteType.h.
References ConcreteType(), Float, and operator=().
|
inline |
Set this to the given ConcreteType, returning true if this ConcreteType has changed.
Definition at line 181 of file ConcreteType.h.
References SubType, and SubTypeEnum.
Referenced by operator=().
|
inline |
Return if this is known to be the BaseType BT This cannot be called with BaseType::Float as it lacks information.
Definition at line 149 of file ConcreteType.h.
References Float, and SubTypeEnum.
|
inline |
Return if this is known to be the ConcreteType CT.
Definition at line 172 of file ConcreteType.h.
References SubType, and SubTypeEnum.
|
inline |
Set this to the logical or of itself and CT, returning whether this value changed This assumes that pointers and integers are distinct This function will error if doing an illegal Operation.
Definition at line 254 of file ConcreteType.h.
References orIn().
|
inline |
Set this to the logical or of itself and CT, returning whether this value changed Setting PointerIntSame considers pointers and integers as equivalent This function will error if doing an illegal Operation.
Definition at line 239 of file ConcreteType.h.
References checkedOrIn(), and str().
Referenced by operator|=(), and TypeTree::ShiftIndices().
|
inline |
Keep only mappings where the type is not an Anything
Definition at line 290 of file ConcreteType.h.
References Anything, SubTypeEnum, and Unknown.
Referenced by TypeAnalyzer::visitCmpInst().
|
inline |
Convert the ConcreteType to a string.
Definition at line 98 of file ConcreteType.h.
References Float, SubType, SubTypeEnum, and to_string().
Referenced by getOrInsertOpFloatSum(), TypeTree::insert(), mlir::enzyme::ActivityAnalyzer::isConstantValue(), orIn(), TypeTree::orIn(), to_string(), and TypeTree::toMD().
| llvm::Type* ConcreteType::SubType |
Floating point type, if relevant, otherwise nullptr.
Definition at line 46 of file ConcreteType.h.
Referenced by andIn(), binopIn(), checkedOrIn(), ConcreteType(), ConcreteType(), isFloat(), operator<(), operator=(), operator==(), and str().
| BaseType ConcreteType::SubTypeEnum |
Category of underlying type.
Definition at line 44 of file ConcreteType.h.
Referenced by andIn(), binopIn(), checkedOrIn(), ConcreteType(), ConcreteType(), ewrap(), isIntegral(), isKnown(), isPossibleFloat(), isPossiblePointer(), operator!=(), operator<(), operator=(), operator==(), operator==(), PurgeAnything(), and str().