[PATCH] D73145: [mlir][Linalg] Introduce folding patterns to remove certain MemRefCastOp

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 29 04:55:09 PST 2020


ftynse accepted this revision.
ftynse added inline comments.
This revision is now accepted and ready to land.


================
Comment at: mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:87-91
+  AffineMap sourceMap = (sourceType.getAffineMaps().empty())
+                            ? AffineMap()
+                            : sourceType.getAffineMaps().front();
+  if (!sourceMap)
+    return true;
----------------
Let's exit even earlier

```
if (sourceType.getAffineMaps.empty())
  return true;

AffineMap sourceMap = sourceType.getAffineMaps().front();
```


================
Comment at: mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp:100
+      makeStridedLinearLayoutMap(strides, offset, sourceMap.getContext());
+  if (sourceMap != stridedMap)
+    return false;
----------------
`return sourceMap == stridedMap` ?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D73145





More information about the llvm-commits mailing list