[PATCH] D79468: [mlir][Linalg] Start a LinalgToStandard pass and move conversion to library calls.

Alex Zinenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 02:39:18 PDT 2020


ftynse added a comment.

In D79468#2030763 <https://reviews.llvm.org/D79468#2030763>, @nicolasvasilache wrote:

> > so the new uses introduced here and the their lowering directly contradict what is stated in the doc.
>
> Here, I fixed it :)
>
>   The `memref_cast` operation converts a memref from one type to an equivalent
>   type with a compatible shape. The source and destination types are
>   compatible if both are ranked memref types with the same element type,
>   address space, and rank but where the individual dimensions may add or
>   remove constant dimensions from the memref type.
>   
>
> More seriously, I think this is an oversight since the doc examples and the impl contradict the "same layout" part.


This change still doesn't fit my mental model of casts (the model may be wrong, but it is likely an evidence of insufficient documentation). The change drops the layout unconditionally. Let's assume we cannot have a non-strided layout because all memrefs come from Linalg (may be worth an assert and/or a comment). When you cast from `memref<4x8xf32, offset:0, strides: [1,4]>` to `memref<4x8xf32>`, the strides practically become `[8,1]`, which doesn't look desirable.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79468/new/

https://reviews.llvm.org/D79468





More information about the llvm-commits mailing list