[PATCH] D136483: [mlir][MemRefToLLVM] Reuse existing lowering for collaspe/expand_shape

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 21 12:37:39 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, 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.

The simplifications coming from the SimplifyExtractStridedMetadata pass (hooked up in `populateMemRefToLLVMConversionPatterns`) already consume `collapse_shape` and `expand_shape` operations through the rewrite patterns:

  expand_shape/collaspse_shape src

>
=

  base, ... = extract_strided_metadata src
  offset = <some math>
  sizes = <some math>
  strides = <some math>
  reinterpret_cast base to offset: offset, ...

As a result, the lowering code in MemRefToLLVM is just redundant.
This patch gets rid of it.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136483

Files:
  mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
  mlir/test/Conversion/MemRefToLLVM/memref-to-llvm.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D136483.469717.patch
Type: text/x-patch
Size: 62451 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221021/cdfd62bf/attachment.bin>


More information about the llvm-commits mailing list