This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Rewrite DownscaleSizeOneWindowed2DConvolution to use rank-reducing insert/extract slices.
ClosedPublic

Authored by nicolasvasilache on Nov 12 2021, 1:44 AM.

Details

Summary

This rewriting enables better bufferization and canonicalizations.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Nov 12 2021, 1:44 AM
gysit added inline comments.Nov 12 2021, 2:22 AM
mlir/include/mlir/Dialect/Tensor/IR/Tensor.h
96

nit: tensor to dest?

mlir/include/mlir/IR/BuiltinTypes.h
242

Is it OK to let this->shape reference newShape here? I would expect the lifetime of newShape ends immediately after exiting dropDim? Or is it prolonged to the lifetime of the parent statement?

nicolasvasilache marked an inline comment as done.Nov 12 2021, 2:49 AM
nicolasvasilache added inline comments.
mlir/include/mlir/IR/BuiltinTypes.h
242

A new RankedTensorType is returned which has its own allocated shape for this.
I'll add a comment to avoid accidental return of Builder & which would be wrong indeed.

nicolasvasilache marked an inline comment as done.

Address.

nicolasvasilache marked an inline comment as done.Nov 12 2021, 2:57 AM
gysit accepted this revision.Nov 12 2021, 3:28 AM
gysit added inline comments.
mlir/include/mlir/IR/BuiltinTypes.h
242

Ah that makes sense. I missed the thing is casted!

This revision is now accepted and ready to land.Nov 12 2021, 3:28 AM
bondhugula added inline comments.
mlir/include/mlir/Dialect/Tensor/IR/Tensor.h
96

to dest -> to that of dest.

96

It isn't clear from the comment here why a Value has been passed instead of a target type.

mlir/include/mlir/IR/BuiltinTypes.h
206–208

Please add in sorted order.

211

out-live -> outlive

mlir/include/mlir/IR/BuiltinTypes.td
706

Likewise.