[Mlir-commits] [mlir] [mlir][python] allow DenseIntElementsAttr for index type (PR #118947)

Stella Laurenzo llvmlistbot at llvm.org
Thu Dec 12 12:15:11 PST 2024


================
@@ -556,6 +556,8 @@ MLIR_CAPI_EXPORTED int64_t
 mlirDenseElementsAttrGetInt64Value(MlirAttribute attr, intptr_t pos);
 MLIR_CAPI_EXPORTED uint64_t
 mlirDenseElementsAttrGetUInt64Value(MlirAttribute attr, intptr_t pos);
+MLIR_CAPI_EXPORTED size_t mlirDenseElementsAttrGetIndexValue(MlirAttribute attr,
----------------
stellaraccident wrote:

MLIR internally models index values uniformly as 64 bit integers in IR structs, regardless of whether some outputs of the compiler device index as a 32bit value. 

So change this to `uint64_t` so that it works the same on 32 and 64 bit systems.

https://github.com/llvm/llvm-project/pull/118947


More information about the Mlir-commits mailing list