[PATCH] D78844: Sparse String Elements support.

River Riddle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 24 17:53:54 PDT 2020


rriddle added a comment.

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



================
Comment at: mlir/lib/IR/AsmPrinter.cpp:1491
+
+  auto numAttr = attr.dyn_cast<DenseIntOrFPElementsAttr>();
+  printDenseIntOrFPElementsAttr(numAttr, allowHex);
----------------
Use cast here as it is guaranteed to be DenseIntOrFPElementsAttr, dyn_cast implies that it may return null.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78844/new/

https://reviews.llvm.org/D78844





More information about the llvm-commits mailing list