Added support for sparse strings elements. This is a follow up from the original DenseStringElements.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
You also need to add a SparseElementsAttr::getZeroValue<StringRef> so that getValues<T> works:
https://github.com/llvm/llvm-project/blob/5339029ff79c0b6a501ef6bb7baeb07cb099f0b7/mlir/include/mlir/IR/Attributes.h#L1257
mlir/lib/IR/AsmPrinter.cpp | ||
---|---|---|
1491 | Use cast here as it is guaranteed to be DenseIntOrFPElementsAttr, dyn_cast implies that it may return null. |
mlir/include/mlir/IR/Attributes.h | ||
---|---|---|
1255 ↗ | (On Diff #260048) | You can just inline this in the getZeroValue<StringRef> below. The other methods are only defined like this because the values can't be constructed inline in the header file. |
1282 ↗ | (On Diff #260048) | This needs to be a SFINAE template to avoid having ambiguous methods. |
1283 ↗ | (On Diff #260048) | nit: Newline before here. |
Use cast here as it is guaranteed to be DenseIntOrFPElementsAttr, dyn_cast implies that it may return null.