[PATCH] D78464: [mlir][Linalg] Add support for fusing linalg.tensor_reshape with linalg.generic operations.

Nicolas Vasilache via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 22 21:42:25 PDT 2020


nicolasvasilache accepted this revision.
nicolasvasilache added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: Kayjukh.

Thanks for the cleanup!



================
Comment at: mlir/lib/Dialect/Linalg/Transforms/Fusion.cpp:650
+  unsigned dim = 0;
+  for (AffineMap map : reassociationMaps) {
+    ArrayRef<AffineExpr> collapsedDims = map.getResults();
----------------
Could this whole loop be replaced by something like:
```
if (!useIndexMap.isIdentity()) return false;
for (auto linearizedExpr : linearizeCollapsedDims(useIndexMap, srcShape, reassociationMaps) )
  if (!isPureAffine(linearizedExpr)) return false;
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78464





More information about the llvm-commits mailing list