MLIR  19.0.0git
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
mlir::detail::DenseIntOrFPElementsAttrStorage Struct Reference

An attribute representing a reference to a dense vector or tensor object. More...

#include "IR/AttributeDetail.h"

+ Inheritance diagram for mlir::detail::DenseIntOrFPElementsAttrStorage:

Classes

struct  KeyTy
 

Public Member Functions

 DenseIntOrFPElementsAttrStorage (ShapedType ty, ArrayRef< char > data, bool isSplat=false)
 
bool operator== (const KeyTy &key) const
 Compare this storage instance with the provided key. More...
 
- Public Member Functions inherited from mlir::detail::DenseElementsAttributeStorage
 DenseElementsAttributeStorage (ShapedType type, bool isSplat)
 
- Public Member Functions inherited from mlir::AttributeStorage
const AbstractAttributegetAbstractAttribute () const
 Return the abstract descriptor for this attribute. More...
 

Static Public Member Functions

static KeyTy getKey (ShapedType ty, ArrayRef< char > data, bool isKnownSplat)
 Construct a key from a shaped type, raw data buffer, and a flag that signals if the data is already known to be a splat. More...
 
static KeyTy getKeyForBoolData (ShapedType ty, ArrayRef< char > data, size_t numElements)
 Construct a key with a set of boolean data. More...
 
static KeyTy getKeyForSplatBoolData (ShapedType type, bool splatValue)
 Return a key to use for a boolean splat of the given value. More...
 
static llvm::hash_code hashKey (const KeyTy &key)
 Hash the key for the storage. More...
 
static DenseIntOrFPElementsAttrStorageconstruct (AttributeStorageAllocator &allocator, KeyTy key)
 Construct a new storage instance. More...
 

Public Attributes

ArrayRef< char > data
 
- Public Attributes inherited from mlir::detail::DenseElementsAttributeStorage
ShapedType type
 
bool isSplat
 

Static Public Attributes

static const char kSplatTrue = ~0
 The values used to denote a boolean splat value. More...
 
static const char kSplatFalse = 0
 

Additional Inherited Members

- Protected Member Functions inherited from mlir::AttributeStorage
void initializeAbstractAttribute (const AbstractAttribute &abstractAttr)
 Set the abstract attribute for this storage instance. More...
 
void initialize (MLIRContext *context)
 Default initialization for attribute storage classes that require no additional initialization. More...
 
- Protected Member Functions inherited from mlir::StorageUniquer::BaseStorage
 BaseStorage ()=default
 

Detailed Description

An attribute representing a reference to a dense vector or tensor object.

Definition at line 56 of file AttributeDetail.h.

Constructor & Destructor Documentation

◆ DenseIntOrFPElementsAttrStorage()

mlir::detail::DenseIntOrFPElementsAttrStorage::DenseIntOrFPElementsAttrStorage ( ShapedType  ty,
ArrayRef< char >  data,
bool  isSplat = false 
)
inline

Definition at line 57 of file AttributeDetail.h.

Referenced by construct().

Member Function Documentation

◆ construct()

static DenseIntOrFPElementsAttrStorage* mlir::detail::DenseIntOrFPElementsAttrStorage::construct ( AttributeStorageAllocator allocator,
KeyTy  key 
)
inlinestatic

◆ getKey()

static KeyTy mlir::detail::DenseIntOrFPElementsAttrStorage::getKey ( ShapedType  ty,
ArrayRef< char >  data,
bool  isKnownSplat 
)
inlinestatic

Construct a key from a shaped type, raw data buffer, and a flag that signals if the data is already known to be a splat.

Callers to this function are expected to tag preknown splat values when possible, e.g. one element shapes.

Definition at line 88 of file AttributeDetail.h.

References data, mlir::detail::divideCeil(), mlir::detail::getDenseElementBitWidth(), getKeyForBoolData(), getKeyForSplatBoolData(), and mlir::presburger::hash_value().

◆ getKeyForBoolData()

static KeyTy mlir::detail::DenseIntOrFPElementsAttrStorage::getKeyForBoolData ( ShapedType  ty,
ArrayRef< char >  data,
size_t  numElements 
)
inlinestatic

Construct a key with a set of boolean data.

Definition at line 133 of file AttributeDetail.h.

References data, getKeyForSplatBoolData(), mlir::presburger::hash_value(), kSplatFalse, and kSplatTrue.

Referenced by getKey().

◆ getKeyForSplatBoolData()

static KeyTy mlir::detail::DenseIntOrFPElementsAttrStorage::getKeyForSplatBoolData ( ShapedType  type,
bool  splatValue 
)
inlinestatic

Return a key to use for a boolean splat of the given value.

Definition at line 165 of file AttributeDetail.h.

References mlir::presburger::hash_value(), kSplatFalse, kSplatTrue, and mlir::detail::DenseElementsAttributeStorage::type.

Referenced by getKey(), and getKeyForBoolData().

◆ hashKey()

static llvm::hash_code mlir::detail::DenseIntOrFPElementsAttrStorage::hashKey ( const KeyTy key)
inlinestatic

◆ operator==()

bool mlir::detail::DenseIntOrFPElementsAttrStorage::operator== ( const KeyTy key) const
inline

Member Data Documentation

◆ data

ArrayRef<char> mlir::detail::DenseIntOrFPElementsAttrStorage::data

Definition at line 193 of file AttributeDetail.h.

Referenced by construct(), getKey(), getKeyForBoolData(), and operator==().

◆ kSplatFalse

const char DenseIntOrFPElementsAttrStorage::kSplatFalse = 0
static

Definition at line 200 of file AttributeDetail.h.

Referenced by getKeyForBoolData(), and getKeyForSplatBoolData().

◆ kSplatTrue

const char DenseIntOrFPElementsAttrStorage::kSplatTrue = ~0
static

The values used to denote a boolean splat value.

Definition at line 199 of file AttributeDetail.h.

Referenced by getKeyForBoolData(), and getKeyForSplatBoolData().


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