Page MenuHomePhabricator

[Matrix] Add optimization remarks for matrix expression.
ClosedPublic

Authored by fhahn on Jan 9 2020, 7:12 AM.

Details

Summary

Generate remarks for matrix operations in a function. To generate remarks
for matrix expressions, the following approach is used:

  1. Collect leafs of matrix expressions (done in RemarkGenerator::getExpressionLeafs). Leafs are lowered matrix instructions without other matrix users (like stores).
  1. For each leaf, create a remark containing a linearizied version of the matrix expression.

The following improvements will be submitted as follow-ups:

  • Summarize number of vector instructions generated for each expression.
  • Account for shared sub-expressions.
  • Propagate matrix remarks up the inlining chain.

Diff Detail

Event Timeline

fhahn created this revision.Jan 9 2020, 7:12 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 9 2020, 7:12 AM

Unit tests: pass. 61664 tests passed, 0 failed and 779 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: pass.

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

fhahn updated this revision to Diff 237386.Jan 10 2020, 10:31 AM

Handle re-used ops.

Unit tests: pass. 61743 tests passed, 0 failed and 780 were skipped.

clang-tidy: fail. Please fix clang-tidy findings.

clang-format: pass.

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

anemet accepted this revision.Jan 23 2020, 11:40 AM

I think that in the description/commit log you want to say a bit on the motivation, like why it's useful to observe these matrix expression in this form.

LGTM!

llvm/lib/Transforms/Scalar/LowerMatrixIntrinsics.cpp
973

nit: This feels like a static utility function outside of this class, somewhere where we describe other properties of the intrinsics.

991

"scalar"/"matrix"

This revision is now accepted and ready to land.Jan 23 2020, 11:40 AM
This revision was automatically updated to reflect the committed changes.