Port load/store op translation to LLVM IR dialect lowering
authorAlex Zinenko <zinenko@google.com>
Fri, 8 Feb 2019 13:26:20 +0000 (05:26 -0800)
committerjpienaar <jpienaar@google.com>
Fri, 29 Mar 2019 23:21:53 +0000 (16:21 -0700)
commit4c35bbbb518ecb7b78c58b55759d10109f92b59e
treecadb7b665dcbb9167886c99dae5d8b7aacd8687e
parentc419accea36a721d4480f52259b4f599688621cf
Port load/store op translation to LLVM IR dialect lowering

Implement the lowering of memref load and store standard operations into the
LLVM IR dialect.  This largely follows the existing mechanism in
MLIR-to-LLVM-IR translation for the sake of compatibility.  A memref value is
transformed into a memref descriptor value which holds the pointer to the
underlying data buffer and the dynamic memref sizes.  The data buffer is
contiguous.  Accesses to multidimensional memrefs are linearized in row-major
form.  In linear address computation, statically known sizes are used as
constants while dynamic sizes are extracted from the memref descriptor.

PiperOrigin-RevId: 233043846
mlir/lib/LLVMIR/Transforms/ConvertToLLVMDialect.cpp
mlir/test/LLVMIR/convert-memref-ops.mlir [new file with mode: 0644]
mlir/test/LLVMIR/convert-to-llvmir.mlir