[PATCH] D136386: [mlir][MemRef] Change the anchor point of a reshapeLikeOp pattern
Quentin Colombet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 20 15:36:49 PDT 2022
qcolombet created this revision.
qcolombet added reviewers: nicolasvasilache, chelini.
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.
Essentially, this patches changes the anchor point of the `extract_strided_metadata(reshapeLikeOp)` pattern from `extract_strided_metadata` to `reshapeLikeOp`.
In details, this means that instead of replacing:
base, offset, sizes, strides =
extract_strided_metadata(reshapeLikeOp(src))
With
base, offset = extract_strided_metadata(src)
sizes = <some math>
strides = <some math>
We replace only the reshapeLikeOp part and connect it back with a reinterpret_cast:
val = reshapeLikeOp(src)
>
=
base, offset, ... = extract_strided_metadata(src)
sizes = <some math>
strides = <some math>
val = reinterpret_cast base, offset, sizes, strides
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D136386
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: D136386.469379.patch
Type: text/x-patch
Size: 12554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221020/d7153a8c/attachment.bin>
More information about the llvm-commits
mailing list