[PATCH] D136107: [mlir][MemRef] Fix the simplification of extract_strided_metadata(subview)

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 17 13:08:22 PDT 2022


qcolombet created this revision.
qcolombet added reviewers: ftynse, nicolasvasilache.
qcolombet added a project: MLIR.
Herald added subscribers: bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, rriddle, mehdi_amini.
Herald added a project: All.
qcolombet requested review of this revision.
Herald added a subscriber: stephenneuendorffer.

Prior to this patch we were wrongly applying the sub-strides to the computation of the final offset of the subview.

Put differently, we were computing the offset as:

  offset = baseOffset + sum(subOffset#i * baseStrides#i * subSizes#i)

Whereas we should be doing:

  offset = baseOffset + sum(subOffset#i * baseStrides#i)

I.e., drop the subSizes#i term from the sum.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136107

Files:
  mlir/lib/Dialect/MemRef/Transforms/SimplifyExtractStridedMetadata.cpp
  mlir/test/Dialect/MemRef/simplify-extract-strided-metadata.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136107.468296.patch
Type: text/x-patch
Size: 5504 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221017/1bc40f66/attachment.bin>


More information about the llvm-commits mailing list