This is an archive of the discontinued LLVM Phabricator instance.

[mlir][linalg] Lower subtensor(pad_tensor) to pad_tensor(subtensor)
ClosedPublic

Authored by springerm on Jun 15 2021, 11:54 PM.

Details

Summary

Only high padding is supported at the moment. Low padding will be added in a separate commit.

Diff Detail

Event Timeline

springerm created this revision.Jun 15 2021, 11:54 PM
springerm requested review of this revision.Jun 15 2021, 11:54 PM
ThomasRaoux added inline comments.Jun 17 2021, 8:57 AM
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
731

Here and below spell out the type when it doesn't come from something like initializers like cast<Foo>(...). (https://llvm.org/docs/CodingStandards.html#id28)

732–736

nit: Maybe merge the two conditions?

813

should this use affine_expressions instead to potentially allow simplifications?

springerm added inline comments.Jun 17 2021, 5:06 PM
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
813

Lei's original revision was using affine maps. I was wondering what the benefit of those is. These "sub", "add" etc. helper functions are using "createOrFold", so constants will be folded. Is there any other benefit?

ThomasRaoux added inline comments.Jun 17 2021, 7:44 PM
mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
813

The. advantage of using affine expressions is that they are easier to analyze and simplify later in the pipeline. This is what is used later for tiling of structured linalg op so it might be good to have it like that here if it is not too complex.

springerm updated this revision to Diff 352933.Jun 18 2021, 1:32 AM
springerm marked 3 inline comments as done.

address comments

mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp
732–736

The second one will be removed in the next commit.

springerm updated this revision to Diff 352935.Jun 18 2021, 1:33 AM

minor change

ThomasRaoux accepted this revision.Jun 18 2021, 8:29 AM
This revision is now accepted and ready to land.Jun 18 2021, 8:29 AM
This revision was landed with ongoing or failed builds.Jun 18 2021, 9:45 PM
This revision was automatically updated to reflect the committed changes.