HomePhabricator

[Matrix] Add matrix type to Clang.

Authored by fhahn on May 11 2020, 9:45 AM.

Description

[Matrix] Add matrix type to Clang.

This patch adds a matrix type to Clang as described in the draft
specification in clang/docs/MatrixSupport.rst. It introduces a new option
-fenable-matrix, which can be used to enable the matrix support.

The patch adds new MatrixType and DependentSizedMatrixType types along
with the plumbing required. Loads of and stores to pointers to matrix
values are lowered to memory operations on 1-D IR arrays. After loading,
the loaded values are cast to a vector. This ensures matrix values use
the alignment of the element type, instead of LLVM's large vector
alignment.

The operators and builtins described in the draft spec will will be added in
follow-up patches.

Reviewers: martong, rsmith, Bigcheese, anemet, dexonsmith, rjmccall, aaron.ballman

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D72281

Details

Committed
fhahnMay 11 2020, 10:55 AM
Reviewer
rjmccall
Differential Revision
D72281: [Matrix] Add matrix type to Clang.
Parents
rGb51df268eb7e: [gn build] (manually) port bba38de50c9
Branches
Unknown
Tags
Unknown

Event Timeline

hans added a subscriber: hans.Aug 25 2020, 11:37 AM

Should this be mentioned in the release notes?

fhahn added a comment.Aug 25 2020, 2:27 PM

Should this be mentioned in the release notes?

I was not sure initially, but most of the spec has been implemented on the release branch, so it would probably be good to call that out. I can put something together tomorrow