This is an archive of the discontinued LLVM Phabricator instance.

[Matrix] Add IR MatrixBuilder.
ClosedPublic

Authored by fhahn on Jan 6 2020, 9:04 AM.

Details

Summary

This builder provides a convenient way for targets to lower various matrix
operations to LLVM IR, making use of matrix intrinsics where available.

Diff Detail

Event Timeline

fhahn created this revision.Jan 6 2020, 9:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 6 2020, 9:04 AM
Herald added a subscriber: tschuett. · View Herald Transcript

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

LuoYuanke added inline comments.Jan 6 2020, 9:51 PM
llvm/include/llvm/IR/MatrixBuilder.h
48

Is ResultNumElementsFlattened needed? I notice there is no comments for this parameter in the function head.
ResultNumElementsFlattened = Rows * Columns?

fhahn updated this revision to Diff 236902.Jan 8 2020, 2:03 PM

Remove unnecessary ResultNumElementsFlattened, add doc-comments.

fhahn marked 2 inline comments as done.Jan 8 2020, 2:04 PM
fhahn added inline comments.
llvm/include/llvm/IR/MatrixBuilder.h
48

ResultNumElementsFlattened is indexed unnecessary here and elsewhere in this patch. I've removed it.

Unit tests: pass. 61321 tests passed, 0 failed and 736 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 marked an inline comment as done.Jan 16 2020, 4:47 AM

ping

anemet accepted this revision.Jan 17 2020, 5:27 PM

LGTM, however it would better if this patch also converted existing code to use this new API.

llvm/include/llvm/IR/MatrixBuilder.h
153–156

Should probably call CreateMul.

This revision is now accepted and ready to land.Jan 17 2020, 5:27 PM
This revision was automatically updated to reflect the committed changes.