[mlir][Linalg] Lower linalg.reshape to LLVM for the static case
authorNicolas Vasilache <ntv@google.com>
Mon, 6 Jan 2020 00:37:56 +0000 (19:37 -0500)
committerNicolas Vasilache <ntv@google.com>
Wed, 8 Jan 2020 18:07:41 +0000 (13:07 -0500)
commit766ce87e9bed89bc3b5c2c904f1eb2d10be0d3be
tree9f132bfe7e416f6c3194bfffa346c5e4aab79cfb
parent3811417f39a7d0a370fac2923060f5ef8dacd8d7
[mlir][Linalg] Lower linalg.reshape to LLVM for the static case

Summary:
This diff adds lowering of the linalg.reshape op to LLVM.

A new descriptor is created with fields initialized as follows:
1. allocatedPTr, alignedPtr and offset are copied from the source descriptor
2. sizes are copied from the static destination shape
3. strides are copied from the static strides collected with `getStridesAndOffset`

Only the static case in which the target view conforms to strided memref
semantics is supported. Other cases are left for future work and will be added on
a per-need basis.

Reviewers: ftynse, mravishankar

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72316
mlir/lib/Conversion/LinalgToLLVM/LinalgToLLVM.cpp
mlir/test/Dialect/Linalg/llvm.mlir