#include "mlir/IR/BuiltinAttributes.cpp.inc"">

MLIR: lib/IR/BuiltinAttributes.cpp File Reference (original) (raw)

#include "[mlir/IR/BuiltinAttributes.h](mlir%5F2IR%5F2BuiltinAttributes%5F8h%5Fsource.html)"
#include "[AttributeDetail.h](AttributeDetail%5F8h%5Fsource.html)"
#include "[mlir/IR/AffineMap.h](mlir%5F2IR%5F2AffineMap%5F8h%5Fsource.html)"
#include "[mlir/IR/BuiltinDialect.h](BuiltinDialect%5F8h%5Fsource.html)"
#include "[mlir/IR/Dialect.h](IR%5F2Dialect%5F8h%5Fsource.html)"
#include "[mlir/IR/DialectResourceBlobManager.h](DialectResourceBlobManager%5F8h%5Fsource.html)"
#include "[mlir/IR/IntegerSet.h](mlir%5F2IR%5F2IntegerSet%5F8h%5Fsource.html)"
#include "[mlir/IR/OpImplementation.h](OpImplementation%5F8h%5Fsource.html)"
#include "[mlir/IR/Operation.h](IR%5F2Operation%5F8h%5Fsource.html)"
#include "[mlir/IR/SymbolTable.h](SymbolTable%5F8h%5Fsource.html)"
#include "[mlir/IR/Types.h](IR%5F2Types%5F8h%5Fsource.html)"
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/Sequence.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Endian.h"
#include <optional>
#include "mlir/IR/BuiltinAttributes.cpp.inc"

Go to the source code of this file.

Namespaces
Macros
#define DEBUG_TYPE "builtinattributes"
#define GET_ATTRDEF_CLASSES
Tablegen Attribute Definitions. More...
#define GET_ATTRDEF_LIST
Functions
template
static bool dictionaryAttrSort (ArrayRef< NamedAttribute > value, SmallVectorImpl< NamedAttribute > &storage)
Helper function that does either an in place sort or sorts from source array into destination. More...
static std::optional< NamedAttribute > findDuplicateElement (ArrayRef< NamedAttribute > value)
Returns an entry with a duplicate name from the given sorted array of named attributes. More...
static size_t getDenseElementStorageWidth (size_t origWidth)
Get the bitwidth of a dense element type within the buffer. More...
static size_t getDenseElementStorageWidth (Type elementType)
static void setBit (char *rawData, size_t bitPos, bool value)
Set a bit to a specific value. More...
static bool getBit (const char *rawData, size_t bitPos)
Return the value of the specified bit. More...
static void copyAPIntToArrayForBEmachine (APInt value, size_t numBytes, char *result)
Copy actual numBytes data from value (APInt) to char array(result) for BE format. More...
static void copyArrayToAPIntForBEmachine (const char *inArray, size_t numBytes, APInt &result)
Copy numBytes data from inArray(char array) to result(APINT) for BE format. More...
static void writeBits (char *rawData, size_t bitPos, APInt value)
Writes value to the bit position bitPos in array rawData. More...
static APInt readBits (const char *rawData, size_t bitPos, size_t bitWidth)
Reads the next bitWidth bits from the bit position bitPos in array rawData. More...
template
static bool hasSameNumElementsOrSplat (ShapedType type, const Values &values)
Returns true if 'values' corresponds to a splat, i.e. More...
static bool isValidIntOrFloat (Type type, int64_t dataEltSize, bool isInt, bool isSigned)
Check the information for a C++ data type, check if this type is valid for the current attribute. More...
static bool isComplexOfIntType (Type type)
Return if the given complex type has an integer element type. More...
template
static void writeAPIntsToBuffer (size_t storageWidth, SmallVectorImpl< char > &data, APRangeT &&values)
Utility method to write a range of APInt values to a buffer. More...
template<typename Fn , typename Attr >
static ShapedType mappingHelper (Fn mapping, Attr &attr, ShapedType inType, Type newElementType, llvm::SmallVectorImpl< char > &data)

DEBUG_TYPE

#define DEBUG_TYPE "builtinattributes"

GET_ATTRDEF_CLASSES

#define GET_ATTRDEF_CLASSES

GET_ATTRDEF_LIST

copyAPIntToArrayForBEmachine()

static void copyAPIntToArrayForBEmachine ( APInt value, size_t numBytes, char * result ) static

copyArrayToAPIntForBEmachine()

static void copyArrayToAPIntForBEmachine ( const char * inArray, size_t numBytes, APInt & result ) static

dictionaryAttrSort()

Helper function that does either an in place sort or sorts from source array into destination.

If inPlace then storage is both the source and the destination, else value is the source and storage destination. Returns whether source was sorted.

Definition at line 60 of file BuiltinAttributes.cpp.

findDuplicateElement()

Returns an entry with a duplicate name from the given sorted array of named attributes.

Returns std::nullopt if all elements have unique names.

Definition at line 102 of file BuiltinAttributes.cpp.

getBit()

static bool getBit ( const char * rawData, size_t bitPos ) static

getDenseElementStorageWidth() [1/2]

static size_t getDenseElementStorageWidth ( size_t origWidth) static

getDenseElementStorageWidth() [2/2]

static size_t getDenseElementStorageWidth ( Type elementType) static

hasSameNumElementsOrSplat()

template

static bool hasSameNumElementsOrSplat ( ShapedType type, const Values & values ) static

isComplexOfIntType()

static bool isComplexOfIntType ( Type type) static

isValidIntOrFloat()

static bool isValidIntOrFloat ( Type type, int64_t dataEltSize, bool isInt, bool isSigned ) static

mappingHelper()

template<typename Fn , typename Attr >

static ShapedType mappingHelper ( Fn mapping, Attr & attr, ShapedType inType, Type newElementType, llvm::SmallVectorImpl< char > & data ) static

readBits()

static APInt readBits ( const char * rawData, size_t bitPos, size_t bitWidth ) static

setBit()

static void setBit ( char * rawData, size_t bitPos, bool value ) static

writeAPIntsToBuffer()

template

static void writeAPIntsToBuffer ( size_t storageWidth, SmallVectorImpl< char > & data, APRangeT && values ) static

writeBits()

static void writeBits ( char * rawData, size_t bitPos, APInt value ) static