isParallelIterator and isReductionIterator are moved from Linalg/Utils to
the new location so they can be used in LinalgOps itself.
getNParallelIterators is a very common pattern that was recreated 3 times in
the MLIR codebase.
Paths
| Differential D137421
[mlir] Move helper function to work with IteratorTypes to StructuredOpsUtils. AbandonedPublic Authored by olegshyshkov on Nov 4 2022, 6:46 AM.
Details Summary isParallelIterator and isReductionIterator are moved from Linalg/Utils to getNParallelIterators is a very common pattern that was recreated 3 times in
Diff Detail
Event Timelinemravishankar added inline comments.
This revision now requires changes to proceed.Nov 4 2022, 12:52 PM olegshyshkov added inline comments.
Comment Actions
+1!
+1!
That would be great. Lesser API surface area, the better.
I am only looking for consistency. In other dialects that provide utils (like Arith dialect and Tensor dialect) I dont see the util namespace being used (is util used anywhere in the codebase?). It just makes it confusing for developers looking around w.r.t. when to add util and when not to do so. Comment Actions I expected that this patch will help reduce the size of https://reviews.llvm.org/D137658, but the gain is so small, I don't think it's worth proceeding. I'll just drop this change.
Revision Contents
Diff 473221 mlir/include/mlir/Dialect/Linalg/Utils/Utils.h
mlir/include/mlir/Dialect/Tosa/Utils/CoversionUtils.h
mlir/include/mlir/Dialect/Utils/StructuredOpsUtils.h
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
mlir/lib/Dialect/Linalg/Transforms/ElementwiseToLinalg.cpp
mlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
mlir/lib/Dialect/Linalg/Utils/Utils.cpp
mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
mlir/lib/Dialect/Tosa/Utils/ConversionUtils.cpp
mlir/lib/Dialect/Utils/StructuredOpsUtils.cpp
|
I find it strange that there is a utils namespace for these, but other methods here are not in utils namespace. Either we should move all of these to utils namespace, or drop the namespace altogether.