HomePhabricator

[mlir] Require std.alloc() ops to have canonical layout during LLVM lowering.

Authored by csigg on Nov 16 2020, 2:41 AM.

Description

[mlir] Require std.alloc() ops to have canonical layout during LLVM lowering.

The current code allows strided layouts, but the number of elements allocated is ambiguous. It could be either the number of elements in the shape (the current implementation), or the amount of elements required to not index out-of-bounds with the given maps (which would require evaluating the layout map).

If we require the canonical layouts, the two will be the same.

Reviewed By: nicolasvasilache, ftynse

Differential Revision: https://reviews.llvm.org/D91523

Details