[mlir] support creating memref descriptors from static shape with non-zero offset
authorTobias Gysi <tobias.gysi@inf.ethz.ch>
Wed, 12 Feb 2020 21:36:21 +0000 (22:36 +0100)
committerAlex Zinenko <zinenko@google.com>
Wed, 12 Feb 2020 21:40:49 +0000 (22:40 +0100)
commit4f865b77941db364eaf0a6c265d183274c503ecb
treed99521535fd6ca5725903ee13ad88a0b3590e35f
parent56aba9699d8d1d10f7e93f60dd11f7e4cce3eb93
[mlir] support creating memref descriptors from static shape with non-zero offset

This patch adapts the method MemRefDescriptor::fromStaticShape to
support static non-zero offsets. The updated method uses the
getStridesAndOffset method to extract strides and offset. The patch also
adapts the test cases since sizes and strides are now set in forward
instead of reverse order.

Differential Revision: https://reviews.llvm.org/D74474
mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
mlir/test/Conversion/GPUToNVVM/memory-attrbution.mlir
mlir/test/Conversion/StandardToLLVM/convert-static-memref-ops.mlir