This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Handle StringAttr in SparseElementsAttr::getZeroAttr.
ClosedPublic

Authored by Chia-hungDuan on Oct 5 2021, 6:37 PM.

Diff Detail

Event Timeline

Chia-hungDuan created this revision.Oct 5 2021, 6:37 PM
Chia-hungDuan requested review of this revision.Oct 5 2021, 6:37 PM

Sorry, almost forgot this... Not sure if we need test for this, didn't see a proper place to do that.

Mogball added inline comments.
mlir/lib/IR/BuiltinAttributes.cpp
1340

auto? Since the type is already in the cast

rriddle accepted this revision.Oct 11 2021, 6:32 PM

Can you add a test? An easy one would be to add a test for folding tensor.extract with a sparse string elements attribute (https://github.com/llvm/llvm-project/blob/b5e8348bf2ded134e45dab879a13d26f5b9c5815/mlir/test/Dialect/Tensor/canonicalize.mlir#L86)

LG otherwise.

This revision is now accepted and ready to land.Oct 11 2021, 6:32 PM
Chia-hungDuan marked an inline comment as done.

Address review comment and fix string type. Will add test later.

rriddle accepted this revision.Nov 3 2021, 10:49 PM