This is an archive of the discontinued LLVM Phabricator instance.

[mlir] [affine] add canonicalization for affine.vector_load, vector_store
ClosedPublic

Authored by eopXD on May 1 2021, 7:29 AM.

Details

Summary

Added canonicalization for vector_load and vector_store. An existing
pattern SimplifyAffineOp can be reused to compose maps that supplies
result into them. Added AffineVectorStoreOp and AffineVectorLoadOp
into static_assert of SimplifyAffineOp to allow operation to use it.

This fixes the bug filed: https://bugs.llvm.org/show_bug.cgi?id=50058

Diff Detail

Event Timeline

eopXD created this revision.May 1 2021, 7:29 AM
eopXD requested review of this revision.May 1 2021, 7:29 AM
eopXD added a comment.May 1 2021, 7:32 AM

I've also added canonicalizeMapAndOperands into SimplifyAffineOp, this will let maps be canonicalized, allowing the maps operations to be folded into the operand.

eopXD edited reviewers, added: bondhugula; removed: nicolasvasilache.May 1 2021, 7:33 AM

Thanks for adding this. Looks great to me. Please do address the clang-format warnings.

mlir/lib/Dialect/Affine/IR/AffineOps.cpp
907

You can run git clang-format HEAD~ to fix all these (assume HEAD is at this commit).

mlir/test/Dialect/Affine/canonicalize.mlir
927

New line at end of file.

bondhugula accepted this revision.May 1 2021, 7:44 AM
This revision is now accepted and ready to land.May 1 2021, 7:44 AM
eopXD updated this revision to Diff 342151.May 1 2021, 7:50 AM

Fix format warnings.

eopXD marked 2 inline comments as done.May 1 2021, 7:54 AM

Formats fixed, thanks for reviewing.
I don't have the access to commit to llvm, so may you help me to do it?

bondhugula accepted this revision.May 1 2021, 7:58 PM

Formats fixed, thanks for reviewing.
I don't have the access to commit to llvm, so may you help me to do it?

Done. (I fixed a minor whitespace issue in canonicalize.mlir at line #920 before committing.)

eopXD added a comment.May 1 2021, 11:08 PM

Formats fixed, thanks for reviewing.
I don't have the access to commit to llvm, so may you help me to do it?

Done. (I fixed a minor whitespace issue in canonicalize.mlir at line #920 before committing.)

Thank you for your modification and commit.