diff options
author | max <maksim.levental@gmail.com> | 2023-05-02 15:52:04 -0500 |
---|---|---|
committer | max <maksim.levental@gmail.com> | 2023-05-03 18:45:40 -0500 |
commit | ef1b735dfbed00a11a34bf4169a5b3fd8816b52f (patch) | |
tree | cd6c019e2fb1bcf9cde6acf63f696fa88a00c99b /mlir/lib/Bindings/Python/IRAttributes.cpp | |
parent | 218b50a606370b176ef776ff98cdb8b21b54277f (diff) | |
download | llvm-ef1b735dfbed00a11a34bf4169a5b3fd8816b52f.zip llvm-ef1b735dfbed00a11a34bf4169a5b3fd8816b52f.tar.gz llvm-ef1b735dfbed00a11a34bf4169a5b3fd8816b52f.tar.bz2 |
[MLIR][python bindings] Add support for DenseElementsAttr of IndexType
Differential Revision: https://reviews.llvm.org/D149690
Diffstat (limited to 'mlir/lib/Bindings/Python/IRAttributes.cpp')
-rw-r--r-- | mlir/lib/Bindings/Python/IRAttributes.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mlir/lib/Bindings/Python/IRAttributes.cpp b/mlir/lib/Bindings/Python/IRAttributes.cpp index 5e7138b..2200195 100644 --- a/mlir/lib/Bindings/Python/IRAttributes.cpp +++ b/mlir/lib/Bindings/Python/IRAttributes.cpp @@ -710,6 +710,10 @@ public: // f16 return bufferInfo<uint16_t>(shapedType, "e"); } + if (mlirTypeIsAIndex(elementType)) { + // Same as IndexType::kInternalStorageBitWidth + return bufferInfo<int64_t>(shapedType); + } if (mlirTypeIsAInteger(elementType) && mlirIntegerTypeGetWidth(elementType) == 32) { if (mlirIntegerTypeIsSignless(elementType) || |