This shares more code with existing utilities. Also, to be consistent,
we moved dimension permutation on the DimOp to the tensor lowering phase.
This way, both pre-existing DimOps on sparse tensors (not likely but
possible) as well as compiler generated DimOps are handled consistently.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
740 ms | x64 windows > Clang.Index::complete-macros.c |
Event Timeline
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp | ||
---|---|---|
243 | Looks good to me. I only have one question. If the dimension 'idx' in the tensor type has a constant value, can we generate a constant instead of a call to sparseDimSize? |
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp | ||
---|---|---|
243 | Yes, but that is already done by earlier folding (either in pure MLIR for non-annotated tensors, or in sparse compiler with the call to createOrFoldDimOp). |
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorConversion.cpp | ||
---|---|---|
243 | Ah, but your question made me realize that MLIR's pure folding needs to be made aware of the permutation too, of course. I will fix that there. |
Looks good to me. I only have one question. If the dimension 'idx' in the tensor type has a constant value, can we generate a constant instead of a call to sparseDimSize?