[mlir][VectorOps] Implement insert_strided_slice conversion
authorNicolas Vasilache <ntv@google.com>
Thu, 9 Jan 2020 08:12:41 +0000 (03:12 -0500)
committerNicolas Vasilache <ntv@google.com>
Thu, 9 Jan 2020 08:13:01 +0000 (03:13 -0500)
commit2d515e49d89c0738ccef8f1733d5f9afe00ee979
tree46c20bc47996d20398c819dcd9cdde7e6eed63cd
parent65678d938431c90408afa8d255cbed3d8ed8273f
[mlir][VectorOps] Implement insert_strided_slice conversion

Summary:
This diff implements the progressive lowering of insert_strided_slice.
Two cases appear:
1. when the source and dest vectors have different ranks, extract the dest
subvector at the proper offset and reduce to case 2.
2. when they have the same rank N:
  a. if the source and dest type are the same, the insertion is trivial:
     just forward the source
  b. otherwise, iterate over all N-1 D subvectors and create an
     extract/insert_strided_slice/insert replacement, reducing the problem
     to vecotrs of the same N-1 rank.

This combines properly with the other conversion patterns to lower all the way to LLVM.

Reviewers: ftynse, rriddle, AlexEichenberger, andydavis1, tetuante, nicolasvasilache

Reviewed By: andydavis1

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

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72317
mlir/lib/Conversion/VectorToLLVM/ConvertVectorToLLVM.cpp
mlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir