[PATCH] D148947: [MemRefToLLVM] Add a method in MemRefDescriptor to get the buffer addr

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 11:30:52 PDT 2023


qcolombet created this revision.
qcolombet added reviewers: ftynse, nicolasvasilache, mravishankar.
qcolombet added a project: MLIR.
Herald added subscribers: bviyer, Moerafaat, 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, thopre.
Herald added a reviewer: dcaballe.
Herald added a project: All.
qcolombet requested review of this revision.
Herald added a subscriber: stephenneuendorffer.

This patch pushes the computation of the start address of a memref in one
place (a method in MemRefDescriptor.)

This allows all the (indirect) users of this method to produce the start
address in the same way.

Thanks to this change, we expose more CSEs opportunities and thanks to
that, the backend is able to properly find the `llvm.assume` expression
related to the base address as demonstrated in the added test.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148947

Files:
  mlir/include/mlir/Conversion/LLVMCommon/MemRefBuilder.h
  mlir/lib/Conversion/LLVMCommon/MemRefBuilder.cpp
  mlir/lib/Conversion/LLVMCommon/Pattern.cpp
  mlir/lib/Conversion/MemRefToLLVM/MemRefToLLVM.cpp
  mlir/test/Conversion/MemRefToLLVM/expand-then-convert-to-llvm.mlir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D148947.515850.patch
Type: text/x-patch
Size: 7861 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230421/d1a44b16/attachment.bin>


More information about the llvm-commits mailing list