This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add primitive transform pattern to rewrite linalg.fill into vector.broadcast form.
ClosedPublic

Authored by asaadaldien on Jan 24 2020, 4:27 PM.

Details

Summary

This diff adds a transformation patter to rewrite linalg.fill as broadcasting a scaler into a vector.
It uses the same preconditioning as matmul (memory is contiguous).

Diff Detail

Event Timeline

asaadaldien created this revision.Jan 24 2020, 4:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 24 2020, 4:27 PM
rriddle added inline comments.Jan 24 2020, 4:32 PM
mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp
214

nit: if (auto fillOp = dyn_cast<linalg::FillOp(op)) {

Unit tests: pass. 62193 tests passed, 0 failed and 815 were skipped.

clang-tidy: pass.

clang-format: fail. Please format your changes with clang-format by running git-clang-format HEAD^ or applying this patch.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

aartbik added inline comments.Jan 24 2020, 5:09 PM
mlir/lib/Dialect/Linalg/Transforms/LinalgTransforms.cpp
216

fillas -> fill as

218

Period at end of comment.

asaadaldien marked 3 inline comments as done.

Resolve comments & clang-format

Looks good modulo Aart's comments.

Additional request for next pattern: 3rd time's a charm, let's please start refactoring the rewrites and template them on op types.

This revision is now accepted and ready to land.Jan 28 2020, 10:43 AM

Unit tests: pass. 62193 tests passed, 0 failed and 815 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

This revision was automatically updated to reflect the committed changes.