[PATCH] D133166: [mlir][MemRef] Canonicalize extract_strided_metadata(subview)
Quentin Colombet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 2 18:56:56 PDT 2022
qcolombet updated this revision to Diff 457748.
qcolombet added a comment.
- Use getMixedXXX and getValueOrCreateConstant instead of manually handling the dynamic/static strides and sizes
- Make the code more compact:
- Compute the offset and strides in the same loop
- Filter the sizes and strides dimensions in the same loop
On the "make the code more compact", we could go even further and populate the resulting strides and sizes directly at the same time that we compute the strides and offset.
I decided against it as I like the separation of concern here, but I could be convinced otherwise. Similarly, I merged the offset and strides computations because it seems natural (and saved one loop), but if people prefer it separated like in the original patch that works for me too.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133166/new/
https://reviews.llvm.org/D133166
Files:
mlir/include/mlir/Dialect/MemRef/IR/MemRefOps.td
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
mlir/test/Dialect/MemRef/canonicalize.mlir
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133166.457748.patch
Type: text/x-patch
Size: 16169 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220903/01656731/attachment.bin>
More information about the llvm-commits
mailing list