Lower linalg.transpose to LLVM dialect
authorNicolas Vasilache <ntv@google.com>
Sat, 24 Aug 2019 00:28:51 +0000 (17:28 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Sat, 24 Aug 2019 00:29:26 +0000 (17:29 -0700)
commit28e28e5d651b19a3f2a22c4fe4209a9d3d8c2689
treeba8c8814e105930f4c40d52ffb4185751cc7b3e7
parent2c2c9ffd80c786775c7187d35a74b771f61d91e4
Lower linalg.transpose to LLVM dialect

Add a conversion pattern that transforms a linalg.transpose op into:
   1. A function entry `alloca` operation to allocate a ViewDescriptor.
   2. A load of the ViewDescriptor from the pointer allocated in 1.
   3. Updates to the ViewDescriptor to introduce the data ptr, offset, size
      and stride. Size and stride are permutations of the original values.
   4. A store of the resulting ViewDescriptor to the alloca'ed pointer.
The linalg.transpose op is replaced by the alloca'ed pointer.

PiperOrigin-RevId: 265169112
mlir/include/mlir/IR/Builders.h
mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
mlir/test/Linalg/llvm.mlir