[PATCH] D136377: [mlir][MemRefToLLVM] Reuse existing subview lowering

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 20 13:57:19 PDT 2022


qcolombet created this revision.
qcolombet added reviewers: nicolasvasilache, ftynse, chelini, stellaraccident.
qcolombet added a project: MLIR.
Herald added subscribers: zero9178, bzcheeseman, awarzynski, sdasgup3, Groverkss, 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.
Herald added a reviewer: dcaballe.

Link up the `extract_strided_metadata` simplifications to the MemRefToLLVM conversion.
This allows to get rid of the subview lowering code in that pass.

This patch is NFC in spirit but not in practice because `subview` gets lowered into `reinterpret_cast(extract_strided_metadata, <some math>)` which lowers in two memref descriptors (one for `reinterpert_cast` and one for `extract_strided_metadata`), which creates some noise of the form: `extractvalue(unrealized_cast(extractvalue[0]))[0]` that is currently not simplified within MLIR but that is really just noop in that case.

Note: Because of the simplifications uses `affine.apply`, we have to pull the lowering of `affine` and `arith` into this pass.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136377

Files:
  mlir/include/mlir/Conversion/Passes.td
  mlir/lib/Conversion/MemRefToLLVM/CMakeLists.txt
  mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
  mlir/test/Conversion/MemRefToLLVM/convert-static-memref-ops.mlir
  mlir/test/Conversion/MemRefToLLVM/memref-to-llvm.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136377.469348.patch
Type: text/x-patch
Size: 80046 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221020/010ccaf0/attachment-0001.bin>


More information about the llvm-commits mailing list