This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Linalg] Add tensor support to Linalg EDSC Builders
ClosedPublic

Authored by nicolasvasilache on Jan 21 2020, 4:51 PM.

Details

Summary

This diff extends the Linalg EDSC builders so we can easily create mixed
tensor/buffer linalg.generic ops. This is expected to be useful for
HLO -> Linalg lowering.

The StructuredIndexed struct is made to derive from ValueHandle and can
now capture a type + indexing expressions. This is used to represent return
tensors.

Pointwise unary and binary builders are extended to allow both output buffers
and return tensors. This has implications on the number of region arguments.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptJan 21 2020, 4:51 PM

https://reviews.llvm.org/D72863 landed in an improper state and was reverted, I must have mixed something when updating the diff and later patching again before pushing...
This is the proper update.

Unit tests: pass. 62017 tests passed, 0 failed and 783 were skipped.

clang-tidy: unknown.

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-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

asaadaldien accepted this revision.Jan 22 2020, 11:51 AM

LGTM! clang-format + few nits...

mlir/lib/Dialect/Linalg/EDSC/Builders.cpp
161

How about directly inserting into values ? e.g

std::copy_if(s.begin(), s.end(), std::back_inserter(values), [](StructuredIndexed s) {return s.hasValue();});
165

same here

This revision is now accepted and ready to land.Jan 22 2020, 11:51 AM

Address review comment and clang-format.

This revision was automatically updated to reflect the committed changes.

Unit tests: pass. 62017 tests passed, 0 failed and 783 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

Unit tests: pass. 62114 tests passed, 0 failed and 808 were skipped.

clang-tidy: fail. clang-tidy found 0 errors and 6 warnings.

clang-format: pass.

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